Skip to content

Commit 11b3eb6

Browse files
Add tox.ini and fix code_quality workflow
1 parent 6fd7a64 commit 11b3eb6

File tree

3 files changed

+55
-7
lines changed

3 files changed

+55
-7
lines changed

.github/workflows/code_quality.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ on:
44
push:
55
tags: ["[0-9]+.[0-9]+.[0-9]+"]
66
pull_request:
7-
branches: [main]
7+
branches: [main, release/*]
88

99
jobs:
1010
code-quality:
11-
name: Code Quality
1211
runs-on: ubuntu-latest
1312
timeout-minutes: 15
14-
strategy:
15-
matrix:
16-
tox_env: ["pre-commit-all", "build-docs"]
1713
steps:
1814
- uses: actions/checkout@v4
1915
- uses: actions/setup-python@v5
@@ -22,4 +18,4 @@ jobs:
2218
- name: Install tox
2319
run: pip install tox
2420
- name: Run code quality checks
25-
run: tox -e ${{ matrix.tox_env }}
21+
run: tox -e pre-commit-all

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
NVIDIA is dedicated to the security and trust of our software products and services, including all source code repositories managed through our organization.
44

5-
If you need to report a security issue, please use the appropriate contact points outlined below. **Please do not report security vulnerabilities through GitHub/GitLab.**
5+
If you need to report a security issue, please use the appropriate contact points outlined below. **Please do not report security vulnerabilities through GitHub.**
66

77
## Reporting Potential Security Vulnerability in an NVIDIA Product
88

tox.ini

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[tox]
2+
envlist=
3+
pre-commit-all
4+
py312-torch27-unit
5+
skipsdist = True
6+
toxworkdir = /tmp/{env:USER}-modelopt-tox
7+
8+
9+
############################
10+
# CPU Unit test environments
11+
############################
12+
[testenv:{py39,py310,py311,py312}-torch{24,25,26,27}-unit]
13+
deps =
14+
# torch version auto-selected based on torchvision version
15+
torch24: torchvision~=0.19.0
16+
torch25: torchvision~=0.20.0
17+
torch26: torchvision~=0.21.0
18+
torch27: torchvision~=0.22.0
19+
20+
-e .[all,dev-test]
21+
commands =
22+
python -m pytest tests/unit --cov
23+
24+
25+
#############################################
26+
# Code quality checks on all files or on diff
27+
#############################################
28+
[testenv:{pre-commit}-{all,diff}]
29+
deps =
30+
-e .[all,dev-lint]
31+
commands =
32+
all: pre-commit run --all-files --show-diff-on-failure {posargs}
33+
diff: pre-commit run --from-ref origin/main --to-ref HEAD {posargs}
34+
35+
36+
#####################
37+
# Documentation build
38+
#####################
39+
[testenv:{build,debug}-docs]
40+
allowlist_externals =
41+
rm
42+
passenv =
43+
SETUPTOOLS_SCM_PRETEND_VERSION
44+
deps =
45+
-e .[all,dev-docs]
46+
changedir = docs
47+
commands_pre =
48+
rm -rf build
49+
rm -rf source/reference/generated
50+
commands =
51+
sphinx-build source build/html --fail-on-warning --show-traceback --keep-going
52+
debug: sphinx-autobuild source build/html --host 0.0.0.0

0 commit comments

Comments
 (0)