Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
architecture: ${{ matrix.architecture }}
- name: install comtypes
run: |
pip install --upgrade setuptools
pip install --upgrade build
python -m pip install .
pip uninstall comtypes -y
python test_pip_install.py
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ comtypes/gen/
!comtypes/gen/__init__.py
comtypes/tools/__pycache__/*.pyc
comtypes.egg-info/*
custom location/*

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
58 changes: 57 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,63 @@
[project]
name = "comtypes"
description = "Pure Python COM package"
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what is the license of the project.
setup.cfg specify MIT, but the license file seems to says OSI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clauses in LICENSE.txt are the same as those of the MIT License.

Although starting the file with the line MIT License is the practice generally accepted today, the wording might be consistent, as the MIT License is officially listed as an OSI-approved open source license.

comtypes/LICENSE.txt

Lines 1 to 2 in 8d40715

This software is OSI Certified Open Source Software.
OSI Certified is a certification mark of the Open Source Initiative.

@cfarrow
If you remember, I would like to confirm the intent behind this license wording with you, who committed LICENSE.txt in 8d40715.
Was this common practice when this commit was made?

license-files = ["LICENSE.txt"]
authors = [
{ name = "Thomas Heller", email = "[email protected]" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dynamic = ["version"]

[project.scripts]
clear_comtypes_cache = "comtypes.clear_cache:main"

[project.urls]
Source = "https://github.com/enthought/comtypes"
Download = "https://github.com/enthought/comtypes/releases"
Issues = "https://github.com/enthought/comtypes/issues"

[build-system]
requires = ["setuptools>=61.2"]
requires = ["setuptools>=77.0.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = [
"comtypes",
"comtypes._post_coinit",
"comtypes.client",
"comtypes.server",
"comtypes.tools",
"comtypes.tools.codegenerator",
"comtypes.test",
]

[tool.setuptools.dynamic]
version = { attr = "comtypes.__version__" }

[tool.setuptools.package-data]
"comtypes.test" = [
"TestComServer.idl",
"TestComServer.tlb",
"TestDispServer.idl",
"TestDispServer.tlb",
"mytypelib.idl",
"mylib.idl",
"mylib.tlb",
"urlhist.tlb",
"test_jscript.js",
]
"comtypes" = ["hints.pyi"]

[tool.ruff.lint]
extend-select = ["I"]
ignore = ["E402"]
Expand Down
48 changes: 0 additions & 48 deletions setup.cfg

This file was deleted.

117 changes: 0 additions & 117 deletions setup.py

This file was deleted.

8 changes: 4 additions & 4 deletions test_pip_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ class TestPipInstall(unittest.TestCase):

def setUp(self):
"""prepare the same package that is usually uploaded to PyPI"""
subprocess.check_call([sys.executable, 'setup.py', 'sdist', '--format=zip'])
subprocess.check_call([sys.executable, '-m', 'build', '--sdist'])

filename_for_upload = 'comtypes-%s.zip' % read_version()
filename_for_upload = 'comtypes-%s.tar.gz' % read_version()
self.target_package = os.path.join(os.getcwd(), 'dist', filename_for_upload)
self.pip_exe = os.path.join(os.path.dirname(sys.executable), 'Scripts', 'pip.exe')

def test_pip_install(self):
"""Test that "pip install comtypes-x.y.z.zip" works"""
"""Test that "pip install comtypes-x.y.z.tar.gz" works"""
subprocess.check_call([self.pip_exe, 'install', self.target_package])

def test_no_cache_dir_custom_location(self):
"""Test that 'pip install comtypes-x.y.z.zip --no-cache-dir --target="...\custom location"' works"""
"""Test that 'pip install comtypes-x.y.z.tar.gz --no-cache-dir --target="...\custom location"' works"""
custom_dir = os.path.join(os.getcwd(), 'custom location')
if os.path.exists(custom_dir):
shutil.rmtree(custom_dir)
Expand Down