Skip to content

Commit

Permalink
add tox ini as entrypoint for tests in cpu gha (#42)
Browse files Browse the repository at this point in the history
* add tox ini as entrypoint for tests in cpu gha

* refactor lint method on gha

* adding pip install of setup packages i.e. tox

* remove run from tox command

* change the requirement dev location in tox

* update pylintrc

* add docs requirements and use tox to generate docs
  • Loading branch information
jperez999 authored Nov 3, 2022
1 parent 5905283 commit 61ca2ed
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 27 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/cpu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,15 @@ jobs:
- name: Install Ubuntu packages
run: |
sudo apt-get update -y
- name: Install
- name: Install and upgrade python packages
run: |
python -m pip install -e .[all]
# hack
pip install fsspec==2022.5.0
- name: Lint with flake8
python -m pip install --upgrade pip setuptools==59.4.0 wheel tox
- name: Lint
run: |
flake8 .
- name: Lint with black
run: |
black --check .
- name: Lint with isort
run: |
isort -c .
- name: Lint with interrogate
run: |
interrogate --config=pyproject.toml
- name: Lint with codespell
run: |
codespell
tox -re lint
- name: Run unittests
run: |
python -m pytest -rxs tests/unit/
tox -re test-cpu
- name: Generate package for pypi
run: |
python setup.py sdist
Expand Down Expand Up @@ -81,7 +67,7 @@ jobs:
# Build docs, treat warnings as errors
- name: Building docs
run: |
make -C docs html SPHINXOPTS="-W -q"
tox -re docs
- name: Upload HTML
uses: actions/upload-artifact@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[MASTER]

ignore-patterns=_version.py,versioneer.py
ignore-patterns=_version.py,model_config_pb2.py

extension-pkg-allow-list=hugectr,nvtabular_cpp

Expand All @@ -22,6 +22,7 @@ disable=fixme,
# we'll probably never enable these checks
invalid-name,
import-error,
no-self-use,

# disable code-complexity checks for now
# TODO: should we configure the thresholds for these rather than just disable?
Expand Down Expand Up @@ -58,16 +59,15 @@ disable=fixme,
duplicate-string-formatting-argument,
len-as-condition,
cyclic-import,
consider-using-f-string,
arguments-renamed,

# producing false positives
unexpected-keyword-arg,
not-an-iterable,
unsubscriptable-object
unsubscriptable-object,
signature-differs

[SIMILARITIES]
min-similarity-lines=30
min-similarity-lines=50
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=yes
17 changes: 17 additions & 0 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-r base.txt
-r dev.txt

tritonclient[all]
tensorflow<=2.9.0

Sphinx==3.5.4
sphinx_rtd_theme==1.0.0
sphinx-multiversion@git+https://github.com/mikemckiernan/sphinx-multiversion.git
sphinxcontrib-copydirs@git+https://github.com/mikemckiernan/sphinxcontrib-copydirs.git
recommonmark==0.7.1
Jinja2<3.1
natsort==8.0.1
myst-nb==0.13.2
linkify-it-py==1.0.3
sphinx-external-toc==0.2.4
attrs==21.4.0
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ deps = -rrequirements/base.txt
commands =
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git
python -m pip install -e .[all]
python -m pip install fsspec==2022.5.0
python -m pytest --cov-report term --cov=merlin -rxs tests/unit

[testenv:test-gpu]
Expand All @@ -39,7 +41,7 @@ commands =
; 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
deps = -rrequirements/dev.txt
commands =
flake8 setup.py merlin/ tests/
black --check --diff merlin tests
Expand All @@ -53,7 +55,7 @@ commands =
; 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
deps = -rrequirements/docs.txt
commands =
python -m sphinx.cmd.build -P -b html docs/source docs/build/html

Expand Down

0 comments on commit 61ca2ed

Please sign in to comment.