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

Update tox configuration to use tox >= 4.4.0 #851

Merged
merged 3 commits into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel 'tox<4'
pip install -U virtualenv setuptools wheel tox
sudo apt-get install graphviz pandoc
- name: Build and publish
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel 'tox<4'
pip install -U virtualenv setuptools wheel tox
sudo apt-get install graphviz pandoc
- name: Build and publish
env:
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.platform.rust-target }}
- name: 'Install dependencies'
run: python -m pip install --upgrade 'tox<4'
run: python -m pip install --upgrade tox
- name: 'Install binary dependencies'
run: sudo apt-get install -y graphviz
if: runner.os == 'Linux'
Expand All @@ -103,7 +103,7 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: 'Install dependencies'
run: python -m pip install --upgrade 'tox<4'
run: python -m pip install --upgrade tox
- name: 'Run rustworkx stub tests'
run: tox -estubs
tests_retworkx_compat:
Expand Down Expand Up @@ -131,18 +131,21 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.platform.rust-target }}
- name: 'Install dependencies'
run: python -m pip install --upgrade 'tox<4'
- name: 'Install binary dependencies'
run: sudo apt-get install -y graphviz
if: runner.os == 'Linux'
- name: 'Build rustworkx'
- name: 'Build rustworkx and test dependencies'
run: |
tox -epy --notest
- name: 'Run retworkx tests'
pip install -c constraints.txt -U '.[mpl,graphviz]' fixtures testtools>=2.5.0 networkx>=2.5 stestr
- name: 'Build retworkx'
env:
RUSTWORKX_PKG_NAME: "retworkx"
run: tox -epy -- -t ./retworkx_backwards_compat
run: |
pip install -c constraints.txt -U .
- name: 'Run retworkx tests'
run: |
cd tests
stestr run -t ./retworkx_backwards_compat
coverage:
needs: [tests]
name: Coverage
Expand Down Expand Up @@ -202,7 +205,7 @@ jobs:
- name: Install binary deps
run: sudo apt-get install -y graphviz
- name: Install deps
run: pip install -U 'tox<4'
run: pip install -U tox
- name: Build Docs
run: tox -edocs
- uses: actions/upload-artifact@v3
Expand Down
16 changes: 9 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tox]
minversion = 2.1
minversion = 4.4.0
envlist = py37, py38, py39, py310, py311, lint
isolated_build = true

[testenv]
install_command = pip install -c{toxinidir}/constraints.txt -U {opts} {packages}
install_command = python -I -m pip install -c{toxinidir}/constraints.txt -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
Expand All @@ -19,14 +19,15 @@ deps =
extras =
mpl
graphviz
passenv = RETWORKX_TEST_PRESERVE_IMAGES RUSTWORKX_PKG_NAME
passenv =
RETWORKX_TEST_PRESERVE_IMAGES
RUSTWORKX_PKG_NAME
changedir = {toxinidir}/tests
commands =
stestr run {posargs}

[testenv:lint]
basepython = python3
envdir = .tox/lint
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the only difference from #813, really

Copy link
Member Author

@mtreinish mtreinish Mar 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair, well this and splitting out the retworkx jobs and setting the minimum tox version. Both of these are important, because tox 4 doesn't allow shared envs anymore and also doesn't support the build interface we need for the retworkx jobs.

deps =
black~=22.0
flake8
Expand All @@ -44,7 +45,10 @@ setenv =
{[testenv]setenv}
deps =
-r {toxinidir}/docs/source/requirements.txt
passenv = {[testenv]passenv} RETWORKX_DEV_DOCS RETWORKX_LEGACY_DOCS
passenv =
{[testenv]passenv}
RETWORKX_DEV_DOCS
RETWORKX_LEGACY_DOCS
changedir = {toxinidir}/docs
commands =
python -m ipykernel install --user
Expand All @@ -53,14 +57,12 @@ commands =

[testenv:black]
basepython = python3
envdir = .tox/lint
deps =
black~=22.0
commands = black {posargs} '../rustworkx' '../tests' '../retworkx'

[testenv:stubs]
basepython = python3
envdir = .tox/stubs
deps =
mypy==1.0.1
commands = python -m mypy.stubtest --concise --ignore-missing-stub rustworkx.rustworkx
Expand Down