Skip to content

Commit 1786a4d

Browse files
ckoehnrafiss
authored andcommitted
Use pip-compile to pin dependencies
1 parent b005ae8 commit 1786a4d

11 files changed

+137
-106
lines changed

Makefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1+
ENV_BASE=~/envs
2+
ENV=${ENV_BASE}/sqlalchemy-cockroachdb
3+
TOX=${ENV}/bin/tox
4+
15
.PHONY: all
26
all: test lint
37

8+
.PHONY: bootstrap
9+
bootstrap:
10+
@mkdir -p ${ENV}
11+
virtualenv ${ENV}
12+
${ENV}/bin/pip install -r dev-requirements.txt
13+
14+
.PHONY: clean-bootstrap-env
15+
clean-bootstrap-env:
16+
rm -rf ${ENV}
17+
418
.PHONY: test
519
test:
6-
tox
20+
${TOX} -e py39
721

822
.PHONY: lint
923
lint:
10-
tox -e lint
24+
${TOX} -e lint
1125

12-
# Update the requirements files (but does not install the updates; use
13-
# bootstrap.sh for that)
1426
.PHONY: update-requirements
1527
update-requirements:
16-
./update-requirements.sh dev-requirements.txt
17-
./update-requirements.sh test-requirements.txt
28+
${TOX} -e pip-compile
1829

1930
.PHONY: build
2031
build: clean
21-
python setup.py sdist
32+
${ENV}/bin/python setup.py sdist
2233

2334
.PHONY: clean
2435
clean:

README.testing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ Install them with
2828

2929
Then, to run a complete test simply invoke
3030

31-
pytest
31+
make test
3232

33-
at a command prompt in your virtual environment.
33+
at a command prompt after you bootstrapped your environment with
34+
35+
make bootstrap
3436

3537
To run just the SQLAlchemy test suite, use
3638

bootstrap.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

dev-requirements.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Packages used by the Makefile
2+
#
3+
# To add/update dependencies, update dev-requirements.in (not the
4+
# generated dev-requirements.txt), run make update-requirements,
5+
# then make bootstrap.
6+
7+
tox
8+
9+
# Twine is used in the release process to upload the package.
10+
twine

dev-requirements.txt

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,84 @@
1-
# Packages used by the Makefile and other scripts.
2-
#
3-
# To add/update dependencies, update dev-requirements.txt.in (not the
4-
# generated dev-requirements.txt), run make update-requirements,
5-
# then re-run bootstrap.sh.
6-
7-
flake8==3.9.2
8-
tox==3.23.1
9-
# Twine is used in the release process to upload the package.
10-
twine==3.4.1
11-
## The following requirements were added by pip freeze:
121
appdirs==1.4.4
2+
# via virtualenv
133
bleach==3.3.0
4+
# via readme-renderer
145
certifi==2021.5.30
6+
# via requests
157
cffi==1.14.5
8+
# via cryptography
169
chardet==4.0.0
10+
# via requests
1711
colorama==0.4.4
12+
# via twine
1813
cryptography==3.4.7
14+
# via secretstorage
1915
distlib==0.3.2
16+
# via virtualenv
2017
docutils==0.17.1
18+
# via readme-renderer
2119
filelock==3.0.12
20+
# via
21+
# tox
22+
# virtualenv
2223
idna==2.10
23-
importlib-metadata==4.4.0
24+
# via requests
25+
importlib-metadata==4.5.0
26+
# via
27+
# keyring
28+
# twine
2429
jeepney==0.6.0
30+
# via
31+
# keyring
32+
# secretstorage
2533
keyring==23.0.1
26-
mccabe==0.6.1
34+
# via twine
2735
packaging==20.9
36+
# via
37+
# bleach
38+
# tox
2839
pkginfo==1.7.0
40+
# via twine
2941
pluggy==0.13.1
42+
# via tox
3043
py==1.10.0
31-
pycodestyle==2.7.0
44+
# via tox
3245
pycparser==2.20
33-
pyflakes==2.3.1
34-
Pygments==2.9.0
46+
# via cffi
47+
pygments==2.9.0
48+
# via readme-renderer
3549
pyparsing==2.4.7
50+
# via packaging
3651
readme-renderer==29.0
37-
requests==2.25.1
52+
# via twine
3853
requests-toolbelt==0.9.1
54+
# via twine
55+
requests==2.25.1
56+
# via
57+
# requests-toolbelt
58+
# twine
3959
rfc3986==1.5.0
40-
SecretStorage==3.3.1
60+
# via twine
61+
secretstorage==3.3.1
62+
# via keyring
4163
six==1.16.0
64+
# via
65+
# bleach
66+
# readme-renderer
67+
# tox
68+
# virtualenv
4269
toml==0.10.2
43-
tqdm==4.61.0
44-
typing-extensions==3.10.0.0
70+
# via tox
71+
tox==3.23.1
72+
# via -r dev-requirements.in
73+
tqdm==4.61.1
74+
# via twine
75+
twine==3.4.1
76+
# via -r dev-requirements.in
4577
urllib3==1.26.5
78+
# via requests
4679
virtualenv==20.4.7
80+
# via tox
4781
webencodings==0.5.1
82+
# via bleach
4883
zipp==3.4.1
84+
# via importlib-metadata

