Skip to content

Commit cfb451b

Browse files
committed
build+ci: make dev envs identical with gh build envs
* remove extra pip install calls from ci, rely only on make install * make sure make install upgrades pip * pylint pytest pydocstyle in ci call were redudant * install twine in [dev] section of _delphi_utils dependencies * install build in [dev] section of _delphi_utils dependencies * only needed wheel for bdist_wheel command, which setuptools>=70.1 provides, so remove wheel
1 parent 46ef13b commit cfb451b

File tree

17 files changed

+44
-51
lines changed

17 files changed

+44
-51
lines changed

.github/workflows/publish-release.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
if: ${{ steps.changes.outputs.utils == 'true' }}
5757
run: git tag delphi-utils/v${{ steps.utils.outputs.version }}
5858
- name: Publish tags
59-
run: git push --tags
59+
run: git push --tags
6060
outputs:
6161
indicators-version: ${{ steps.indicators.outputs.version }}
6262
utils-version: ${{ steps.utils.outputs.version }}
@@ -76,10 +76,6 @@ jobs:
7676
uses: actions/setup-python@v2
7777
with:
7878
python-version: 3.8
79-
- name: Install testing dependencies
80-
run: |
81-
python -m pip install --upgrade pip
82-
pip install pylint pytest pydocstyle wheel twine
8379
- name: Install
8480
run: |
8581
make install

.github/workflows/python-ci.yml

-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ jobs:
5252
python-version: 3.8
5353
cache: "pip"
5454
cache-dependency-path: "pyproject.toml"
55-
- name: Install testing dependencies
56-
run: |
57-
python -m pip install --upgrade pip
58-
pip install pylint pytest pydocstyle wheel
5955
- name: Install
6056
run: |
6157
make install-ci

_delphi_utils_python/Makefile

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
.PHONY = venv, lint, test, clean, release
22

33
venv:
4-
python3.8 -m venv env
4+
python3.8 -m venv env; \
5+
. env/bin/activate; \
6+
python -m pip install --upgrade pip
57

68
install: venv
79
. env/bin/activate; \
8-
pip install wheel ; \
910
pip install -e '.[dev]'
1011

1112
install-ci: venv
1213
. env/bin/activate; \
13-
pip install 'build[virtualenv]' pylint pytest pydocstyle wheel twine ; \
1414
pip install '.[dev]'
1515

1616
lint:
@@ -30,5 +30,4 @@ clean:
3030

3131
release: lint test
3232
. env/bin/activate ; \
33-
pip install 'build[virtualenv]' ; \
34-
python -m build --sdist --wheel
33+
python -m build --sdist --wheel

_delphi_utils_python/pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools", "setuptools-scm>=8.0"]
2+
requires = ["setuptools>=70.1", "setuptools-scm>=8.0"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -36,6 +36,7 @@ Homepage = "https://github.com/cmu-delphi/covidcast-indicators"
3636

3737
[project.optional-dependencies]
3838
dev = [
39+
"build[virtualenv]",
3940
"darker[isort]~=2.1.1",
4041
"pylint==2.8.3",
4142
"pytest",
@@ -45,6 +46,7 @@ dev = [
4546
"moto~=4.2.14",
4647
"requests-mock",
4748
"freezegun",
49+
"twine"
4850
]
4951
flash = ["scipy"]
5052

_template_python/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

changehc/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

claims_hosp/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

doctor_visits/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

google_symptoms/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

hhs_hosp/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

jenkins/build-indicator.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
#
3-
# Jenkins build
3+
# Jenkins build
44
#
55

66
set -eo pipefail
@@ -14,7 +14,6 @@ cd "${WORKSPACE}/${local_indicator}" || exit
1414
# Set up venv
1515
python -m venv env
1616
source env/bin/activate
17-
pip install pip==23.0.1 --retries 10 --timeout 20
18-
pip install numpy --retries 10 --timeout 20
17+
python -m pip install --upgrade pip --retries 10 --timeout 20
1918
pip install ../_delphi_utils_python/. --retries 10 --timeout 20
2019
[ ! -f setup.py ] || pip install . --retries 10 --timeout 20

nchs_mortality/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

nssp/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

nwss_wastewater/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

quidel_covidtest/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

sir_complainsalot/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

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

79
install: venv
810
. env/bin/activate; \
9-
pip install wheel ; \
1011
pip install -e ../_delphi_utils_python ;\
1112
pip install -e .
1213

1314
install-ci: venv
1415
. env/bin/activate; \
15-
pip install wheel ; \
1616
pip install ../_delphi_utils_python ;\
1717
pip install .
1818

sir_complainsalot/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"darker[isort]~=2.1.1",
77
"delphi-utils",
88
"pandas",
9+
"pydocstyle",
910
"pylint==2.8.3",
1011
"pytest-cov",
1112
"pytest",

0 commit comments

Comments
 (0)