Skip to content

Commit

Permalink
Merge pull request #92 from freedomofpress/support-dev-only-and-sync
Browse files Browse the repository at this point in the history
Support dev only and sync
  • Loading branch information
kushaldas authored Aug 26, 2021
2 parents 4949a1c + f3c876c commit 7d6dc21
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 121 deletions.
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include securedrop_proxy/VERSION
include changelog.md
include config-example.yaml
include qubes/securedrop.Proxy
include build-requirements.txt
include requirements.txt
include requirements/build-requirements.txt
include requirements/requirements.txt
include securedrop_proxy/*.py
include setup.py
31 changes: 23 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ all: help

.PHONY: venv
venv:
python3 -m venv .venv
## Good idea to upgrade pip and wheel when you create a new virtual environment.
## Or you could use the virtualenv command instead.
python3 -m venv .venv ## Provision a Python 3 virtualenv for **development**
.venv/bin/pip install --upgrade pip wheel
.venv/bin/pip install --require-hashes -r "dev-requirements.txt"
.venv/bin/pip install --require-hashes -r "requirements/dev-requirements.txt"

.PHONY: bandit
bandit: ## Run bandit with medium level excluding test-related folders
Expand Down Expand Up @@ -51,10 +49,27 @@ isort: ## Run isort for file formatting
isort-check: ## Check isort for file formatting
@isort --check-only --diff securedrop_proxy/*.py tests/*.py

.PHONY: update-pip-requirements
update-pip-requirements: ## Updates all Python requirements files via pip-compile.
pip-compile --generate-hashes --allow-unsafe --upgrade --output-file dev-requirements.txt dev-requirements.in requirements.in
pip-compile --generate-hashes --output-file requirements.txt requirements.in
.PHONY: sync-requirements
sync-requirements: ## Update dev-requirements.txt to pin to the same versions of prod dependencies
rm -r requirements/dev-requirements.txt && cp requirements/requirements.txt requirements/dev-requirements.txt
pip-compile --allow-unsafe --generate-hashes --output-file requirements/dev-requirements.txt requirements/requirements.in requirements/dev-requirements.in

.PHONY: requirements
requirements: ## Update *requirements.txt files if pinned versions do not comply with the dependency specifications in *requirements.in
pip-compile --generate-hashes --output-file requirements/requirements.txt requirements/requirements.in
$(MAKE) sync-requirements

.PHONY: update-dependency
update-dependency: ## Add or upgrade a package to the latest version that complies with the dependency specifications in requirements.in
pip-compile --generate-hashes --upgrade-package $(PACKAGE) --output-file requirements/requirements.txt requirements/requirements.in
$(MAKE) sync-requirements

.PHONY: update-dev-only-dependencies
update-dev-only-dependencies: ## Update dev-requirements.txt to pin to the latest versions of dev-only dependencies that comply with the dependency specifications in dev-requirements.in
$(MAKE) sync-requirements
@while read line; do \
pip-compile --allow-unsafe --generate-hashes --upgrade-package $file --output-file requirements/dev-requirements.txt requirements/requirements.in requirements/dev-requirements.in; \
done < 'requirements/dev-requirements.in'

.PHONY: test
test: clean .coverage ## Runs tests with coverage
Expand Down
File renamed without changes.
File renamed without changes.
192 changes: 92 additions & 100 deletions dev-requirements.txt → requirements/dev-requirements.txt

Large diffs are not rendered by default.

File renamed without changes.
22 changes: 11 additions & 11 deletions requirements.txt → requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
#
# pip-compile --generate-hashes --output-file=requirements.txt requirements.in
# pip-compile --generate-hashes --output-file=requirements/requirements.txt requirements/requirements.in
#
certifi==2018.10.15 \
--hash=sha256:339dc09518b07e2fa7eda5450740925974815557727d6bd35d319c1524a04a4c \
--hash=sha256:6d58c986d22b038c8c0df30d639f23a3e6d172a05c3583e766f4c0b785c0986a
# via
# -r requirements.in
# -r requirements/requirements.in
# requests
chardet==3.0.4 \
--hash=sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae \
--hash=sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691
# via
# -r requirements.in
# -r requirements/requirements.in
# requests
furl==2.0.0 \
--hash=sha256:f7e90e9f85ef3f2e64485f04c2a80b50af6133942812fd87a44d45305b079018 \
--hash=sha256:fdcaedc1fb19a63d7d875b0105b0a5b496dd0989330d454a42bcb401fa5454ec
# via -r requirements.in
# via -r requirements/requirements.in
idna==2.7 \
--hash=sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e \
--hash=sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16
# via
# -r requirements.in
# -r requirements/requirements.in
# requests
orderedmultidict==1.0 \
--hash=sha256:24e3b730cf84e4a6a68be5cc760864905cf66abc89851e724bd5b4e849eaa96b \
--hash=sha256:b89895ba6438038d0bdf88020ceff876cf3eae0d5c66a69b526fab31125db2c5
# via
# -r requirements.in
# -r requirements/requirements.in
# furl
pyyaml==5.4.1 \
--hash=sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf \
Expand All @@ -54,25 +54,25 @@ pyyaml==5.4.1 \
--hash=sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63 \
--hash=sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df \
--hash=sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc
# via -r requirements.in
# via -r requirements/requirements.in
requests==2.22.0 \
--hash=sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4 \
--hash=sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31
# via -r requirements.in
# via -r requirements/requirements.in
six==1.11.0 \
--hash=sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9 \
--hash=sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb
# via
# -r requirements.in
# -r requirements/requirements.in
# furl
# orderedmultidict
urllib3==1.25.10 \
--hash=sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a \
--hash=sha256:e7983572181f5e1522d9c98453462384ee92a0be7fac5f1413a1e35c56cc0461
# via
# -r requirements.in
# -r requirements/requirements.in
# requests
werkzeug==0.16.0 \
--hash=sha256:7280924747b5733b246fe23972186c6b348f9ae29724135a6dfc1e53cea433e7 \
--hash=sha256:e5f4a1f98b52b18a93da705a7458e55afb26f32bff83ff5d19189f92462d65c4
# via -r requirements.in
# via -r requirements/requirements.in

0 comments on commit 7d6dc21

Please sign in to comment.