From 86e4c8851e2881b25d7ca44ce18635b33786b8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Colomb?= Date: Tue, 14 May 2024 11:41:30 +0200 Subject: [PATCH 1/3] Create py.typed marker for automatic type checker discovery. This should solve the "Cannot find implementation or library stub" errors from mypy if installed properly. Since the code already has internal type hints, adding the marker is sufficient for mypy to use them. --- canopen/py.typed | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 canopen/py.typed diff --git a/canopen/py.typed b/canopen/py.typed new file mode 100644 index 00000000..e69de29b From 43fcafeebac179ad1733cfdca6ded13cf2c592ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Colomb?= Date: Tue, 14 May 2024 11:43:22 +0200 Subject: [PATCH 2/3] Migrate setup.cfg to pyproject.toml for newer setuptools compat. The setuptools>=69 dependency includes a fix to automatically include the py.typed marker in the distribution, thus making type hints usage much easier. The newer version however fails to build when the basic project metadata is missing in pyproject.toml. Thus the settings from setup.cfg are migrated entirely, upgrading to setuptools_scm >= 8 in the process. --- pyproject.toml | 38 ++++++++++++++++++++++++++++++++++++-- setup.cfg | 29 ----------------------------- 2 files changed, 36 insertions(+), 31 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 403805fb..b6268c0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,40 @@ [build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] +requires = ["setuptools>=69", "wheel", "setuptools_scm>=8"] build-backend = "setuptools.build_meta" +[project] +name = "canopen" +authors = [ + {name = "Christian Sandberg", email = "christiansandberg@me.com"}, +] +description = "CANopen stack implementation" +readme = "README.rst" +requires-python = ">=3.6" +license = {file = "LICENSE.txt"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Intended Audience :: Developers", + "Topic :: Scientific/Engineering", +] +dependencies = [ + "python-can >= 3.0.0", +] +dynamic = ["version"] + +[project.urls] +documentation = "https://canopen.readthedocs.io/en/stable/" +repository = "https://github.com/christiansandberg/canopen" + [tool.setuptools_scm] -write_to = "canopen/_version.py" +version_file = "canopen/_version.py" + +[tool.pytest.ini_options] +testpaths = [ + "test", +] +filterwarnings = [ + "ignore::DeprecationWarning", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7d33e805..00000000 --- a/setup.cfg +++ /dev/null @@ -1,29 +0,0 @@ -[metadata] -name = canopen -description = CANopen stack implementation -long_description = file: README.rst -project_urls = - Documentation = http://canopen.readthedocs.io/en/stable/ - Source Code = https://github.com/christiansandberg/canopen -author = Christian Sandberg -author_email = christiansandberg@me.com -classifier = - Development Status :: 5 - Production/Stable - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 3 :: Only - Intended Audience :: Developers - Topic :: Scientific/Engineering - -[options] -packages = find: -python_requires = >=3.6 -install_requires = - python-can >= 3.0.0 -include_package_data = True - -[tool:pytest] -testpaths = - test -filterwarnings = - ignore::DeprecationWarning From e4a115a19300f7b9217d5e8f863531b501eb0866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Colomb?= Date: Tue, 11 Jun 2024 20:44:07 +0200 Subject: [PATCH 3/3] Include top-three contributors as authors. Based on stats from GitHub, master branch as of today. --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b6268c0c..bffee508 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,8 @@ build-backend = "setuptools.build_meta" name = "canopen" authors = [ {name = "Christian Sandberg", email = "christiansandberg@me.com"}, + {name = "André Colomb", email = "src@andre.colomb.de"}, + {name = "André Filipe Silva", email = "afsilva.work@gmail.com"}, ] description = "CANopen stack implementation" readme = "README.rst"