Skip to content

DO NOT MERGE: trying out setuptools PR #3711

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

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Feb 9, 2022

Description

This is based on #3719.

See henryiii#9 too.

@henryiii henryiii force-pushed the henryiii/experimental/setuptools621 branch 2 times, most recently from ed9fb09 to 89f00f5 Compare February 11, 2022 20:51
@henryiii
Copy link
Collaborator Author

henryiii commented Feb 11, 2022

So far:

E         -  'pybind11_global.egg-info/not-zip-safe',

is missing with the TOML config.

@abravalheri
Copy link
Contributor

Thanks @henryiii, I will check!

@henryiii
Copy link
Collaborator Author

Okay, that's weird, a single job has this:

AttributeError: module 'pybind11' has no attribute 'get_include'

I think it's related to the not-zip-safe issue, at least that's my guess. That's from pybind11-global, which is the weird legacy version that has "global" data and headers, rather than being inside a Python package.

@abravalheri
Copy link
Contributor

Ok, I tried the following:

% PYBIND11_GLOBAL_SDIST=1 .python -m buildls dist
% ls dist
pybind11-2.10.0.dev1.tar.gz  pybind11_global-2.10.0.dev1-py3-none-any.whl

and I noticed the names of the files produced... The sdist name does not contain _global...

I think this is caused by the fact that PEP 621 requires name to be statically defined in the pyproject.toml (so in theory trying to redefine it dynamically should not be an option).

The tar.gz file however does contain a not-zip-safe member:

% tar tf dist/pybind11-2.10.0.dev1.tar.gz | grep zip
pybind11-2.10.0.dev1/pybind11.egg-info/not-zip-safe

@abravalheri
Copy link
Contributor

@henryiii, I think that for pybind11_global you will have to edit pyproject.toml before running the build 😅

@abravalheri
Copy link
Contributor

E         -  'pybind11_global.egg-info/not-zip-safe',

is missing with the TOML config.

I added a test case for that in pypa/setuptools@ed73bc5. Let's see what happens with the test suite, but running the tests locally the not-zip-safe file seems to be generated.

@henryiii
Copy link
Collaborator Author

Ah, yes, I wasn't really expecting this to fully work with PEP 621 metadata, I was originally seeing if it would still work with the changes and the old system. The static name is correct. I'd be perfectly fine adding some sort of pre-processing system to make the global SDist.

abravalheri added a commit to pypa/setuptools that referenced this pull request Feb 12, 2022
abravalheri added a commit to pypa/setuptools that referenced this pull request Feb 18, 2022
abravalheri added a commit to pypa/setuptools that referenced this pull request Feb 19, 2022
@henryiii henryiii force-pushed the henryiii/experimental/setuptools621 branch from 74d3caa to 9d5312f Compare February 20, 2022 19:35
abravalheri added a commit to pypa/setuptools that referenced this pull request Mar 5, 2022
@abravalheri abravalheri force-pushed the henryiii/experimental/setuptools621 branch from fc3d420 to 7962d22 Compare March 6, 2022 02:50
pre-commit-ci bot and others added 2 commits March 6, 2022 02:51
As discussed in
https://discuss.python.org/t/help-testing-experimental-features-in-setuptools/13821/59
the handling of `license` has changed to better complain with PEP 621.

The changes introduced here reflect that change.
@abravalheri
Copy link
Contributor

I updated the PR to reflect the changes discussed in https://discuss.python.org/t/help-testing-experimental-features-in-setuptools/13821/59, regarding
the handling of license to better complain with PEP 621.

@@ -47,10 +48,6 @@ Chat = "https://gitter.im/pybind/Lobby"
[tool.setuptools]
zip-safe = false

[tool.setuptools.dynamic]
license = "BSD"
license-files = ["LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*"]
Copy link
Contributor

@abravalheri abravalheri Mar 23, 2022

Choose a reason for hiding this comment

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

These are the default values already considered by setuptools and wheel.

Since it was clarified in the Python discourse that specifying project.license statically does not impede the backend to dynamically populate License-files in the core metadata, having a dynamic license is no longer necessary.

Chat = "https://gitter.im/pybind/Lobby"

[tool.setuptools]
zip-safe = false
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this option is even necessary nowadays.

According to the docs: it will consider the project unsafe if it contains any C extensions or datafiles whatsoever.

But more importantly... This flag works for eggs right? I believe pip will always extract the package anyway...

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.

2 participants