dev-requirements.txt.in

Lines changed: 0 additions & 11 deletions
This file was deleted.

test-requirements.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Packages used when running tests. Installed by tox into multiple
2+
# virtualenvs.
3+
#
4+
# To add/update dependencies, update test-requirements.in (not the
5+
# generated test-requirements.txt) and run make update-requirements
6+
7+
# Remove this once alembic 1.7 has been released
8+
git+https://github.com/sqlalchemy/alembic
9+
futures
10+
mock
11+
more-itertools
12+
psycopg2
13+
pytest
14+
sqlalchemy

test-requirements.txt

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
1-
# Packages used when running tests. Installed by tox into multiple
2-
# virtualenvs.
3-
#
4-
# To add/update dependencies, update test-requirements.txt.in (not the
5-
# generated test-requirements.txt) and run make update-requirements
6-
7-
SQLAlchemy==1.4.17
8-
# temporary tweak required until Alembic 1.7 is released:
91
git+https://github.com/sqlalchemy/alembic
10-
more-itertools==8.8.0
11-
mock==4.0.3
12-
pytest==6.2.4
13-
futures==3.1.1
14-
psycopg2==2.8.6
15-
## The following requirements were added by pip freeze:
2+
# via -r test-requirements.in
163
attrs==21.2.0
4+
# via pytest
5+
futures==3.1.1
6+
# via -r test-requirements.in
177
greenlet==1.1.0
18-
importlib-metadata==4.4.0
8+
# via sqlalchemy
199
iniconfig==1.1.1
10+
# via pytest
11+
mako==1.1.4
12+
# via alembic
13+
markupsafe==2.0.1
14+
# via mako
15+
mock==4.0.3
16+
# via -r test-requirements.in
17+
more-itertools==8.8.0
18+
# via -r test-requirements.in
2019
packaging==20.9
20+
# via pytest
2121
pluggy==0.13.1
22+
# via pytest
23+
psycopg2==2.9.1
24+
# via -r test-requirements.in
2225
py==1.10.0
26+
# via pytest
2327
pyparsing==2.4.7
28+
# via packaging
29+
pytest==6.2.4
30+
# via -r test-requirements.in
31+
sqlalchemy==1.4.18
32+
# via
33+
# -r test-requirements.in
34+
# alembic
2435
toml==0.10.2
25-
typing-extensions==3.10.0.0
26-
zipp==3.4.1
27-
Mako
28-
python-editor>=0.3
29-
python-dateutil
30-
six
36+
# via pytest

test-requirements.txt.in

Lines changed: 0 additions & 15 deletions
This file was deleted.

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ deps =
1818
flake8==3.9.2
1919
commands =
2020
flake8 sqlalchemy_cockroachdb test
21+
22+
[testenv:pip-compile]
23+
skip_install = True
24+
deps =
25+
pip-tools==6.1.0
26+
commands =
27+
pip-compile --upgrade --no-emit-index-url --no-header dev-requirements.in
28+
pip-compile --upgrade --no-emit-index-url --no-header test-requirements.in

0 commit comments

Comments
 (0)