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

Upgrade setuptools to fix CVE #21314

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

krishnan-chandra
Copy link
Contributor

@krishnan-chandra krishnan-chandra commented Aug 16, 2024

Closes #21184. This has the side effect of removing default tool lockfile support for Python 3.7 by default; however, support can be restored via creating a custom tool lockfile.

@krishnan-chandra krishnan-chandra added category:internal CI, fixes for not-yet-released features, etc. backend: Python Python backend-related issues labels Aug 16, 2024
@krishnan-chandra
Copy link
Contributor Author

This is a bit gnarly, because the tests in many other places in the Pants repo depend upon the setuptools backend. We can either change those tests to work with Python 3.8+, or abandon this upgrade for now. Not sure what the best course of action is.

`buildifier` was added to the list of supported formatters that can be used to format the BUILD files.
It may be helpful if your organization is migrating from Bazel and wants to keep the style of the BUILD files
consistent or if for any other reason you may want to adopt the formatting style that is enforced by `buildifier`.
`buildifier` was added to the list of supported formatters that can be used to format the BUILD files.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about these changes - looks like my editor took out some trailing whitespace on lines. If the whitespace is needed I'm happy to revert out the whitespace changes specifically.

cburroughs added a commit to cburroughs/pants that referenced this pull request Sep 7, 2024
Delicious delicious dog food.

First spotted in pantsbuild#21314
@cburroughs
Copy link
Contributor

@krishnan-chandra thanks for running with this so far! I hope to tease out some of the Python 3.7 and other complications you ran into, which I hope leaves a more straightforward setuptools upgrade and not a tangled rebase mess.

cburroughs added a commit that referenced this pull request Sep 9, 2024
Delicious delicious dog food.

First spotted in #21314
cburroughs added a commit to cburroughs/pants that referenced this pull request Sep 10, 2024
As a consequence, most tests no longer work with 3.7 since -- for
example -- the lockfile with pytest does not support 3.7.  This
downgrades 3.7 to "probably works but not well tested", which
is the same state as 3.6.  Since 3.7 has been EoL for over a year I
think this is reasonable.  This opens up the way for Python 3.13
support in lockfiles among other benefits.

As another consequence, lockfiles are regenerated which means we have
some new versions coming along for the ride.  The pretty lockfile diff
does not seem to work with the generation script though --> pantsbuild#21388

Uses of Pants can still use 3.7 by generating their own
lockfiles. Deprecation plan annouced at
https://www.pantsbuild.org/blog/2024/08/24/venerable-pythons

Based off work started in pantsbuild#21314

ref pantsbuild#21184, pantsbuild#21103, pantsbuild#20852
@huonw
Copy link
Contributor

huonw commented Sep 11, 2024

We've just branched for 2.23, so merging this pull request now will come out in 2.24, please move the release notes updates to docs/notes/2.24.x.md. Thank you!

cburroughs added a commit that referenced this pull request Sep 12, 2024
As a consequence, most tests no longer work with 3.7 since -- for
example -- the lockfile with pytest does not support 3.7. This
downgrades 3.7 to "probably works but not well tested", which is the
same state as 3.6. Since 3.7 has been EoL for over a year I think this
is reasonable. This opens up the way for Python 3.13 support in
lockfiles among other benefits.

As another consequence, lockfiles are regenerated which means we have
some new versions coming along for the ride. The pretty lockfile diff
does not seem to work with the generation script though --> #21388

Uses of Pants can still use 3.7 by generating their own lockfiles.
Deprecation plan announced at
https://www.pantsbuild.org/blog/2024/08/24/venerable-pythons

Based off work started in #21314

ref #21184, #21103, #20852
@cburroughs
Copy link
Contributor

With #21389 landed I think this should be clear of scope spiraling road blocks. Let me know if you run into any other trouble.

@krishnan-chandra
Copy link
Contributor Author

Yes! I think that should be the last roadblock, I will get this cleaned up and rebased later today.

@cburroughs cburroughs merged commit aff4bb2 into pantsbuild:main Sep 13, 2024
25 checks passed
@krishnan-chandra krishnan-chandra deleted the upgrade-setuptools branch September 13, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Python Python backend-related issues category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vulnerability in setuptools versions up to 69.1.1
3 participants