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 metadata from setup.py to setup.cfg #5900

Closed
wants to merge 5 commits into from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Aug 31, 2023

Perhaps a step towards #5836

This pull request was created using https://pypi.org/project/setuptools-py2cfg plus manual modifications.

https://setuptools.pypa.io/en/latest/userguide/quickstart.html#basic-use

We recommend users expose as much as possible configuration in a more declarative way via the pyproject.toml or setup.cfg, and keep the setup.py minimal with only the dynamic parts (or even omit it completely if applicable).


After a pull request like this is tested and merged, I usually do a follow-up PR like...

PEP 621: Migrate settings from setup.cfg into pyproject.toml

Migrate settings from setup.cfg into pyproject.toml using ini2toml to do the file conversion and running pyproject-fmt and then validate-pyproject in pre-commit to validate the results.

  • Currently, flake8 is not yet compatible with pyproject.toml so move its settings into .flake8.

https://setuptools.pypa.io/en/latest/userguide/quickstart.html#basic-use

We recommend users expose as much as possible configuration in a more declarative way via the pyproject.toml or setup.cfg, and keep the setup.py minimal with only the dynamic parts (or even omit it completely if applicable).

Ran validate-pyproject to validate the results.

From validate-pyproject README:

With the approval of PEP 517 and PEP 518, the Python community shifted towards a strong focus on standardization for packaging software, which allows more freedom when choosing tools during development and make sure packages created using different technologies can interoperate without the need for custom installation procedures.

This shift became even more clear when PEP 621 was also approved, as a standardized way of specifying project metadata and dependencies.

validate-pyproject was born in this context, with the mission of validating pyproject.toml files, and making sure they are compliant with the standards and PEPs.

@matteius
Copy link
Member

@cclauss I think this effort will conflict with: #5836

@cclauss
Copy link
Contributor Author

cclauss commented Aug 31, 2023

Did you read the first line of the commit message above?

I am highly supportive of 5836 but it is failing its tests. I thought we could advance step-by-step until we can rebase 5836 in a way that passes all tests. Please feel free to close this PR with unmerged commits.

@matteius
Copy link
Member

We can keep it open -- I am not sure what path would be better and I am not opinionated in this case. CC @kalebmckale

@cclauss
Copy link
Contributor Author

cclauss commented Aug 31, 2023

Oh... Now that I see:

+ pip install build
# ...
-        python -m pipenv run python setup.py sdist bdist_wheel
+        python -m pipenv run python -m build

in #5836, that makes MUCH more sense.

long_description = file: README.md
name = pipenv
author = Pipenv maintainer team
author_email = [email protected]
Copy link
Member

Choose a reason for hiding this comment

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

We should figure out something to change this to at some point since that email list is gone.

@cclauss
Copy link
Contributor Author

cclauss commented Sep 1, 2023

Closing in favor of #5836

@cclauss cclauss closed this Sep 1, 2023
@cclauss cclauss deleted the setuptools-py2cfg branch September 1, 2023 13:55
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.

2 participants