diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml new file mode 100644 index 000000000..4a8720552 --- /dev/null +++ b/.github/workflows/python_ci.yml @@ -0,0 +1,41 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-20.04 + strategy: + matrix: + #packages: [_delphi_utils_python, cdc_covidnet, claims_hosp, combo_cases_and_deaths, google_symptoms, jhu, nchs_mortality, quidel, quidel_covidtest, safegraph, safegraph_patterns, usafacts] + packages: [cdc_covidnet, claims_hosp, combo_cases_and_deaths, google_symptoms, jhu, nchs_mortality, quidel, quidel_covidtest, safegraph, safegraph_patterns, usafacts] + defaults: + run: + working-directory: ${{ matrix.packages }} + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install testing dependencies + run: | + python -m pip install --upgrade pip + pip install pylint pytest pydocstyle wheel + - name: Install + run: | + make install + - name: Lint + run: | + # make lint + - name: Test + run: | + make test diff --git a/_delphi_utils_python/Makefile b/_delphi_utils_python/Makefile new file mode 100644 index 000000000..56c71683b --- /dev/null +++ b/_delphi_utils_python/Makefile @@ -0,0 +1,22 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/_template_python/Makefile b/_template_python/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/_template_python/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/cdc_covidnet/Makefile b/cdc_covidnet/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/cdc_covidnet/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/changehc/Makefile b/changehc/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/changehc/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/claims_hosp/Makefile b/claims_hosp/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/claims_hosp/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/combo_cases_and_deaths/Makefile b/combo_cases_and_deaths/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/combo_cases_and_deaths/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/google_health/Makefile b/google_health/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/google_health/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/google_symptoms/Makefile b/google_symptoms/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/google_symptoms/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/jhu/Makefile b/jhu/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/jhu/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/nchs_mortality/Makefile b/nchs_mortality/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/nchs_mortality/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/quidel/Makefile b/quidel/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/quidel/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/quidel_covidtest/Makefile b/quidel_covidtest/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/quidel_covidtest/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/safegraph/Makefile b/safegraph/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/safegraph/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/safegraph_patterns/Makefile b/safegraph_patterns/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/safegraph_patterns/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file diff --git a/usafacts/Makefile b/usafacts/Makefile new file mode 100644 index 000000000..78d92e958 --- /dev/null +++ b/usafacts/Makefile @@ -0,0 +1,23 @@ +.PHONY = venv, lint, test, clean + +dir = $(shell find ./delphi_* -name __init__.py | sed 's/\/__init__.py//g;s/\.\///g') + +venv: + python3 -m venv env + +install: venv + . env/bin/activate; \ + pip install wheel ; \ + pip install -e ../_delphi_utils_python ;\ + pip install -e . + +lint: + . env/bin/activate; \ + pylint $(dir) + +test: + . env/bin/activate ;\ + (cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) + +clean: + rm -r env \ No newline at end of file