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

Failed to install virtuallenv from source on a centos-7 container #1609

Closed
ssbarnea opened this issue Feb 13, 2020 · 5 comments
Closed

Failed to install virtuallenv from source on a centos-7 container #1609

ssbarnea opened this issue Feb 13, 2020 · 5 comments

Comments

@ssbarnea
Copy link
Contributor

ssbarnea commented Feb 13, 2020

It seems that packaging is no longer compatible with older tool chains and even installing virtualenv from source become an interesting challenge.

[root@n0 virtualenv]# pip install wheel
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.34.2
You are using pip version 8.1.2, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@n0 virtualenv]# python setup.py bdist_wheel
running bdist_wheel
running build
installing to build/bdist.linux-x86_64/wheel
running install
running install_egg_info
running egg_info
writing UNKNOWN.egg-info/PKG-INFO
writing top-level names to UNKNOWN.egg-info/top_level.txt
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching '.gitattributes'
warning: no previously-included files found matching '.gitignore'
warning: no previously-included files found matching '.github/*'
warning: no previously-included files found matching 'azure-pipelines.yml'
warning: no previously-included files found matching 'readthedocs.yml'
warning: no previously-included files found matching 'tasks/release.py'
warning: no previously-included files found matching 'tasks/upgrade_wheels.py'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
Copying UNKNOWN.egg-info to build/bdist.linux-x86_64/wheel/UNKNOWN-0.0.0-py2.7.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/UNKNOWN-0.0.0.dist-info/WHEEL
creating 'dist/UNKNOWN-0.0.0-py2.py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'UNKNOWN-0.0.0.dist-info/LICENSE'
adding 'UNKNOWN-0.0.0.dist-info/METADATA'
adding 'UNKNOWN-0.0.0.dist-info/WHEEL'
adding 'UNKNOWN-0.0.0.dist-info/top_level.txt'
adding 'UNKNOWN-0.0.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel

Ho to reproduce:

docker pull pycontribs/centos:7
docker run --network=host -it pycontribs/centos:7 /bin/bash
git clone https://github.com/pypa/virtualenv.git
cd virtualenv
pip install .

Note, pycontribs already has system python+libs installed, so you don't waste time installing rpms.

@ssbarnea
Copy link
Contributor Author

ssbarnea commented Feb 13, 2020

Even easier to test via:

pip install git+https://github.com/pypa/virtualenv.git
Collecting git+https://github.com/pypa/virtualenv.git
  Cloning https://github.com/pypa/virtualenv.git to /tmp/pip-DgcV6P-build
Installing collected packages: UNKNOWN
  Running setup.py install for UNKNOWN ... done
Successfully installed UNKNOWN-0.0.0
You are using pip version 8.1.2, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

virtualenv --version
15.1.0

The surprise is bigger as command returns success but fails to install virtualenv, mainly installing UNKNOWN bogus package instead.

I do know that this is caused by lack of knowledge about pyproject.toml in older pip/setuptools, but that is why we were supposed to have a setup.py that would work as a fallback.

It may worth mentioning that for other projects I use a sligtly more complex setup.py which at least fails in this case complaining about too old setuptools, something less confusing at least. See https://github.com/ansible-community/molecule/blob/master/setup.py#L29

Installation from git clone on very old systems is not really something we really must support, but at least we should avoiding giving a false positive installation experience.

@ssbarnea
Copy link
Contributor Author

ssbarnea commented Feb 13, 2020

To summarize there is no documented way to build the virtualenv wheels.

  • tox -e release cannot be used by people that do not push a release
  • documentation mentions nothing about building a distro wheel+source
  • there is no other tox evironment that would just package it inside dist/
  • old python setup.py bsdist_whell is also broken
  • azure-pipeline are not configured to produce any artifacts with source and wheel distro, so we have no chance of downloading a wheel from there in order to test it.

@gaborbernat
Copy link
Contributor

We no longer support that old age pip. Upgrade your pip to 19.x something and you should be good, or use the wheel.

@gaborbernat
Copy link
Contributor

What's the use case here, can't you use the zipapp?

ssbarnea added a commit to ssbarnea/virtualenv that referenced this issue Feb 14, 2020
Adds a packaging environment and documents its use. This should clarify how
to build and install and unreleased version.

Related: pypa#1609
@ssbarnea
Copy link
Contributor Author

I do not even remember zipzapp being mentioned in openstack channels, and I am sure it will not be embraced until we will not have any LTS release using on py35+, so years away. I doubt a change to use different installers base on version would gain many adopters. While the newer releases require py36 the CI/CD runs on several releases and needs to keep doing so. As you can imagine tox and virtualenv are key ingredients.

So far there is only one agreed way to install python packages is pip.

As a funny note, the recent breakages caused by virtualen 20, put more pressure on revising how we install tox (and few other python bases utils) and the idea of starting to use venv and tox-venv gained a little bit more popularity. Still, even if this happens it will take months to materialize as it would require extensive testing and debates. venv comes with its own set of problems, like the fact that some distros are not installing it alongside python, being a separate and optional package. I am not surprised they would fight any change that would introduce more branching.

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants