Skip to content

Disallow deprecated dash-separated and uppercase options in setup.cfg #4870

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 6 commits into from
Mar 23, 2025

Conversation

abravalheri
Copy link
Contributor

Summary of changes

@jaraco, this is a possible approach for #4864, if we are feeling brave.
But it can break packages that have not addressed the warning.

Closes #4864

Pull Request Checklist

return set(distutils.command.__all__)
return {*distutils.command.__all__, *eps}


Copy link
Contributor Author

@abravalheri abravalheri Mar 9, 2025

Choose a reason for hiding this comment

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

I moved this function out of the class to allow caching without memory leaks (otherwise it would keep a reference to self).

Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

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

I'm inclined to say we should do it, even though it will cause some disruption.

The only other options I can think of are:

  1. Fail intermittently, so users can retry and succeed but also get the signal that something is broken and start complaining to the offending project.
  2. During the deprecation warning, sleep for some time, giving users a chance to ponder their life choices and maybe investigate the cause, motivating complaints to the offending project.
  3. Develop a more sophisticated signal from deprecations in build backends to the offending projects.
  4. Roll back the deprecations and just accept the status quo.

The first three are really about the deprecation strategy of this project and not this specific deprecation. Given that to date, the deprecation process we have in place is the best process available, I'm inclined to just push forward with it, though I'm open to delay these depreciations if we think the churn or disruption is too great.

@jaraco
Copy link
Member

jaraco commented Mar 9, 2025

We'll want a news fragment that clearly describes what the change was, how to respond to it, and links to more detailed rationale for why it was changed.

@abravalheri
Copy link
Contributor Author

Thank you very much for the review @jaraco.

We'll want a news fragment that clearly describes what the change was, how to respond to it, and links to more detailed rationale for why it was changed.

The best I could find for the rationale behind the deprecation was v54.1.0 (#1608) and v54.1.1 (#2592). I added those to the news fragment. hopefully that is OK.

@abravalheri abravalheri marked this pull request as ready for review March 9, 2025 18:28
@abravalheri abravalheri mentioned this pull request Mar 11, 2025
6 tasks
@jaraco jaraco merged commit e7c42a0 into pypa:main Mar 23, 2025
22 of 24 checks passed
@abravalheri abravalheri deleted the issue-4864 branch March 23, 2025 08:10
@DavidCain
Copy link

Given that to date, the deprecation process we have in place is the best process available, I'm inclined to just push forward with it, though I'm open to delay these depreciations if we think the churn or disruption is too great.

Can there be an option to disable enforcement of no-dash naming? This does indeed break installation of some packages when using latest setuptools. Obviously, fixing the packages (or upgrading to newer versions) is preferable, but not always practical!

@zanieb
Copy link

zanieb commented Mar 24, 2025

We're already seeing this causing disruptions in the ecosystem via bug reports to uv and core packages like requests are in violation here (https://github.com/psf/requests/blob/main/setup.cfg). I think this should be reverted.

If the ecosystem had better support for locking and constraining build dependencies, the trade-offs may be different but unfortunately that's not the case yet.

@systemsoverload
Copy link

+1 this is causing a massive disruption in all of our builds. There are just too many legacy packages that violate this paradigm to not have an override option of some kind. I would ask that this be reverted while a discussion can be had on workarounds

@toby-j
Copy link

toby-j commented Mar 24, 2025

[tool.uv]
build-constraint-dependencies = ["setuptools<78"]

Tried adding this, but getting the same error.

@zanieb
Copy link

zanieb commented Mar 24, 2025

@toby-j for workarounds in uv, see astral-sh/uv#12440

@danielcarcich
Copy link

Unexpected build issues I didn't need in my life come Monday morning. Please roll it back and remove the deprecation warning. There's no practical downside to supporting the old convention indefinitely.

@michaelpavkovic
Copy link

michaelpavkovic commented Mar 24, 2025

I would strongly encourage this change to be rolled back (@jaraco's 4th recommendation). This change will break countless builds pretty much everywhere. We all either directly or indirectly rely upon a version of some package (it may even be a super big popular one), where a dash is used in setup.cfg.

At my place of work, I'm noticing all of my team's builds breaking and we will not be able to use the latest version of setuptools anywhere if this change is kept in place.

Even though this was warned about years back, we can't rely upon every 3rd party dependency to fix these formatting issues.

@christianfobel-telus
Copy link

we will not be able to use the latest version of setuptools anywhere if this change is kept in place.
...
Even though this was warned about years back, we can't rely upon every 3rd party dependency to fix these formatting issues.

Exactly this.

@cspades
Copy link

cspades commented Mar 24, 2025

Hi, pysox is affected as well: https://github.com/marl/pysox/blob/master/setup.cfg#L2! Revert or add some legacy option to make this more flexible! 🙏🏻

@jeff-omni
Copy link

neptune is affected from its dependency on bravado-core; see Yelp/bravado-core#411 for a fix, but we are at the mercy of the package maintainers

openstack-mirroring pushed a commit to openstack/kolla-ansible that referenced this pull request Mar 24, 2025
setuptools 78.0.1 disallowed deprecated dash-separated
and uppercase options in setup.cfg [1]

[1] pypa/setuptools#4870

Change-Id: I7c51eb7d62a209c2ff53b0a6f49dcbdcdabd7c6d
kmurphy4 added a commit to Everlaw/fastText that referenced this pull request Mar 24, 2025
In `setuptools==78.0.1`, they started enforcing that no dependencies
specify this legacy field (pypa/setuptools#4870).

They ended up reverting in pypa/setuptools#4911,
but presumably they'll turn this behavior back on in the future...
@ghananigans
Copy link

Looks like the change was reverted and a new release has been made 🎉

openstack-mirroring pushed a commit to openstack/kolla-ansible that referenced this pull request Mar 25, 2025
setuptools 78.0.1 disallowed deprecated dash-separated
and uppercase options in setup.cfg [1]

[1] pypa/setuptools#4870

Change-Id: I7c51eb7d62a209c2ff53b0a6f49dcbdcdabd7c6d
(cherry picked from commit 0aa7766)
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Mar 25, 2025
* Update kolla-ansible from branch 'master'
  to 6ebdbb97954b787a1cb002cb6cc9f174b7b63ffa
  - setup.cfg: Replace dashes with underscores
    
    setuptools 78.0.1 disallowed deprecated dash-separated
    and uppercase options in setup.cfg [1]
    
    [1] pypa/setuptools#4870
    
    Change-Id: I7c51eb7d62a209c2ff53b0a6f49dcbdcdabd7c6d
    (cherry picked from commit 0aa7766c1b791d9e311aad7b3cf7d01ff2a64c62)
@ianballard
Copy link

ianballard commented Mar 25, 2025

kmurphy4 added a commit to Everlaw/fastText that referenced this pull request Mar 30, 2025
In `setuptools==78.0.1`, they started enforcing that no dependencies
specify this legacy field (pypa/setuptools#4870).

They ended up reverting in pypa/setuptools#4911,
but presumably they'll turn this behavior back on in the future...
MoteHue pushed a commit to stackhpc/kolla-ansible that referenced this pull request Apr 14, 2025
setuptools 78.0.1 disallowed deprecated dash-separated
and uppercase options in setup.cfg [1]

[1] pypa/setuptools#4870

Change-Id: I7c51eb7d62a209c2ff53b0a6f49dcbdcdabd7c6d
(cherry picked from commit 0aa7766)
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.

[BUG] DID NOT WARN errors on two tests