Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
702f2d91
Commit
702f2d91
authored
Feb 23, 2019
by
Paul Ganssle
Committed by
GitHub
Feb 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1659 from benoit-pierre/fix_#1649
tests: improve `test_pip_upgrade_from_source`
parents
65754182
675c690b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
2 deletions
+49
-2
.travis.yml
.travis.yml
+1
-0
appveyor.yml
appveyor.yml
+1
-0
setuptools/tests/test_virtualenv.py
setuptools/tests/test_virtualenv.py
+46
-1
tox.ini
tox.ini
+1
-1
No files found.
.travis.yml
View file @
702f2d91
...
...
@@ -63,6 +63,7 @@ install:
-
"
!
grep
pyc
setuptools.egg-info/SOURCES.txt"
script
:
-
export NETWORK_REQUIRED=1
-
|
( # Run testsuite.
if [ -z "$DISABLE_COVERAGE" ]
...
...
appveyor.yml
View file @
702f2d91
...
...
@@ -3,6 +3,7 @@ clone_depth: 50
environment
:
APPVEYOR
:
True
NETWORK_REQUIRED
:
True
CODECOV_ENV
:
APPVEYOR_JOB_NAME
matrix
:
...
...
setuptools/tests/test_virtualenv.py
View file @
702f2d91
...
...
@@ -52,10 +52,55 @@ def test_clean_env_install(bare_virtualenv):
)).
format
(
source
=
SOURCE_DIR
))
def
test_pip_upgrade_from_source
(
virtualenv
):
def
_get_pip_versions
():
# This fixture will attempt to detect if tests are being run without
# network connectivity and if so skip some tests
network
=
True
if
not
os
.
environ
.
get
(
'NETWORK_REQUIRED'
,
False
):
# pragma: nocover
try
:
from
urllib.request
import
urlopen
from
urllib.error
import
URLError
except
ImportError
:
from
urllib2
import
urlopen
,
URLError
# Python 2.7 compat
try
:
urlopen
(
'https://pypi.org'
,
timeout
=
1
)
except
URLError
:
# No network, disable most of these tests
network
=
False
network_versions
=
[
'pip==9.0.3'
,
'pip==10.0.1'
,
'pip==18.1'
,
'pip==19.0.1'
,
'https://github.com/pypa/pip/archive/master.zip'
,
]
versions
=
[
None
]
+
[
pytest
.
param
(
v
,
**
({}
if
network
else
{
'marks'
:
pytest
.
mark
.
skip
}))
for
v
in
network_versions
]
return
versions
@
pytest
.
mark
.
parametrize
(
'pip_version'
,
_get_pip_versions
())
def
test_pip_upgrade_from_source
(
pip_version
,
virtualenv
):
"""
Check pip can upgrade setuptools from source.
"""
# Install pip/wheel, and remove setuptools (as it
# should not be needed for bootstraping from source)
if
pip_version
is
None
:
upgrade_pip
=
()
else
:
upgrade_pip
=
(
'python -m pip install -U {pip_version} --retries=1'
,)
virtualenv
.
run
(
' && '
.
join
((
'pip uninstall -y setuptools'
,
'pip install -U wheel'
,
)
+
upgrade_pip
).
format
(
pip_version
=
pip_version
))
dist_dir
=
virtualenv
.
workspace
# Generate source distribution / wheel.
virtualenv
.
run
(
' && '
.
join
((
...
...
tox.ini
View file @
702f2d91
...
...
@@ -18,7 +18,7 @@ list_dependencies_command={envbindir}/pip freeze
setenv
=
COVERAGE_FILE={toxworkdir}/.coverage.{envname}
# TODO: The passed environment variables came from copying other tox.ini files
# These should probably be individually annotated to explain what needs them.
passenv
=
APPDATA HOMEDRIVE HOMEPATH windir APPVEYOR APPVEYOR_* CI CODECOV_* TRAVIS TRAVIS_*
passenv
=
APPDATA HOMEDRIVE HOMEPATH windir APPVEYOR APPVEYOR_* CI CODECOV_* TRAVIS TRAVIS_*
NETWORK_REQUIRED
commands
=
pytest --cov-config={toxinidir}/tox.ini --cov-report= {posargs}
usedevelop
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment