pybind11 icon indicating copy to clipboard operation
pybind11 copied to clipboard

DO NOT MERGE: trying out setuptools PR

Open henryiii opened this issue 3 years ago • 8 comments

Description

This is based on #3719.

See https://github.com/henryiii/pybind11/pull/9 too.

henryiii avatar Feb 09 '22 21:02 henryiii

So far:

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

is missing with the TOML config.

henryiii avatar Feb 11 '22 21:02 henryiii

Thanks @henryiii, I will check!

abravalheri avatar Feb 11 '22 22:02 abravalheri

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.

henryiii avatar Feb 11 '22 22:02 henryiii

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 avatar Feb 11 '22 22:02 abravalheri

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

abravalheri avatar Feb 11 '22 22:02 abravalheri

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

is missing with the TOML config.

I added a test case for that in https://github.com/pypa/setuptools/pull/3068/commits/ed73bc52fde8d3106295f24b9a45dea8292374bd. Let's see what happens with the test suite, but running the tests locally the not-zip-safe file seems to be generated.

abravalheri avatar Feb 11 '22 23:02 abravalheri

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.

henryiii avatar Feb 12 '22 00:02 henryiii

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.

abravalheri avatar Mar 23 '22 22:03 abravalheri