Skip to content

Commit

Permalink
Fix requirements in virtualenv being off by using pip-sync instead of…
Browse files Browse the repository at this point in the history
… pip install.
  • Loading branch information
Johan Bloemberg committed Nov 8, 2019
1 parent e9e05a3 commit 02e1c45
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env = env PATH=${bin}:$$PATH
python = ${bin}/python
pip = ${bin}/pip
pip-compile = ${bin}/pip-compile
pip-sync = ${bin}/pip-sync

# application binary
app = ${bin}/${app_name}
Expand All @@ -34,15 +35,15 @@ pysrcdirs = ${app_name}/
pysrc = $(shell find ${pysrcdirs} -name *.py)
shsrc = $(shell find * ! -path vendor\* -name *.sh)

.PHONY: test check setup run fix autofix clean mrproper test_integration
.PHONY: test check setup run fix autofix clean mrproper test_integration requirements requirements-dev

# default action to run
all: check test setup

## Setup
# setup entire dev environment
setup: ${app} ## setup development environment and application
@test -z "$$PS1" || (echo -ne "Development environment is tested and ready."; \
@test \! -z "$$PS1" || (echo -ne "Development environment is tested and ready."; \
if command -v dashboard &>/dev/null;then \
echo -e " Development shell is activated."; \
else \
Expand All @@ -52,14 +53,12 @@ setup: ${app} ## setup development environment and application
fi)

# install application and all its (python) dependencies
${app}: requirements requirements-dev | ${pip}
${pip} install -e .
${app}: ${VIRTUAL_ENV}/.requirements.installed | ${python}
${python} setup.py develop --no-deps
@touch $@

requirements requirements-dev: %: ${VIRTUAL_ENV}/.%.txt.installed

${VIRTUAL_ENV}/.%.txt.installed: %.txt | ${pip}
${pip} install --quiet -r $<
${VIRTUAL_ENV}/.requirements.installed: requirements.txt requirements-dev.txt | ${pip-sync}
${pip-sync} $^
@touch $@

# perform 'pip freeze' on first class requirements in .in files.
Expand Down Expand Up @@ -253,7 +252,7 @@ mrproper: clean clean_virtualenv ## thorough cleanup, also removes virtualenv

## Base requirements

${pip-compile}: | ${pip}
${pip-compile} ${pip-sync}: | ${pip}
${pip} install pip-tools

python: ${python}
Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# make sure there are no version conflicts with requirements.txt
-c requirements.txt

autopep8
autoflake
isort
Expand Down
10 changes: 5 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ chardet==3.0.4 # via requests
colorama==0.4.1
commonmark==0.9.1 # via recommonmark
coverage==4.5.4
decorator==4.4.1 # via moviepy
decorator==4.4.0 # via moviepy
django-coverage==1.2.4
django-cprofile-middleware==1.0.4
django-debug-toolbar-request-history==0.1.0
django-debug-toolbar==2.0
django-extensions==2.2.5
django==2.2.7 # via django-debug-toolbar
django==2.2.6 # via django-debug-toolbar
docutils==0.15.2 # via recommonmark, sphinx
freezegun==0.3.12
httmock==1.3.0
Expand Down Expand Up @@ -59,13 +59,13 @@ pytest-logging==2015.11.4
pytest-mock==1.11.2
pytest-responses==0.4.0
pytest==5.2.2
python-dateutil==2.8.1 # via freezegun
python-dateutil==2.8.0 # via freezegun
pytz==2019.3 # via babel, django
pyyaml==5.1.2 # via sphinx-autobuild, watchdog
recommonmark==0.6.0
requests==2.22.0 # via httmock, moviepy, responses, sphinx
responses==0.10.6 # via pytest-responses
six==1.13.0 # via django-extensions, freezegun, livereload, packaging, python-dateutil, responses
six==1.12.0 # via django-extensions, freezegun, livereload, packaging, python-dateutil, responses
snowballstemmer==2.0.0 # via pydocstyle, sphinx
sphinx-autobuild==0.7.1
sphinx==2.2.1
Expand All @@ -76,7 +76,7 @@ sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.2 # via sphinx
sphinxcontrib-serializinghtml==1.1.3 # via sphinx
sqlparse==0.3.0 # via django, django-debug-toolbar
tornado==6.0.3 # via livereload, sphinx-autobuild
tornado==5.1.1 # via livereload, sphinx-autobuild
tqdm==4.37.0 # via moviepy, proglog
urllib3==1.25.6 # via requests
watchdog==0.9.0 # via sphinx-autobuild
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ known_third_party=websecmap

[tool:pytest]
python_files = tests.py test_*.py *_tests.py
filterwarnings =
ignore:Using or importing the ABCs.*:DeprecationWarning

0 comments on commit 02e1c45

Please sign in to comment.