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

Use tox in the GitHub Actions build CI with tox-gh-actions. #15

Open
Tracked by #14
vaipatel opened this issue Oct 8, 2021 · 1 comment
Open
Tracked by #14

Use tox in the GitHub Actions build CI with tox-gh-actions. #15

vaipatel opened this issue Oct 8, 2021 · 1 comment

Comments

@vaipatel
Copy link
Owner

vaipatel commented Oct 8, 2021

No description provided.

@vaipatel
Copy link
Owner Author

vaipatel commented Oct 8, 2021

To your question in #13 about how I used tox, it was pretty basic. Given the environments listed for envlist in my tox.ini

  • to test the library against all the envlist environments I would just run tox from the command line without params, or
  • to test against a specific environment from the envlist I'd pass its name. Like say tox -e py35 for python 3.5.

Which is probably not terribly useful info to get up to speed with the command line.

But, it looks like if we were to use tox-gh-actions then we'd also be calling just tox in the build.yml's run step, such as in the workflow samples here and here, because "tox-gh-actions assumes that Python version used for running tox is the Python version users want to use when running tox environments". So it looks like a simple call to tox in the run step will pick the right environment.

Going on their Using Factors to Decide Environments sample in their architecture doc, the tox.ini could look something like:

[tox]
envlist = py{35,36,37,38,39}-{linux,windows,macos}

[gh-actions]
python =
  3.5: py35
  3.6: py36
  3.7: py37
  3.8: py38
  3.9: py39

[gh-actions:env]
PLATFORM =
    ubuntu-latest: linux
    macos-latest: macos
    windows-latest: windows

[testenv:py35-{linux,windows,macos}]
deps =
  pytest
  numpy==1.13.3
  scipy==1.3.3
commands =
  pytest -q -s tests

[testenv:py36-{linux,windows,macos}]
deps = 
  pytest
  pytest-cov
  numpy==1.14.5
  scipy==1.5.0
commands = 
  pytest -q -s tests
  pytest --cov=morphops tests/

[testenv]
deps = 
  pytest
commands = 
  pytest -q -s tests

where I suppose we're using fancy-pants Generative envlist and Generative section names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant