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

PEP621: Migrate setup.py config into pyproject.toml #770

Closed
wants to merge 11 commits into from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Feb 26, 2023

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers
why we should accept this pull request. If it fixes a bug or resolves a feature
request, be sure to link to that issue.

PEP621 encourages the Python community to migrate away from complex setup.cfg + setup.py files by putting config data in pyproject.toml.

Migrate setup.py to setup.cfg using setuptools-py2cfg plus manual modifications.
Then migrate setup.cfg to pyproject.toml using ini2toml to do the file conversion and running validate-pyproject in pre-commit to validate the results.

The change in tox.ini from pip install --no-binary lxml --> pip install --no-cache-dir lxml is going to be mandated by the next major release of pip and decreases our tox test runtimes from 3 or 4 minutes down to 1 or 2 minutes.

Building Python projects in this way requires dropping support for Python 3.6.

If this pull request is merged then required must be removed from test (3.6) and added to test (3.11).
Also, maybe remove required from flake8 and add it to pre-commit.ci?

Screenshot 2023-02-26 at 23 56 25

Types of changes

Please check the type of change your PR introduces:

  • Release (new release request)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (PEP8, lint, formatting, renaming, etc)
  • Refactoring (no functional changes, no api changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build-related changes (build process, tests runner, etc)
  • Other (please describe):

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works

Other information

Any other information that is important to this PR such as screenshots of how
the component looks before and after the change.

@cclauss cclauss marked this pull request as draft February 26, 2023 21:39
@cclauss cclauss changed the title Pyproject.toml DRAFT: PEP621: Migrate setup.py config into pyproject.toml Feb 26, 2023
@codecov
Copy link

codecov bot commented Feb 26, 2023

Codecov Report

Merging #770 (6e63973) into master (e043b8a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           master     #770    +/-   ##
========================================
  Coverage   77.81%   77.81%            
========================================
  Files         330      330            
  Lines       10093    10093            
  Branches     1194      555   -639     
========================================
  Hits         7854     7854            
  Misses       2086     2086            
  Partials      153      153            
Flag Coverage Δ
unittests 77.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
social_core/backends/loginradius.py 0.00% <ø> (ø)
social_core/backends/untappd.py 0.00% <ø> (ø)
social_core/pipeline/partial.py 100.00% <ø> (ø)

@cclauss cclauss marked this pull request as ready for review February 26, 2023 22:41
@cclauss cclauss changed the title DRAFT: PEP621: Migrate setup.py config into pyproject.toml PEP621: Migrate setup.py config into pyproject.toml Feb 26, 2023
@nijel
Copy link
Member

nijel commented Mar 2, 2023

The change in tox.ini from pip install --no-binary lxml --> pip install --no-cache-dir lxml is going to be mandated by the next major release of pip and decreases our tox test runtimes from 3 or 4 minutes down to 1 or 2 minutes.

We really need --no-binary there, see SAML-Toolkits/python3-saml#292, #659, #738

"pytest-cov>=2.7.1",
"python-jose>=3",
"python3-saml>=1.5"
]
Copy link
Member

Choose a reason for hiding this comment

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

This all duplicates requirements-*.txt content. Can the dependencies be specified just once?

Copy link
Contributor Author

@cclauss cclauss Mar 2, 2023

Choose a reason for hiding this comment

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

Yes, but can we push that to a separate PR? This one already touches a lot of files and tox.ini and GitHub Action caching will need to be modified when dropping requirements files.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can generate the requirements files from the pyproject.toml one:

python3 -m piptools compile --output-file=requirements.txt pyproject.toml
python3 -m piptools compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
etc

@cclauss cclauss closed this Sep 21, 2023
@cclauss cclauss deleted the pyproject.toml branch September 21, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants