Skip to content

Commit 2f060b7

Browse files
fpgmaasmaresb
andcommitted
Add deptry to check for issues with the project's dependencies
Co-authored-by: Ben Mares <[email protected]>
1 parent 0e29d76 commit 2f060b7

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed

.github/workflows/deptry.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: deptry
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
deptry:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
shell: bash -leo pipefail {0}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: mamba-org/setup-micromamba@v1
17+
with:
18+
micromamba-version: "latest" # any version from https://github.com/mamba-org/micromamba-releases
19+
environment-file: environment.yml
20+
init-shell: bash
21+
cache-environment: true
22+
post-cleanup: "all"
23+
- name: Install pytensor and mypy dependencies
24+
run: |
25+
pip install -e .
26+
python --version
27+
shell: micromamba-shell {0}
28+
- name: Run deptry
29+
run: |
30+
deptry .
31+
shell: micromamba-shell {0}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ core
5151
/htmlcov/
5252

5353
pytensor-venv/
54+
venv
5455
/notebooks/Sandbox*
5556
.vscode/
5657
testing-report.html

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies:
3434
- pytest-xdist
3535
- pytest-benchmark
3636
- pytest-mock
37+
- deptry
3738
# For building docs
3839
- sphinx>=5.1.0,<6
3940
- sphinx_rtd_theme

pyproject.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,67 @@ test-skip = ["cp37*", "*musllinux*", "*win32*", "*i686*"]
182182
# Testing seems to be running into issues locating libs where expected
183183
# test-requires = ["pytest", "numba", "jax", "jaxlib"]
184184
# test-command = "pytest {package}/tests"
185+
186+
[tool.deptry]
187+
pep621_dev_dependency_groups = ["development", "tests", "rtd"]
188+
extend_exclude = ["doc", "conftest.py", "versioneer.py", "scripts"]
189+
190+
[tool.deptry.per_rule_ignores]
191+
# DEP001: Python modules that are imported within a project, for which no
192+
# corresponding packages are found in the dependencies.
193+
DEP001=[
194+
# Available debuggers are automatically detected, and the first available
195+
# is used in the following order: `pudb`, `ipdb`, or `pdb` (stdlib).
196+
"pudb",
197+
"ipdb",
198+
199+
# The `mkl` library is used for BLAS when available.
200+
"mkl",
201+
202+
# 'cutils_ext' and 'lazylinker_ext' are dynamically generated code by the C backend.
203+
"cutils_ext",
204+
"lazylinker_ext",
205+
206+
# 'numpyro' is an optional backend.
207+
"numpyro",
208+
209+
# 'llvmlite' is only required for the 'numba' backend.
210+
"llvmlite",
211+
212+
# 'tensorflow_probability' provides JAX implementations for some ops.
213+
"tensorflow_probability",
214+
215+
# The 'distutils' import is slated for removal in
216+
# <https://github.com/pymc-devs/pytensor/pull/812>
217+
"distutils",
218+
]
219+
220+
# DEP002: Dependencies that are required in a project, but are not used within the
221+
# codebase.
222+
DEP002=[
223+
# 'jaxlib' is required in the 'jax' group.
224+
# jaxlib is the support library for JAX. While JAX itself is a pure Python package,
225+
# jaxlib contains the binary (C/C++) parts of the library, including Python
226+
# bindings, the XLA compiler, the PJRT runtime, and a handful of handwritten
227+
# kernels.
228+
"jaxlib",
229+
]
230+
231+
# DEP004: Dependencies specified as development ones that should be included as
232+
# regular dependencies.
233+
DEP004=[
234+
# 'pydot' is a Python interface to Graphviz's Dot language, used by d3viz.
235+
# See <https://github.com/pymc-devs/pytensor/issues/333>.
236+
"pydot",
237+
238+
# pydot-ng is slated for removal in <https://github.com/pymc-devs/pytensor/pull/341>
239+
"pydot_ng",
240+
]
241+
242+
[tool.deptry.package_module_name_map]
243+
pydot2 = "pydot2"
244+
pydot-ng = "pydot_ng"
245+
jax = "jax"
246+
jaxlib = "jaxlib"
247+
numba = "numba"
248+
llvmlite = "llvmlite"

0 commit comments

Comments
 (0)