Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PEP 621: Migrate from setup.{py, cfg} to pyproject.toml #315

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

Merged
merged 2 commits into from
Mar 7, 2025

Conversation

cclauss
Copy link
Member

@cclauss cclauss commented Mar 2, 2025

https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html

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 pyproject-fmt and then validate-pyproject to validate the results.

    strategy:
      matrix:
        fail-fast: false
        # Python 3.8 is EOL. Also adapt tox.ini
        python-version: ['3.8', 'pypy3.11', '3.13']
        # macOS on ARM, Ubuntu on x86, Windows on X86
        os: [macos-latest, ubuntu-latest, windows-latest]

@aaronliu0130
Copy link
Member

aaronliu0130 commented Mar 2, 2025

This is awkward... I may be biased, but I prefer my #307 PR, which also includes the migrations but with dynamic version (based on cpplint.py) and dependencies (based on the dependency listing files). (I also read in pytest docs that they prefer storing settings in .pytest.ini so that's what I did.)

My PR would also automatically use the newest Python. (I also don't see reason to drop EOL Python versions for no reason; I think we should only drop it when something becomes an issue. And by "issue" I mean things like the EOL 3.7 not having the walrus operator.)

aaronliu0130 added a commit that referenced this pull request Mar 2, 2025
Not really the main subject of the PR; would overlap with #315 anyways.
aaronliu0130 added a commit that referenced this pull request Mar 2, 2025
@aaronliu0130
Copy link
Member

aaronliu0130 commented Mar 2, 2025

I also don't see reason to drop EOL.

Sorry about that, I've realized the issue now: newer versions of Pylint you need don't support 3.9. So I support bumping minimum to 3.9 now.

@cclauss
Copy link
Member Author

cclauss commented Mar 2, 2025

I believe we should all push projects to not build on foundations that no longer receive security updates.

Please cherry pick anything that is interesting here and put it in #307 and we can land that and close this.

@cclauss cclauss requested review from tkruse and aaronliu0130 March 2, 2025 22:05
@cclauss
Copy link
Member Author

cclauss commented Mar 2, 2025

I may be biased, but I prefer my #307 PR

You create pull requests under one username and review pull requests on the same repository under a different username? Seems duplicitous.

@aaronliu0130
Copy link
Member

You create pull requests under one username and review pull requests on the same repository under a different username? Seems duplicitous.

I accidentally merged a PR that broke everything once; I started a PR to fix that. As @jayvdb (the only other active maintainer) is not active and the PR sat for weeks, I started doing that and jayvdb doesn't seem to mind.

@cclauss
Copy link
Member Author

cclauss commented Mar 3, 2025

I accidentally merged a PR that broke everything once

This is not something that happened just once. I find a repeated duplicitous and dangerous pattern of eight pull requests created by @norab0130 and approved and merged by @aaronliu0130 when the same person controls both accounts.

This repeated pattern intentionally circumvents the supply chain security policy of this repo that a maintainer who is not the author reviews and approves every pull request before it is merged. This policy is standard for Google and most other widely installed software tools. If anyone thinks this is not a problem, they are not paying enough attention to software supply chain security issues.

The code in this repo is not owned by one person but is instead the work of many that needs to be treated safely and with respect. If a maintainer is not paying enough attention to review pull requests on widely deployed production code, then one or more new maintainers must be added to the project.

Actions: I have the commit-bit for my previous work on this repo.

  1. I will close the three open PRs created by @norab0130. I ask that this user not create any new pull requests on this repo. This is done out of an abundance of caution given the circumvention of the security policies of this repo. If @aaronliu0130 wants to recreate them under their username, then another maintainer (myself included) can review and merge them.
  2. I ask @jayvdb @mattyclarkson @tkruse @theandrewdavis to review the eight pull requests above to ensure that nothing suspicious has already been merged into this broadly deployed codebase.
  3. I ask that if this duplicitous and dangerous pattern is being repeated on other GitHub repos, it must be stopped immediately.

EDIT:
If this was deliberately deceptive @norab0130 would be called a "sock puppet account" in the OSSF Scorecard docs.

@aaronliu0130
Copy link
Member

This is the only place where I've used that account for this purpose, as someone from a "pgrouting" repository started complaining about the errors on the development branch. No problem not using that account if there's other active maintainers around to use that account. I'm happy for you, an active maintainer, to review my pull requests from now on!

@cclauss cclauss merged commit 755497f into develop Mar 7, 2025
10 checks passed
@cclauss cclauss deleted the pyproject.toml branch March 7, 2025 05:32
@cclauss cclauss mentioned this pull request Mar 7, 2025
Comment on lines +44 to 59
optional-dependencies.test = [
"parameterized",
"pytest",
"pytest-cov",
"pytest-timeout",
"testfixtures",
"tox<5",
]
optional-dependencies.testing = [
"parameterized",
"pytest",
"pytest-cov",
"pytest-timeout",
"testfixtures",
"tox<5",
]
Copy link
Member

Choose a reason for hiding this comment

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

Rebasing rn, is there a reason the text extra was duplicated lol

Copy link
Member Author

@cclauss cclauss Mar 7, 2025

Choose a reason for hiding this comment

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

.test, .testing, and .dev all existed in setup.py so I replicated them in pyproject.toml (plus requirements files) to be sure I did not break anything.

Once we merge the open pre-commit PRs the only tools we will need in .dev will be pytest-related. At that point, we can drop .test and .testing and just have dev.

The other issue is that the version is hard coded in both pyproject.toml and in Python code. That should be fixed by making version dynamic in pyproject.toml and read out of the Python code.

@aaronliu0130 aaronliu0130 linked an issue Mar 19, 2025 that may be closed by this pull request
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.

Convert setup.py to a pyproject.toml
3 participants