Skip to content

Commit 13de21a

Browse files
authored
Merge pull request #1984 from cmu-delphi/1973-clean-up-delphi_utils
Clean up delphi_utils
2 parents b3fe2cb + c115276 commit 13de21a

File tree

18 files changed

+81
-65
lines changed

18 files changed

+81
-65
lines changed

.github/workflows/python-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
python-version: 3.8
5353
cache: "pip"
54-
cache-dependency-path: "setup.py"
54+
cache-dependency-path: "pyproject.toml"
5555
- name: Install testing dependencies
5656
run: |
5757
python -m pip install --upgrade pip

_delphi_utils_python/.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ commit = True
44
message = chore: bump delphi_utils to {new_version}
55
tag = False
66

7-
[bumpversion:file:setup.py]
7+
[bumpversion:file:pyproject.toml]
88

99
[bumpversion:file:delphi_utils/__init__.py]

_delphi_utils_python/DEVELOP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To install the module in your default version of Python, run the
99
following from this directory:
1010

1111
```
12-
pip install .
12+
pip install -e '.[dev]'
1313
```
1414

1515
As described in each of the indicator code directories, you will want to install

_delphi_utils_python/Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ venv:
66
install: venv
77
. env/bin/activate; \
88
pip install wheel ; \
9-
pip install -e .
9+
pip install -e '.[dev]'
1010

1111
install-ci: venv
1212
. env/bin/activate; \
13-
pip install wheel ; \
14-
pip install .
13+
pip install 'build[virtualenv]' pylint pytest pydocstyle wheel twine ; \
14+
pip install '.[dev]'
1515

1616
lint:
1717
. env/bin/activate; pylint delphi_utils --rcfile=../pyproject.toml
@@ -30,4 +30,5 @@ clean:
3030

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

_delphi_utils_python/pyproject.toml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools-scm>=8.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "delphi-utils"
7+
version = "0.3.24"
8+
description = "Shared Utility Functions for Indicators"
9+
readme = "README.md"
10+
requires-python = "== 3.8.*"
11+
license = {text = "MIT License"}
12+
classifiers = [
13+
"Development Status :: 5 - Production/Stable",
14+
"Intended Audience :: Developers",
15+
"Programming Language :: Python :: 3.8",
16+
"License :: MIT"
17+
]
18+
dependencies = [
19+
"boto3",
20+
"covidcast",
21+
"cvxpy",
22+
"epiweeks",
23+
"gitpython",
24+
"importlib_resources>=1.3",
25+
"numpy",
26+
"pandas>=1.1.0",
27+
"slackclient",
28+
"scs<3.2.6", # TODO: remove this ; it is a cvxpy dependency, and the excluded version appears to break our jenkins build. see: https://github.com/cvxgrp/scs/issues/283
29+
"structlog",
30+
"xlrd",
31+
]
32+
33+
[project.urls]
34+
Homepage = "https://github.com/cmu-delphi/covidcast-indicators"
35+
36+
37+
[project.optional-dependencies]
38+
dev = [
39+
"darker[isort]~=2.1.1",
40+
"pylint==2.8.3",
41+
"pytest",
42+
"pydocstyle",
43+
"pytest-cov",
44+
"mock",
45+
"moto~=4.2.14",
46+
"requests-mock",
47+
"freezegun",
48+
]
49+
50+
51+
[tool.setuptools.packages.find]
52+
where = ["."]
53+
include = ["delphi_utils"]
54+
namespaces = true
55+
56+
[tool.setuptools.package-data]
57+
"delphi_utils.data" = ["20*/*.csv"]
58+
59+
60+

_delphi_utils_python/setup.py

-48
This file was deleted.

changehc/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

claims_hosp/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

doctor_visits/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

google_symptoms/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

hhs_hosp/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

nchs_mortality/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

nchs_mortality/setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
from setuptools import find_packages
33

44
required = [
5+
"boto3",
56
"darker[isort]~=2.1.1",
67
"delphi-utils",
78
"epiweeks",
89
"freezegun",
10+
"moto~=4.2.14",
911
"numpy",
1012
"pandas",
1113
"pydocstyle",

nssp/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

nwss_wastewater/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

quidel_covidtest/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

quidel_covidtest/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from setuptools import find_packages
33

44
required = [
5+
"boto3",
56
"covidcast",
67
"darker[isort]~=2.1.1",
78
"delphi-utils",

sir_complainsalot/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install: venv
1313
install-ci: venv
1414
. env/bin/activate; \
1515
pip install wheel ; \
16-
pip install ../_delphi_utils_python ;\
16+
pip install '../_delphi_utils_python[dev]' ;\
1717
pip install .
1818

1919
lint:

0 commit comments

Comments
 (0)