Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Modernize, use setuptools 69 #428

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

acolomb
Copy link
Collaborator

@acolomb acolomb commented May 14, 2024

Migrate setup.cfg to pyproject.toml for newer setuptools compat and create py.typed marker for automatic type checker discovery.

The py.typed marker 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.

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.

This might need a requirement bump to Python >= 3.8 as well, since that's what the new setuptools version requires.

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.
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.
@acolomb acolomb marked this pull request as ready for review May 14, 2024 10:19
Copy link
Contributor

@sveinse sveinse left a comment

Choose a reason for hiding this comment

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

Technically I'm not a collaborator for this project, but this change looks good.

@acolomb
Copy link
Collaborator Author

acolomb commented May 16, 2024

@christiansandberg I would like your opinion on this, do you see any risk for larger breakage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants