Skip to content

Commit

Permalink
Add support for 'localsdk' tox factor + env var
Browse files Browse the repository at this point in the history
Usage is like so:

    GLOBUS_SDK_PATH=../globus-sdk tox -e py39-localsdk
  • Loading branch information
sirosen committed May 19, 2022
1 parent 6088e83 commit fbcb686
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ minversion = 3.0.0
[testenv]
usedevelop = true
extras = development
passenv = GLOBUS_SDK_PATH
deps =
mindeps: click==8.0.0
mindeps: requests==2.19.1
mindeps: pyjwt==2.0.0
mindeps: cryptography==2.0
sdkmain: https://github.com/globus/globus-sdk-python/archive/main.tar.gz
commands = pytest --cov-append --cov-report= {posargs}
# the 'localsdk' factor allows CLI tests to be run against a local repo copy of globus-sdk
# it requires that the GLOBUS_SDK_PATH env var is set and uses subprocess and os to pass it as
# an argument to 'pip'
#
# This is unfortunately necessary: tox does not expand env vars in commands
#
# usage: 'GLOBUS_SDK_PATH=../globus-sdk tox -e py310-localsdk'
commands =
localsdk: python -c 'import os, subprocess, sys; subprocess.run([sys.executable, "-m", "pip", "install", "-e", os.environ["GLOBUS_SDK_PATH"]])'
pytest --cov-append --cov-report= {posargs}
depends =
{py36-mindeps,py36,py37,py38,py39}: cov-clean
cov-report: py36-mindeps,py36,py37,py38,py39
Expand Down

0 comments on commit fbcb686

Please sign in to comment.