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

Migrate to pyproject toml #3063

Merged
merged 3 commits into from
Nov 13, 2023
Merged

Conversation

deronnax
Copy link
Contributor

@deronnax deronnax commented Sep 4, 2023

It's 2023 and the future is pyproject.toml 🎉

@deronnax
Copy link
Contributor Author

deronnax commented Sep 4, 2023

@benoitc can I have a CI run please 🙂 ?

@benoitc
Copy link
Owner

benoitc commented Oct 12, 2023

Thanks for the patch. can you describe what's supported in this PR?

@deronnax
Copy link
Contributor Author

deronnax commented Oct 16, 2023

Hello Benoit.
No new features, just a migration from old setup.py to the new pyproject.toml.
Why is better?

  • pyproject.toml is a python standard, setup.py is not (it's a de facto standard but now it's not anymore since there is now an official standard)
  • pyproject.toml is declarative, no more custom python code running for packaging
  • pyproject.toml allows the project to be handled by any python package manager, would you one move away from distutils
  • pyproject.toml has been designated as the future of packaging by the PyPA.

I am available if you have questions.

@benoitc benoitc merged commit 02d3dd8 into benoitc:master Nov 13, 2023
1 check passed
@benoitc
Copy link
Owner

benoitc commented Nov 13, 2023

Hi thanks for your comment. I'm not a fan such file format, but let's follow the trend :) Thanks for the PR!

@deronnax
Copy link
Contributor Author

Thank you for the merge 🙂

@deronnax
Copy link
Contributor Author

Arg, I see an error slept in: the license string is incorrect, could you please apply this fix?

diff --git a/pyproject.toml b/pyproject.toml
index ec64a328..f4afa721 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -71,7 +71,7 @@ addopts = "--assert=plain --cov=gunicorn --cov-report=xml"
 [tool.setuptools]
 zip-safe = false
 include-package-data = true
-license-files = ["['LICENSE']"]
+license-files = ["LICENSE"]

 [tool.setuptools.packages]
 find = {namespaces = false}

Or I can make a PR if you want.

@pajod
Copy link
Contributor

pajod commented Dec 9, 2023

Link in commit message was broken, so adding intended one back here in case someone reviews this while working on [tool.setuptools.packages]:
https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#flat-layout

Adding references for future readers:
https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
https://packaging.python.org/en/latest/discussions/setup-py-deprecated/
https://docs.python.org/3/library/tomllib.html

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

3 participants