Commit e44bf410 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #1980 from pypa/feature/bootstrap-in-tox

Bootstrap the environment in tox, allowing simple 'tox' to run tests.
parents a0e8d056 94f88bf4
...@@ -51,10 +51,6 @@ jobs: ...@@ -51,10 +51,6 @@ jobs:
env env
env: ${{ matrix.env }} env: ${{ matrix.env }}
- name: Update egg_info based on setup.py in checkout
run: >-
python -m bootstrap
env: ${{ matrix.env }}
- name: Verify that there's no cached Python modules in sources - name: Verify that there's no cached Python modules in sources
if: >- if: >-
! startsWith(matrix.os, 'windows-') ! startsWith(matrix.os, 'windows-')
......
...@@ -40,8 +40,6 @@ install: ...@@ -40,8 +40,6 @@ install:
- pip freeze --all - pip freeze --all
- env - env
# update egg_info based on setup.py in checkout
- python bootstrap.py
- "! grep pyc setuptools.egg-info/SOURCES.txt" - "! grep pyc setuptools.egg-info/SOURCES.txt"
script: script:
......
...@@ -28,7 +28,6 @@ test_script: ...@@ -28,7 +28,6 @@ test_script:
- python -m pip install --disable-pip-version-check --upgrade pip setuptools wheel - python -m pip install --disable-pip-version-check --upgrade pip setuptools wheel
- pip install --upgrade tox tox-venv virtualenv - pip install --upgrade tox tox-venv virtualenv
- pip freeze --all - pip freeze --all
- python bootstrap.py
- tox -- --cov - tox -- --cov
after_test: after_test:
......
...@@ -26,7 +26,7 @@ import os ...@@ -26,7 +26,7 @@ import os
# hack to run the bootstrap script so that jaraco.packaging.sphinx # hack to run the bootstrap script so that jaraco.packaging.sphinx
# can invoke setup.py # can invoke setup.py
'READTHEDOCS' in os.environ and subprocess.check_call( 'READTHEDOCS' in os.environ and subprocess.check_call(
[sys.executable, 'bootstrap.py'], [sys.executable, '-m', 'bootstrap'],
cwd=os.path.join(os.path.dirname(__file__), os.path.pardir), cwd=os.path.join(os.path.dirname(__file__), os.path.pardir),
) )
......
...@@ -104,12 +104,8 @@ from the command line after pushing a new branch. ...@@ -104,12 +104,8 @@ from the command line after pushing a new branch.
Testing Testing
------- -------
The primary tests are run using tox. To run the tests, first create the metadata The primary tests are run using tox. Make sure you have tox installed,
needed to run the tests:: and invoke it::
$ python bootstrap.py
Then make sure you have tox installed, and invoke it::
$ tox $ tox
......
...@@ -14,13 +14,20 @@ def remove_setuptools(): ...@@ -14,13 +14,20 @@ def remove_setuptools():
subprocess.check_call(cmd, cwd='.tox') subprocess.check_call(cmd, cwd='.tox')
def bootstrap():
print("Running bootstrap")
cmd = [sys.executable, '-m', 'bootstrap']
subprocess.check_call(cmd)
def pip(args): def pip(args):
# Honor requires-python when installing test suite dependencies # Honor requires-python when installing test suite dependencies
if any('-r' in arg for arg in args): if any('-r' in arg for arg in args):
os.environ['PIP_IGNORE_REQUIRES_PYTHON'] = '0' os.environ['PIP_IGNORE_REQUIRES_PYTHON'] = '0'
# When installing '.', remove setuptools if '.' in args:
'.' in args and remove_setuptools() remove_setuptools()
bootstrap()
cmd = [sys.executable, '-m', 'pip'] + args cmd = [sys.executable, '-m', 'pip'] + args
subprocess.check_call(cmd) subprocess.check_call(cmd)
......
# Note: Run "python bootstrap.py" before running Tox, to generate metadata.
#
# To run Tox against all supported Python interpreters, you can set: # To run Tox against all supported Python interpreters, you can set:
# #
# export TOXENV='py3{5,6,7,8},pypy,pypy3' # export TOXENV='py3{5,6,7,8},pypy,pypy3'
...@@ -49,7 +47,7 @@ commands=codecov -X gcov --file {toxworkdir}/coverage.xml ...@@ -49,7 +47,7 @@ commands=codecov -X gcov --file {toxworkdir}/coverage.xml
deps = -r{toxinidir}/docs/requirements.txt deps = -r{toxinidir}/docs/requirements.txt
skip_install=True skip_install=True
commands = commands =
python {toxinidir}/bootstrap.py python -m bootstrap
sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/build/html sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/build/html
sphinx-build -W -b man -d {envtmpdir}/doctrees docs docs/build/man sphinx-build -W -b man -d {envtmpdir}/doctrees docs docs/build/man
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment