Skip to content

Commit

Permalink
Bootstrap the environment in tox, allowing simple 'tox' to run tests …
Browse files Browse the repository at this point in the history
…and simplifying all of the pipelines.
  • Loading branch information
jaraco committed Feb 6, 2020
1 parent 1314828 commit 0559f17
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Expand Up @@ -41,8 +41,6 @@ install:
- pip freeze --all
- env

# update egg_info based on setup.py in checkout
- python bootstrap.py
- "! grep pyc setuptools.egg-info/SOURCES.txt"

script:
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Expand Up @@ -28,7 +28,6 @@ test_script:
- python -m pip install --disable-pip-version-check --upgrade pip setuptools wheel
- pip install --upgrade tox tox-venv virtualenv
- pip freeze --all
- python bootstrap.py
- tox -- --cov

after_test:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -26,7 +26,7 @@
# hack to run the bootstrap script so that jaraco.packaging.sphinx
# can invoke setup.py
'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),
)

Expand Down
8 changes: 2 additions & 6 deletions docs/developer-guide.txt
Expand Up @@ -104,12 +104,8 @@ from the command line after pushing a new branch.
Testing
-------

The primary tests are run using tox. To run the tests, first create the metadata
needed to run the tests::

$ python bootstrap.py

Then make sure you have tox installed, and invoke it::
The primary tests are run using tox. Make sure you have tox installed,
and invoke it::

$ tox

Expand Down
11 changes: 9 additions & 2 deletions tools/tox_pip.py
Expand Up @@ -13,9 +13,16 @@ def remove_setuptools():
subprocess.check_call(cmd, cwd='.tox')


def bootstrap():
print("Running bootstrap")
cmd = [sys.executable, '-m', 'bootstrap']
subprocess.check_call(cmd)


def pip(args):
# When installing '.', remove setuptools
'.' in args and remove_setuptools()
if '.' in args:
remove_setuptools()
bootstrap()

cmd = [sys.executable, '-m', 'pip'] + args
subprocess.check_call(cmd)
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
@@ -1,5 +1,3 @@
# Note: Run "python bootstrap.py" before running Tox, to generate metadata.
#
# To run Tox against all supported Python interpreters, you can set:
#
# export TOXENV='py27,py3{5,6,7,8},pypy,pypy3'
Expand Down Expand Up @@ -47,7 +45,7 @@ commands=codecov -X gcov --file {toxworkdir}/coverage.xml
deps = -r{toxinidir}/docs/requirements.txt
skip_install=True
commands =
python {toxinidir}/bootstrap.py
python -m bootstrap
sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/build/html
sphinx-build -W -b man -d {envtmpdir}/doctrees docs docs/build/man

Expand Down

0 comments on commit 0559f17

Please sign in to comment.