-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up
tox
environments for testing, linting, and building docs (#1667
) * Set up `tox` environments for testing, linting, and building docs * Move `pybind11` to the dev requirements for the `tox` linting env * Move `pybind11` to the cpu-ci action * Add `sklearn` to test dependencies * Update the CPU CI action to use `tox` to build docs * Update docs scheduled rebuild CI action to build with `tox` * Add `clean` to docs Makefile
- Loading branch information
1 parent
16e4e34
commit 9be2554
Showing
12 changed files
with
164 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include versioneer.py | ||
recursive-include nvtabular *.py *.proto | ||
recursive-include cpp *.cc *.h *.cu *.cuh | ||
include requirements*.txt | ||
include requirements/*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# packages necessary to run tests and push PRs | ||
# assumes requirements for nvtabular logic are already installed | ||
|
||
# linting | ||
cpplint>=1.5 | ||
codespell | ||
interrogate==1.5.0 | ||
black==22.6.0 | ||
flake8==3.9.2 | ||
isort==5.10.1 | ||
pylint==2.7.4 | ||
bandit==1.7.4 | ||
flake8-nb==0.5.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Sphinx<3.6 | ||
jinja2<3.1 | ||
markupsafe==2.0.1 | ||
sphinx-multiversion@git+https://github.com/mikemckiernan/sphinx-multiversion.git | ||
sphinxcontrib-copydirs@git+https://github.com/mikemckiernan/sphinxcontrib-copydirs.git | ||
sphinx-external-toc<0.4 | ||
sphinx_rtd_theme | ||
natsort | ||
myst-nb | ||
linkify-it-py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-r requirements.txt | ||
-r base.txt | ||
cudf>=21.12 | ||
dask-cudf>=21.12 | ||
dask-cuda>=21.12 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
nvidia-pyindex | ||
pybind11 | ||
|
||
-r base.txt | ||
-r dev.txt | ||
|
||
tritonclient[all] | ||
torch | ||
tensorflow-cpu | ||
numpy==1.20.3 | ||
Markdown==3.3.7 | ||
|
||
pytest>=5 | ||
pytest-cov>=2 | ||
asvdb@git+https://github.com/rapidsai/asvdb.git | ||
|
||
# needed to make test_s3 work | ||
pytest-xdist | ||
s3fs>=2021.4 | ||
aiobotocore>=1.3.3 | ||
flask | ||
flask-cors | ||
moto>=2 | ||
boto3==1.17 | ||
|
||
|
||
# Assume these are required for notebook tests, but want to doublecheck that | ||
scikit-learn>=0.20 | ||
# graphviz>=0.16 | ||
# ipython_genutils | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
; For all tests that run in Github Actions, see | ||
; .github/workflows/cpu-ci.yml for the workflow definition. | ||
|
||
[tox] | ||
envlist = python3.8,test-gpu,test-cpu | ||
|
||
[testenv] | ||
commands = | ||
pip install --upgrade pip | ||
pip install . | ||
|
||
[testenv:test-cpu] | ||
; Runs in: Github Actions | ||
; Runs all CPU-based tests. NOTE: if you are using an M1 mac, this will fail. You need to | ||
; change the tensorflow dependency to `tensorflow-macos` in requirements/test-cpu.txt. | ||
deps = -rrequirements/test.txt | ||
commands = python -m pytest --cov-report term --cov=merlin -rxs tests/unit | ||
|
||
[testenv:test-gpu] | ||
sitepackages=true | ||
; Runs in: Internal Jenkins | ||
; Runs GPU-based tests. | ||
; The jenkins jobs run on an image based on merlin-hugectr. This will include all cudf configuration | ||
; and other gpu-specific libraries that we can enxpect will always exist. Thus, we don't need | ||
; to install requirements.txt yet. As we get better at python environment isolation, we will | ||
; need to add some back. | ||
deps = | ||
pytest | ||
pytest-cov | ||
commands = | ||
python -m pytest --cov-report term --cov merlin -rxs tests/unit | ||
|
||
[testenv:test-merlin] | ||
; Runs in: Internal Jenkins | ||
; This runs the end-to-end tests from the NVIDIA-Merlin/Merlin repo on the jenkins machine. | ||
; We will check out `Merlin` from github and execute the notebooks using the current PR of systems. | ||
passenv=GIT_COMMIT | ||
sitepackages=true | ||
allowlist_externals = git | ||
deps = | ||
-rrequirements/gpu.txt | ||
commands = | ||
; the GIT_COMMIT env is the current commit of the systems repo | ||
; NOTE!!!! We must clean this up in the jenkins configuration with `rm -rf "Merlin-$GIT_COMMIT"` | ||
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git | ||
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/models.git | ||
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/systems.git | ||
python -m pip install . | ||
|
||
git clone https://github.com/NVIDIA-Merlin/Merlin.git Merlin-{env:GIT_COMMIT} | ||
|
||
; this runs the tests then removes the Merlin repo directory whether the tests work or fail | ||
python -m pytest --cov merlin --cov-report term Merlin-{env:GIT_COMMIT}/tests/unit | ||
|
||
[testenv:lint] | ||
; Runs in: Github Actions | ||
; Runs all lint/code checks and fails the PR if there are errors. | ||
; Install pre-commit-hooks to run these tests during development. | ||
deps = -rrequirements/dev.txt | ||
commands = | ||
flake8 setup.py merlin/ tests/ | ||
black --check --diff merlin tests | ||
pylint merlin | ||
isort -c . --skip .tox | ||
interrogate --config=pyproject.toml | ||
codespell --skip .tox | ||
|
||
[testenv:docs] | ||
; Runs in: Github Actions | ||
; Generates documentation with sphinx. There are other steps in the Github Actions workflow | ||
; to publish the documentation on release. | ||
changedir = {toxinidir} | ||
deps = -rrequirements/docs.txt | ||
commands = | ||
python -m sphinx.cmd.build -P -b html docs/source docs/build/html | ||
|
||
[testenv:docs-multi] | ||
; Run the multi-version build that is shown on GitHub Pages. | ||
changedir = {toxinidir} | ||
deps = -rrequirements/docs.txt | ||
commands = | ||
sphinx-multiversion --dump-metadata docs/source docs/build/html | jq "keys" | ||
sphinx-multiversion docs/source docs/build/html | ||
|