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

[BUG] ConfigDiscovery.analyse_name incorrectly sets the name attribute on Distribution #3545

Closed
jeamland opened this issue Aug 19, 2022 · 0 comments · Fixed by #3547
Closed
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@jeamland
Copy link
Contributor

setuptools version

setuptools==65.1.0

Python version

Python 3.10.2

OS

macOS 12.5, Oracle Linux Server release 8.6

Additional environment information

No response

Description

Under certain circumstances (see reproduction steps) setuptools.discovery.ConfigDiscovery.analyse_name will overwrite the name attribute of the Distribution object leading to python setup.py --name failing.

Expected behavior

$ python setup.py --name
my_package_name

How to Reproduce

A project demonstrating this issue (along with a detailed description of what's going on) can be found here:

https://github.com/jeamland/setuptools-name-bug

Output

$ python setup.py --name
/Users/benno/.pyenv/versions/setuptools-name-bug/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py:108: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
  warnings.warn(msg, _BetaConfiguration)
Traceback (most recent call last):
  File "/Users/benno/work/setuptools-name-bug/setup.py", line 3, in <module>
    setup()
  File "/Users/benno/.pyenv/versions/setuptools-name-bug/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/Users/benno/.pyenv/versions/setuptools-name-bug/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 170, in setup
    ok = dist.parse_command_line()
  File "/Users/benno/.pyenv/versions/setuptools-name-bug/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 471, in parse_command_line
    args = parser.getopt(args=self.script_args, object=self)
  File "/Users/benno/.pyenv/versions/setuptools-name-bug/lib/python3.10/site-packages/setuptools/_distutils/fancy_getopt.py", line 274, in getopt
    val = getattr(object, attr, 0) + 1
TypeError: can only concatenate str (not "int") to str
@jeamland jeamland added bug Needs Triage Issues that need to be evaluated for severity and status. labels Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant