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

PEP 621: Migrate to pyproject.toml #140

Merged
merged 1 commit into from Sep 17, 2022
Merged

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Sep 17, 2022

Migrate to pyproject.toml using ini2toml to do the file conversion and running validate-pyproject in pre-commit to validate the results.

  • setup.cfg: kewords --> keywords See pre-commit: Fix typos using codespell #141
  • Comment out tool.setuptools.test-suite which was deprecated in setuptool v41.5.0 and simply run pytest
  • Currently flake8 is not compatible with pyproject.toml so put its config in a dedicated .flake8 file.
  • Test with pipx install --force git+https://github.com/cclauss/autoflake.git@pyproject.toml

From validate-pyproject README:

With the approval of PEP 517 and PEP 518, the Python community shifted towards a strong focus on standardisation 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 standardised 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.

@cclauss cclauss changed the title Pyproject.toml Migrate to pyproject.toml Sep 17, 2022
@cclauss cclauss changed the title Migrate to pyproject.toml PEP621: Migrate to pyproject.toml Sep 17, 2022
@cclauss cclauss changed the title PEP621: Migrate to pyproject.toml PEP 621: Migrate to pyproject.toml Sep 17, 2022
- name: run tests
run: python setup.py test
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now that setup.py is gone, how should we release? Can you also update the workflow declared in upload-to-pypi.yaml?

@@ -33,8 +33,10 @@ jobs:

- run: pip install .

- run: pip install pytest
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now that we have pyproject perhaps we can migrate to poetry to manage dev dependencies too. No need to do it as part of this PR though.

Copy link
Collaborator

@fsouza fsouza left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! I'm going to merge and migrate to poetry in a follow-up PR. That should take care of uploading to PyPI too.

@fsouza fsouza merged commit 9912a2e into PyCQA:main Sep 17, 2022
@cclauss cclauss deleted the pyproject.toml branch September 18, 2022 02:58
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