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

Warn (or error) when setuptools.build_meta:__legacy__ is explicitly specified #1689

Open
pganssle opened this issue Feb 17, 2019 · 1 comment
Labels
enhancement Needs Discussion Issues where the implementation still needs to be discussed.

Comments

@pganssle
Copy link
Member

pganssle commented Feb 17, 2019

Per the original discussion, setuptools.build_meta:__legacy__ was intended only as a default and was not intended to be specified as the build backend. If we're going to go ahead with #1688, we'll need to be able to parse pyproject.toml anyway, so this could be a fairly simple way to start working with pyproject.toml and get started on #1688 without committing to support a whole new format.

I'd say it would be a good idea to get this done sooner rather than later, and preferably just make it an error directly, before too many people start using setuptools.build_meta:__legacy__ directly.

Of course, the major downside to this is that it sorta breaks the separation between front-end and back-end in PEP 517, since we now have to read the front end's configuration to determine if it's being used incorrectly. I'm not sure if it's worth maintaining the purity of this separation at the cost of a bunch of people starting to explicitly depend on setuptools.build_meta:__legacy__.

@pganssle pganssle added enhancement Needs Discussion Issues where the implementation still needs to be discussed. labels Feb 17, 2019
@jaraco
Copy link
Member

jaraco commented Mar 9, 2019

it sorta breaks the separation between front-end and back-end in PEP 517

I agree - that seems like the wrong approach. I'd rather that pip (or other front-end tool) provide this protection.

mgorny added a commit to mgorny/ipython that referenced this issue Jun 10, 2022
1. Remove the redundant `wheel` dependency.  The setuptools build
   backend has been adding it automatically since day one, and it was
   explicitly specified in the docs as a mistake.  See:
   pypa/setuptools@f7d30a9

2. Replace the legacy backend with the regular backend.  The legacy
   backend was only intended to be used implicitly when `pyproject.toml`
   does not specify only, and was not supposed to be specified
   explicitly there.  See:
   pypa/setuptools#1689

3. Add `backend-path` as required for `setup.py` to be able to import
   setupbase from the current directory.  Alternatively, this can
   be done via modifying `sys.path` inside the code.
mgorny added a commit to mgorny/ipython that referenced this issue Jun 10, 2022
1. Remove the redundant `wheel` dependency.  The setuptools build
   backend has been adding it automatically since day one, and it was
   explicitly specified in the docs as a mistake.  See:
   pypa/setuptools@f7d30a9

2. Replace the legacy backend with the regular backend.  The legacy
   backend was only intended to be used implicitly when `pyproject.toml`
   does not specify only, and was not supposed to be specified
   explicitly there.  See:
   pypa/setuptools#1689

3. Prepend the current directory to `sys.path` as required for
   `setup.py` to reliably import `setupbase`.  The non-legacy backend
   no longer does this for us.
mgorny added a commit to mgorny/readme_renderer that referenced this issue Aug 7, 2022
Use the regular `setuptools.build_meta` backend rather than
the `__legacy__` backend.  The latter was never meant to be used
explicitly in `pyproject.toml` files but rather as implicit fallback
in tools such as pip(1).  See e.g.:
pypa/setuptools#1689
mgorny added a commit to mgorny/readme_renderer that referenced this issue Aug 7, 2022
Use the regular `setuptools.build_meta` backend rather than
the `__legacy__` backend.  The latter was never meant to be used
explicitly in `pyproject.toml` files but rather as implicit fallback
in tools such as pip(1).  See e.g.:
pypa/setuptools#1689

Signed-off-by: Michał Górny <mgorny@gentoo.org>
di added a commit to pypa/readme_renderer that referenced this issue Aug 7, 2022
* Remove redundant wheel dep from pyproject.toml

Remove the redundant `wheel` dependency, as it is added by the backend
automatically.  Listing it explicitly in the documentation was
a historical mistake and has been fixed since, see:
pypa/setuptools@f7d30a9

Signed-off-by: Michał Górny <mgorny@gentoo.org>

* Remove install-time dependencies from pyproject.toml requires

Remove the install-time dependencies from pyproject.toml `requires` key.
This key is used to specify the packages that are needed to build
the wheel, and FWICS none of these packages are actually needed
throughout the run of `setup.py`.  I can also confirm that a pure venv
`python -m build -w` works fine without them.

Signed-off-by: Michał Górny <mgorny@gentoo.org>

* Use the non-legacy setuptools backend in pyproject.toml

Use the regular `setuptools.build_meta` backend rather than
the `__legacy__` backend.  The latter was never meant to be used
explicitly in `pyproject.toml` files but rather as implicit fallback
in tools such as pip(1).  See e.g.:
pypa/setuptools#1689

Signed-off-by: Michał Górny <mgorny@gentoo.org>

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
francoisfreitag added a commit to francoisfreitag/django-auth-ldap that referenced this issue Aug 16, 2022
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
francoisfreitag added a commit to francoisfreitag/django-phonenumber-field that referenced this issue Aug 16, 2022
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
francoisfreitag added a commit to francoisfreitag/html2docx that referenced this issue Aug 16, 2022
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
francoisfreitag added a commit to erezlife/html2docx that referenced this issue Aug 16, 2022
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
francoisfreitag added a commit to stefanfoulis/django-phonenumber-field that referenced this issue Aug 28, 2022
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
tylerc2023 added a commit to tylerc2023/django-phonenumber-field that referenced this issue Sep 8, 2022
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
stevanovicmilan839 added a commit to stevanovicmilan839/django-phonenumber-field that referenced this issue Nov 2, 2022
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
francoisfreitag added a commit to django-auth-ldap/django-auth-ldap that referenced this issue Mar 28, 2023
https://code.djangoproject.com/ticket/33778

The wheel dependency is redundant and discouraged here. Setuptools adds
this dependency via the backend automatically since day one. It was
historically included in the documentation but it was a mistake. See:
pypa/setuptools@f7d30a9

The legacy backend was never supposed to be used in pyproject.toml. It
is only an "internal" fallback that is used by tools like pip when
pyproject.toml is not present at all. The regular backend must always be
used in pyproject.toml. See:
pypa/setuptools#1689
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs Discussion Issues where the implementation still needs to be discussed.
Projects
None yet
Development

No branches or pull requests

2 participants