buildout / buildout

Buildout is a deployment automation tool written in and extended with Python
http://www.buildout.org
Other
570 stars 168 forks source link

buildout 2/3: Wheel file mode installed via buildout != pip install #604

Closed delijati closed 2 years ago

delijati commented 2 years ago

This happens on buildout 2/3: A executable has not the right mode when installed via buildout. I also removed the cached egg but still the same result.

I assumed zc.recipe.egg is just unpacking the wheels and not changing the permission on file.

Successfully installed setuptools-58.4.0 zc.buildout-2.13.3 Successfully installed pip-22.0.4 setuptools-60.9.3 zc.buildout-3.0.0rc2

buildout:

[buildout]
show-picked-versions = true

parts = py

eggs = kaleido 

[py]
recipe = zc.recipe.egg
eggs = ${buildout:eggs}
interpreter = py-foo

file mode via pip install:

❯ stat -c "%a" env/lib/python3.8/site-packages/kaleido/executable/kaleido
755

file mode via buildout:

❯ stat -c "%a" /home/xxx/.buildout/eggs/cp38/kaleido-0.2.1-py3.8-linux-x86_64.egg/kaleido/executable/kaleido 
644
delijati commented 2 years ago

Ok i narrowed it down to setuptools. It seams it copies the files but without the mode |-(.

import setuptools.wheel

if __name__ == "__main__":
    whl = setuptools.wheel.Wheel("kaleido-0.2.1.post1-py2.py3-none-manylinux2014_armv7l.whl")
    whl.install_as_egg("./foo")

check mode

❯ stat -c "%a" foo/kaleido/executable/kaleido 
644
gotcha commented 2 years ago

Do I understand correctly that the issue sits in install_as_egg ?

delijati commented 2 years ago

Jup i'm already filling out an issue in setuptools repo https://github.com/pypa/setuptools/issues/3166

delijati commented 2 years ago

I also added a fix to setuptools https://github.com/pypa/setuptools/pull/3167

delijati commented 2 years ago

it was merged ... yay :)

gotcha commented 2 years ago

Even better, it is released in https://pypi.org/project/setuptools/62.0.0/

icemac commented 2 years ago

Currently I run zc.buildout=3.0.0rc2 with setuptools < 60. Is this max version of setuptools no longer needed?

mauritsvanrees commented 2 years ago

Should still be needed, except when you use an env for using distutils from core.

delijati commented 2 years ago

Yay i got now a working buildout setup:

$ virtualenv env -p /usr/bin/python3.9
$ env/bin/pip install -U zc.buildout==3.0.0rc2 setuptools
$ SETUPTOOLS_USE_DISTUTILS=stdlib env/bin/buildout -nvvv
$ bin/tests # this now works :)

The only still annoying part is this SETUPTOOLS_USE_DISTUTILS=stdlib. If it needs to be set anyway can it not just be then the default?

gotcha commented 2 years ago

@delijati Can this issue be closed ?

The only still annoying part is this SETUPTOOLS_USE_DISTUTILS=stdlib. If it needs to be set anyway can it not just be then the default?

I plan to fix this before doing a final 3.0 release. It will be tracked in #600.