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

stick to using easy_install for installing vsc-install, otherwise we end up with vsc.* namespace troubles #123

Merged
merged 1 commit into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions lib/vsc/install/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import logging
import os

from vsc.install.shared_setup import MAX_SETUPTOOLS_VERSION


JENKINSFILE = 'Jenkinsfile'
TOX_INI = 'tox.ini'
Expand Down Expand Up @@ -79,10 +81,17 @@ def gen_tox_ini():
"skip_missing_interpreters = true",
'',
'[testenv]',
"commands_pre =",
# install required setuptools version;
# we need a setuptools < 42.0 for now, since in 42.0 easy_install was changed to use pip when available;
# it's important to use pip (not easy_install) here, since only pip will actually remove an older
# already installed setuptools version
" pip install 'setuptools<%s'" % MAX_SETUPTOOLS_VERSION,
# install latest vsc-install release from PyPI;
# it's important to use pip (not easy_install) here, because vsc-install may require a specific
# version of setuptools for example (and only pip will actually remove an older already installed version)
"commands_pre = pip install -U vsc-install",
# we can't use 'pip install' here, because then we end up with a broken installation because
# vsc/__init__.py is not installed because we're using pkg_resources.declare_namespace
# (see https://github.com/pypa/pip/issues/1924)
" python -m easy_install -U vsc-install",
"commands = python setup.py test",
# $USER is not defined in tox environment, so pass it
# see https://tox.readthedocs.io/en/latest/example/basic.html#passing-down-environment-variables
Expand Down
6 changes: 4 additions & 2 deletions lib/vsc/install/shared_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _log(self, level, msg, args):

RELOAD_VSC_MODS = False

VERSION = '0.13.4'
VERSION = '0.13.5'

log.info('This is (based on) vsc.install.shared_setup %s' % VERSION)
log.info('(using setuptools version %s located at %s)' % (setuptools.__version__, setuptools.__file__))
Expand Down Expand Up @@ -1555,6 +1555,8 @@ def action_target(package, *args, **kwargs):
_fvs('action_target function')().action_target(package, *args, **kwargs)


MAX_SETUPTOOLS_VERSION = '42.0'

if __name__ == '__main__':
"""
This main is the setup.py for vsc-install
Expand All @@ -1563,7 +1565,7 @@ def action_target(package, *args, **kwargs):
# setuptools 42.0 changed easy_install to use pip if it's available,
# but vsc-install relies on the setuptools' behaviour of ignoring failing dependency installations and
# just continuing with the next entry in dependency_links
'setuptools<42.0',
'setuptools<%s' % MAX_SETUPTOOLS_VERSION,
'mock',
]

Expand Down
4 changes: 3 additions & 1 deletion test/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def test_tox_ini(self):
"skip_missing_interpreters = true",
'',
"[testenv]",
"commands_pre = pip install -U vsc-install",
"commands_pre =",
" pip install 'setuptools<42.0'",
" python -m easy_install -U vsc-install",
"commands = python setup.py test",
"passenv = USER",
'',
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ skipsdist = true
skip_missing_interpreters = true

[testenv]
commands_pre = pip install -U vsc-install
commands_pre =
pip install 'setuptools<42.0'
python -m easy_install -U vsc-install
commands = python setup.py test
passenv = USER

Expand Down