Skip to content

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

Merged
jaraco merged 6 commits into
pypa:mainfrom
abravalheri:issue-4864
Mar 23, 2025
Merged

Disallow deprecated dash-separated and uppercase options in setup.cfg#4870
jaraco merged 6 commits into
pypa:mainfrom
abravalheri:issue-4864

Conversation

@abravalheri

Copy link
Copy Markdown
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

Comment thread setuptools/dist.py
return set(distutils.command.__all__)
return {*distutils.command.__all__, *eps}


@abravalheri abravalheri Mar 9, 2025

Copy link
Copy Markdown
Contributor Author

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).

@jaraco jaraco left a comment

Copy link
Copy Markdown
Member

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.

Comment thread setuptools/dist.py Outdated
@jaraco

jaraco commented Mar 9, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Comment thread newsfragments/4870.removal.rst Outdated
@abravalheri abravalheri mentioned this pull request Mar 11, 2025
6 tasks
Comment thread setuptools/dist.py Outdated
@jaraco jaraco merged commit e7c42a0 into pypa:main Mar 23, 2025
@abravalheri abravalheri deleted the issue-4864 branch March 23, 2025 08:10
@DavidCain

Copy link
Copy Markdown

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

zanieb commented Mar 24, 2025

Copy link
Copy Markdown

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
Copy Markdown

+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

toby-j commented Mar 24, 2025

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

Tried adding this, but getting the same error.

@zanieb

zanieb commented Mar 24, 2025

Copy link
Copy Markdown

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

@michaelpavkovic

michaelpavkovic commented Mar 24, 2025

Copy link
Copy Markdown

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
Copy Markdown

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

cspades commented Mar 24, 2025

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

ianballard commented Mar 25, 2025

Copy link
Copy Markdown

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)
chschilling pushed a commit to chschilling/kolla-ansible that referenced this pull request Nov 6, 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