Skip to content

Commit 775bb9c

Browse files
committed
Use pdm to get a list of dependencies for pip-check-reqs
1 parent 0a76b4c commit 775bb9c

File tree

7 files changed

+5
-31
lines changed

7 files changed

+5
-31
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ jobs:
3232
- uses: actions/cache@v3
3333
with:
3434
path: ~/.cache/pip
35-
# This is like the example but we use ``*requirements.txt`` rather
36-
# than ``requirements.txt`` because we have multiple requirements
37-
# files.
38-
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
35+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
3936
restore-keys: |
4037
${{ runner.os }}-pip-
4138

.github/workflows/windows-ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ jobs:
3232
- uses: actions/cache@v3
3333
with:
3434
path: ~\AppData\Local\pip\Cache
35-
# This is like the example but we use ``*requirements.txt`` rather
36-
# than ``requirements.txt`` because we have multiple requirements
37-
# files.
38-
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
35+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
3936
restore-keys: |
4037
${{ runner.os }}-pip-
4138

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
include src/vws/py.typed
2-
include requirements/*.txt
32
include pyproject.toml

lint.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ fix-ruff:
3232

3333
.PHONY: pip-extra-reqs
3434
pip-extra-reqs:
35+
pdm export --pyproject > requirements/requirements.txt
3536
pip-extra-reqs --requirements-file=requirements/requirements.txt src/
3637

3738
.PHONY: pip-missing-reqs
3839
pip-missing-reqs:
40+
pdm export --pyproject > requirements/requirements.txt
3941
pip-missing-reqs --requirements-file=requirements/requirements.txt src/
4042

4143
.PHONY: pylint

requirements/dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dodgy==0.2.1 # Look for uploaded secrets
1111
freezegun==1.2.2
1212
furo==2022.12.7
1313
mypy==1.1.1 # Type checking
14+
pdm==2.4.8
1415
pip_check_reqs==2.4.4
1516
pydocstyle==6.3.0 # Lint docstrings
1617
pyenchant==3.2.2 # Bindings for a spellchecking sytem
@@ -24,5 +25,4 @@ sphinx-prompt==1.5.0
2425
sphinxcontrib-spelling==8.0.0
2526
types-freezegun==1.1.10
2627
types-requests==2.28.11.15
27-
types-setuptools==67.6.0.0
2828
vulture==2.7

requirements/requirements.txt

Whitespace-only changes.

setup.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
"""Setup script for VWS Python, a wrapper for Vuforia's Web Services APIs."""
22

3-
from pathlib import Path
4-
53
from setuptools import setup
64

7-
8-
def _get_dependencies(requirements_file: Path) -> list[str]:
9-
"""
10-
Return requirements from a requirements file.
11-
12-
This expects a requirements file with no ``--find-links`` lines.
13-
"""
14-
lines = requirements_file.read_text().strip().split("\n")
15-
return [line for line in lines if not line.startswith("#")]
16-
17-
18-
DEV_REQUIRES = _get_dependencies(
19-
requirements_file=Path("requirements/dev-requirements.txt"),
20-
)
21-
22-
SETUP_REQUIRES = _get_dependencies(
23-
requirements_file=Path("requirements/setup-requirements.txt"),
24-
)
25-
265
setup(
276
setup_requires=SETUP_REQUIRES,
287
extras_require={"dev": DEV_REQUIRES},

0 commit comments

Comments
 (0)