Skip to content

[Doubt] Distribution.get_name() always "UNKNOWN" in extensions when using pyproject.toml (in setuptools.finalize_distribution_options entry-point) #4247

Open
@hansingt

Description

@hansingt

setuptools version

setuptools==69.1.1

Python version

Python 3.11

OS

Fedoa Workstation 39

Additional environment information

No response

Description

I've a custom setuptools extension, which tries to do some things, based on the name of the Distribution. It has worked before, but now, we are migrating the keywords from the setup.py to the pyproject.toml and this resulted in the Distribution.get_name() always being UNKNOWN in the Options finalizer (setuptools.finalize_distribution_options entry-point).

Expected behavior

I'd have expected the distribution options to be set when running the option finalizers, regardless of whether the options are set using the pyproject.toml or the setup.py.

How to Reproduce

  1. Clone the example from https://github.com/hansingt/setuptools-dist-name-unknown
  2. python -m venv venv
  3. ./venv/bin/pip install -e .
  4. ./venv/bin/python setup.py --name

Output

DIST NAME: UNKNOWN
test

PS: The behaviour is demonstrated using a direct call to setup.py, but it behaves the same, when building the distribution, either using setup.py bdist_wheel,pip wheel, or python -m build. The only difference is, that you don't see the output when running these commands.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions