Skip to content

lint: clean Makefiles env handling #2020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: ds/clean-clean-delphi-utils
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ d4b056e7a4c11982324e9224c9f9f6fd5d5ec65c
# Format test_geomap.py
79072dcdec3faca9aaeeea65de83f7fa5c00d53f
# Sort setup.py dependencies
6912077acba97e835aff7d0cd3d64309a1a9241d
6912077acba97e835aff7d0cd3d64309a1a9241d
# Clean Makefiles
07c1d02fa5446c8e0de7649e494d259b4ebb3d1b
21 changes: 8 additions & 13 deletions _delphi_utils_python/Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
.PHONY = venv, lint, test, clean, release

venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e '.[dev]'
env/bin/pip install -e '.[dev]'

install-ci: venv
. env/bin/activate; \
pip install '.[dev]'
env/bin/pip install '.[dev]'

lint:
. env/bin/activate; pylint delphi_utils --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle delphi_utils
env/bin/pylint delphi_utils --rcfile=../pyproject.toml
env/bin/pydocstyle delphi_utils

format:
. env/bin/activate; darker delphi_utils
env/bin/darker delphi_utils

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=delphi_utils --cov-report=term-missing)

clean:
rm -rf env
rm -f params.json

release: lint test
. env/bin/activate ; \
python -m build --sdist --wheel
env/bin/python -m build --sdist --wheel
22 changes: 9 additions & 13 deletions _template_python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
22 changes: 9 additions & 13 deletions changehc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
22 changes: 9 additions & 13 deletions claims_hosp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
22 changes: 9 additions & 13 deletions doctor_visits/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
22 changes: 9 additions & 13 deletions google_symptoms/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
22 changes: 9 additions & 13 deletions hhs_hosp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
22 changes: 9 additions & 13 deletions nchs_mortality/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
22 changes: 9 additions & 13 deletions nssp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@

dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*' | head -1)
venv:
python3.8 -m venv env; \
. env/bin/activate; \
python -m pip install pip==23.0.1
python3.8 -m venv env
env/bin/python -m pip install pip==23.0.1

install: venv
. env/bin/activate; \
pip install -e ../_delphi_utils_python ;\
pip install -e .
env/bin/pip install -e ../_delphi_utils_python
env/bin/pip install -e .

install-ci: venv
. env/bin/activate; \
pip install ../_delphi_utils_python ;\
pip install .
env/bin/pip install ../_delphi_utils_python
env/bin/pip install .

lint:
. env/bin/activate; pylint $(dir) --rcfile=../pyproject.toml
. env/bin/activate; pydocstyle $(dir)
env/bin/pylint $(dir) --rcfile=../pyproject.toml
env/bin/pydocstyle $(dir)

format:
. env/bin/activate; darker $(dir)
env/bin/darker $(dir)

test:
. env/bin/activate ;\
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing)

clean:
Expand Down
Loading