diff --git a/.github/workflows/cpu-ci.yml b/.github/workflows/cpu-ci.yml index ae3e75d0..37a48c3c 100644 --- a/.github/workflows/cpu-ci.yml +++ b/.github/workflows/cpu-ci.yml @@ -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 @@ -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: diff --git a/.pylintrc b/.pylintrc index 1fb1a895..a208b3b0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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 @@ -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? @@ -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 diff --git a/requirements/docs.txt b/requirements/docs.txt new file mode 100644 index 00000000..f13b2097 --- /dev/null +++ b/requirements/docs.txt @@ -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 \ No newline at end of file diff --git a/tox.ini b/tox.ini index a3d9ac4f..97d89ea6 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -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 @@ -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