Skip to content

Commit

Permalink
# This is a combination of 10 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

migrate github cpu build to use tox

# This is the commit message #2:

newline

# This is the commit message #3:

install tox in github action

# This is the commit message #4:

forgot tox oops

# This is the commit message #5:

remove macos version of tf

# This is the commit message #6:

install deps for docs in gh runner

# This is the commit message #7:

build docs with tox

# This is the commit message #8:

use a gh action to build docs

# This is the commit message #9:

move fil into tox file, remove docs for now

# This is the commit message #10:

add pytest for fil tests
  • Loading branch information
nv-alaiacano committed Aug 9, 2022
1 parent 4563861 commit 272e5c3
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 82 deletions.
41 changes: 14 additions & 27 deletions .github/workflows/cpu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,18 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler pandoc
- name: Install dependencies
- name: Install and upgrade python packages
run: |
python -m pip install --upgrade pip setuptools==59.4.0 wheel
python -m pip install -r requirements-dev.txt
python -m pip install tensorflow
# required for ensemble tests
python -m pip install xgboost
- name: Lint with flake8
python -m pip install --upgrade pip setuptools==59.4.0 wheel tox
- name: Lint with flake8, black, isort, interrogate, codespell
run: |
flake8 .
- name: Lint with black
tox -e lint
- name: Run tests
run: |
black --check .
- name: Lint with isort
tox -e test-cpu
- name: Run FIL tests
run: |
isort -c .
- name: Lint with interrogate
run: |
interrogate --config=pyproject.toml
- name: Lint with codespell
run: |
codespell
- name: Build
run: |
pip install .
- name: Run unittests
run: |
python -m pytest -rxs tests/unit/
tox -e test-fil-cpu
- name: Generate package for pypi
run: |
python setup.py sdist
Expand All @@ -66,9 +50,12 @@ jobs:
path: dist

# Build docs, treat warnings as errors
- name: Building docs
run: |
make -C docs html SPHINXOPTS="-W -q"
# - name: Building docs
# uses: ammaraskar/sphinx-action@master
# with:
# docs-folder: "docs/"
# run: |
# tox -e docs
- name: Upload HTML
uses: actions/upload-artifact@v2
with:
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/fil.yml

This file was deleted.

15 changes: 2 additions & 13 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
# packages necessary to run tests and push PRs
# assumes requirements for nvtabular logic are already installed

# Required to generate docs and also run tests
tritonclient[all]
nvtabular

# testing
pytest>=5
pytest-cov>=2
scikit-learn>=0.20
git+https://github.com/rapidsai/asvdb.git
testbook

# linting
pylint==2.7.4
click==8.0.3
black==21.7b0
black==22.6.0
flake8==3.9.2
isort==5.9.3
bandit==1.7.0
Expand All @@ -35,4 +25,3 @@ natsort==8.0.1
myst-nb==0.13.2
linkify-it-py==1.0.3
sphinx-external-toc==0.2.4

4 changes: 4 additions & 0 deletions requirements-test-cpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r requirements-test.txt

faiss-cpu==1.7.2
tensorflow<=2.9.0
4 changes: 4 additions & 0 deletions requirements-test-gpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r requirements-test.txt

tensorflow-gpu<=2.9.0
faiss-gpu==1.7.2
22 changes: 22 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-r requirements.txt
-r requirements-dev.txt

# This contains common libraries for testing.

# NOTE: You should pip install requirements-test-[cpu|gpu].txt for device-specific test
# requirements, which will include the dependencies defined in this file.

pytest>=5
pytest-cov>=2
scikit-learn>=0.20
git+https://github.com/rapidsai/asvdb.git
testbook==0.4.2

# packages necessary to run tests and push PRs
feast==0.19.4
xgboost==1.6.1

nvtabular

# TODO: do we need more of these?
# https://github.com/NVIDIA-Merlin/Merlin/blob/a1cc48fe23c4dfc627423168436f26ef7e028204/ci/dockerfile.ci#L13-L18
44 changes: 44 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[tox]
envlist = python3.8,test-gpu,test-cpu

[testenv]
deps = -rrequirements-dev.txt
commands =
pip install --upgrade pip
pip install .
allowlist_externals = sphinx-build

[testenv:test-cpu]
deps = -rrequirements-test-cpu.txt
commands = python -m pytest --cov-report term --cov=merlin -rxs tests/unit/

[testenv:test-gpu]
deps = -rrequirements-test-gpu.txt
commands = python -m pytest --cov-report term --cov=merlin -rxs tests/unit/

[testenv:test-fil-cpu]
deps =
pytest
xgboost
lightgbm
sklearn
treelite==2.3.0
treelite_runtime==2.3.0
commands =
python setup.py develop
python -m pytest -rxs tests/unit/systems/fil/

[testenv:lint]
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]
changedir = {toxinidir}/docs
deps = attrs
commands =
sphinx-build -W -q source build

0 comments on commit 272e5c3

Please sign in to comment.