File tree Expand file tree Collapse file tree
{{cookiecutter.project_slug}} Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,22 +13,22 @@ help: Makefile
1313init :
1414 python -m venv .venv
1515 direnv allow .
16- type python
1716
1817# # install: add a new package (make install <package>), or install all project dependencies from piplock.txt (make install)
1918.PHONY : install
2019install :
2120 python -m pip install --upgrade pip
22- ifeq ($(filter-out $@ ,$(MAKECMDGOALS ) ) ,)
23- @echo "Installing dependencies from piplock.txt"
24- pip install -r piplock.txt
25- else
26- @echo "Adding package $(filter-out $@,$(MAKECMDGOALS)) to requirements.txt"
27- @grep -q "^$(filter-out $@,$(MAKECMDGOALS))$$" requirements.txt || echo "$(filter-out $@,$(MAKECMDGOALS))" >> requirements.txt
28- pip install $(filter-out $@,$(MAKECMDGOALS))
29- pip install -r requirements.txt
30- pip freeze > piplock.txt
31- endif
21+ @if [ -z " $( filter-out install,$( MAKECMDGOALS) ) " ]; then \
22+ echo " Installing dependencies from piplock.txt" ; \
23+ pip install -r piplock.txt; \
24+ else \
25+ pkg=" $( filter-out install,$( MAKECMDGOALS) ) " ; \
26+ echo " Adding package $$ pkg to requirements.txt" ; \
27+ grep -q " ^$$ pkg$$ " requirements.txt || echo " $$ pkg" >> requirements.txt; \
28+ pip install $$ pkg; \
29+ pip install -r requirements.txt; \
30+ pip freeze > piplock.txt; \
31+ fi
3232
3333# Empty rule to handle package name argument
3434% :
You can’t perform that action at this time.
0 commit comments