Skip to content

Commit dc1ed8b

Browse files
committed
Add CI requirements lockfile
1 parent b65bb74 commit dc1ed8b

9 files changed

+598
-442
lines changed

.circleci/config.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ commands:
5858
- save_cache:
5959
paths:
6060
- ~/.cache/pip
61-
key: drr-pip-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-test.lock.txt" }}
61+
key: drr-pip-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-ci.lock.txt" }}
6262
restore_pip_cache:
6363
steps:
6464
- restore_cache:
6565
keys:
66-
- drr-pip-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-test.lock.txt" }}
66+
- drr-pip-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-ci.lock.txt" }}
6767
save_py_venv_cache:
6868
steps:
6969
- save_cache:
7070
paths:
7171
- ~/.venv
72-
key: drr-py-venv-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-test.lock.txt" }}
72+
key: drr-py-venv-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-ci.lock.txt" }}
7373
restore_py_venv_cache:
7474
steps:
7575
- restore_cache:
7676
keys:
77-
- drr-py-venv-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-test.lock.txt" }}
77+
- drr-py-venv-{{ .Environment.CACHE_VERSION }}-{{ checksum "requirements/requirements-ci.lock.txt" }}
7878
save_project_workspace:
7979
steps:
8080
- persist_to_workspace:
@@ -97,7 +97,7 @@ jobs:
9797
- restore_pip_cache
9898
- restore_py_venv_cache
9999
- run: python -m venv --copies ~/.venv
100-
- run: source ~/.venv/bin/activate && make install_test
100+
- run: source ~/.venv/bin/activate && make install_ci
101101
- save_pip_cache
102102
- save_py_venv_cache
103103
- save_project_workspace

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,22 @@ install_dev: ## install all pip requirements and the package as editable
5050
${PYTHON} -m pip install -r requirements/requirements-dev.lock.txt ${ARGS}
5151
${PYTHON} -m pip install -e .
5252

53+
.PHONY: install_ci
54+
install_ci: ## install all pip requirements needed for CI and the package as editable
55+
${PYTHON} -m pip install -r requirements/requirements-ci.lock.txt ${ARGS}
56+
${PYTHON} -m pip install -e .
57+
5358
.PHONY: install_test
5459
install_test: ## install all pip requirements needed for testing and the package as editable
5560
${PYTHON} -m pip install -r requirements/requirements-test.lock.txt ${ARGS}
5661
${PYTHON} -m pip install -e .
5762

5863
.PHONY: upgrade_requirements_lockfiles
5964
upgrade_requirements_lockfiles: ## upgrade pip requirements lock files
60-
${PIP_COMPILE} ${PIP_COMPILE_OPTS} --output-file=requirements/requirements-base.lock.txt
61-
${PIP_COMPILE} ${PIP_COMPILE_OPTS} --output-file=requirements/requirements-test.lock.txt requirements/requirements-base.lock.txt requirements/requirements-test.in
62-
${PIP_COMPILE} ${PIP_COMPILE_OPTS} --output-file=requirements/requirements-dev.lock.txt requirements/requirements-test.lock.txt requirements/requirements-dev.in
65+
${PIP_COMPILE} ${PIP_COMPILE_OPTS} setup.py requirements/requirements-base.in --output-file=requirements/requirements-base.lock.txt
66+
${PIP_COMPILE} ${PIP_COMPILE_OPTS} requirements/requirements-base.lock.txt requirements/requirements-test.in --output-file=requirements/requirements-test.lock.txt
67+
${PIP_COMPILE} ${PIP_COMPILE_OPTS} requirements/requirements-test.lock.txt requirements/requirements-ci.in --output-file=requirements/requirements-ci.lock.txt
68+
${PIP_COMPILE} ${PIP_COMPILE_OPTS} requirements/requirements-ci.lock.txt requirements/requirements-dev.in --output-file=requirements/requirements-dev.lock.txt
6369

6470
.PHONY: upgrade_dev
6571
upgrade_dev: upgrade_requirements_lockfiles install_dev ## upgrade all pip requirements and reinstall package as editable

requirements/requirements-base.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# asgiref 3.8+ requires Py 3.8+
2+
asgiref<3.8.0

requirements/requirements-base.lock.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
5-
# pip-compile --output-file=requirements/requirements-base.lock.txt
5+
# pip-compile --output-file=requirements/requirements-base.lock.txt requirements/requirements-base.in setup.py
66
#
7-
asgiref==3.8.1
8-
# via django
9-
django==5.0.7
7+
asgiref==3.7.2
8+
# via
9+
# -r requirements/requirements-base.in
10+
# django
11+
django==5.0.8
1012
# via
1113
# django-rest-registration (setup.py)
1214
# djangorestframework

requirements/requirements-ci.in

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# linting
2+
flake8
3+
flake8-comprehensions
4+
flake8-debugger
5+
flake8-isort
6+
flake8-pyproject
7+
flake8-print
8+
flake8-tuple
9+
isort[pyproject]
10+
pylint
11+
12+
# type checking
13+
mypy
14+
django-stubs
15+
djangorestframework-stubs
16+
17+
# package building
18+
build
19+
docutils
20+
Pygments>=2.2.0
21+
twine>=1.11.0
22+
wheel>=0.31.0
23+
readme_renderer[md]
24+
25+
# documentation
26+
Sphinx
27+
# not fixing this causes
28+
# pip._internal.exceptions.MetadataGenerationFailed: metadata generation failed
29+
sphinx_rtd_theme==2.0
30+
sphinx-autobuild
31+
sphinx-jinja
32+
doc8
33+
34+
# cookbook
35+
pyjwt

0 commit comments

Comments
 (0)