zopefoundation / zope.interface

Interfaces for Python
http://zopeinterface.readthedocs.io/
Other
330 stars 71 forks source link

6.4 sdist on PyPI not installable by zc.buildout #298

Closed icemac closed 5 months ago

icemac commented 5 months ago

PROBLEM REPORT

What I did:

Install zope.interface==6.4 on PyPy in https://github.com/zopefoundation/zopetoolkit/actions/runs/9155131998/job/25261849191?pr=95

What I expect to happen:

Successful install.

What actually happened:

Error: Couldn't find a distribution for 'zope.interface==6.4'.

The reason seems to be that the sdist of zope.interface 6.4 is named zope_interface-6.4.tar.gz, so an _ instead of a . between zope and interface. – It is not clear to me which tool did this. Running python setup.py sdist with setuptools==65.5.0 did create a correctly named file.

What version of Python and Zope/Addons I am using:

icemac commented 5 months ago

I'm now going to release a post-release version for 6.4 because I do not want to delete the sdist on PyPI to replace it with another one (only one sdist per release is allowed).

icemac commented 5 months ago

@dataflake Do you have any idea what could have happened here? https://pypi.org/project/zope.interface/6.4.post0/#files has the correct filename. I was using zest.releaser to cut the release. #295 might be related that it cannot install the version on Windows via zc.buildout if there is no wheel.

BTW installing via pip was no problem.

dataflake commented 5 months ago

I always use bin/buildout setup setup.py sdist to create distribution files. I never had any problems with it so I did not even look at file names.

I just tried again and the filename is wrong again. The sandbox has zc.buildout 3.0.1, setuptools 69.5.1 and pip 24.0.

I just rebuilt that virtual environment, which updated setuptools to 70.0.0. Now I am getting this:

$ bin/buildout setup setup.py sdist
Traceback (most recent call last):
  File "/Users/jens/src/zope/zope.interface/bin/buildout", line 5, in <module>
    from zc.buildout.buildout import main
  File "/Users/jens/src/zope/zope.interface/lib/python3.11/site-packages/zc/buildout/buildout.py", line 18, in <module>
    import zc.buildout.easy_install
  File "/Users/jens/src/zope/zope.interface/lib/python3.11/site-packages/zc/buildout/easy_install.py", line 28, in <module>
    from pkg_resources import packaging
ImportError: cannot import name 'packaging' from 'pkg_resources' (/Users/jens/src/zope/zope.interface/lib/python3.11/site-packages/pkg_resources/__init__.py)

But doing bin/python setup.py sdist inside that updated environment produces the wrong file name again.

I am not sure what is going on.

dataflake commented 5 months ago

This is (yet another) setuptools issue that is caused by setuptools starting with version 69. I tried a variety of combinations, and downgrading to any version <69 works and creates the correct file name.

dataflake commented 5 months ago

I guess the way forward would have to be pinning setuptools in the meta/config templates yet again and then creating a 6.5 release. IMHO https://github.com/zopefoundation/zope.interface/pull/296 should be used at the same time so hopefully Windows wheels make it to PyPI.

mgedmin commented 5 months ago

This smells like a zc.buildout issue to me. You cannot expect everyone in the world to pin a specific old setuptools version before they make their releases.

(Besides, setuptools itself is shouting loudly at you whenever you try to run python setup.py anything, telling you to use build instead. What sort of sdist filenames does python -m build -s generate? I tried pipx run build -s in zope.interface's git master and I got me a dist/zope_interface-6.5.dev0.tar.gz.)

dataflake commented 5 months ago

python -m build -s gets the "wrong" file name again.

dataflake commented 5 months ago

P.S.: the full filename on the 6.4 tag itself was zope_interface-6.4.tar.gz

icemac commented 5 months ago

@mgedmin There is already a buildout issue: https://github.com/buildout/buildout/issues/647 So I think we can close this issue here.

dataflake commented 5 months ago

OK, I'll close that here. I'm only concerned that with the slow development speed of zc.buildout we'll have to wait forever for a solution and in the meantime more and more people will start complaining. I will make sure to pin setuptools<69 in all my sandboxes.

icemac commented 5 months ago

@dataflake We will also have to pin it for our repositories. I already saw a broken GHA run because zc.buildout is not compatible with setuptools >= 70.

dataflake commented 5 months ago

See https://github.com/zopefoundation/meta/pull/243

mgorny commented 5 months ago

Please don't call it "wrong" when it's actually correct. Using dots in filenames is invalid per the standards. Setuptools blatantly refusing to follow them for years doesn't make it any more "right".