diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 3e1ee9689..6e23c61d2 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -51,7 +51,7 @@ jobs: with: python-version: 3.8 cache: "pip" - cache-dependency-path: "setup.py" + cache-dependency-path: "pyproject.toml" - name: Install testing dependencies run: | python -m pip install --upgrade pip diff --git a/_delphi_utils_python/.bumpversion.cfg b/_delphi_utils_python/.bumpversion.cfg index 722a91e30..af22c56eb 100644 --- a/_delphi_utils_python/.bumpversion.cfg +++ b/_delphi_utils_python/.bumpversion.cfg @@ -4,6 +4,6 @@ commit = True message = chore: bump delphi_utils to {new_version} tag = False -[bumpversion:file:setup.py] +[bumpversion:file:pyproject.toml] [bumpversion:file:delphi_utils/__init__.py] diff --git a/_delphi_utils_python/DEVELOP.md b/_delphi_utils_python/DEVELOP.md index 2407e29a8..53ffde93f 100644 --- a/_delphi_utils_python/DEVELOP.md +++ b/_delphi_utils_python/DEVELOP.md @@ -9,7 +9,7 @@ To install the module in your default version of Python, run the following from this directory: ``` -pip install . +pip install -e '.[dev]' ``` As described in each of the indicator code directories, you will want to install diff --git a/_delphi_utils_python/Makefile b/_delphi_utils_python/Makefile index 79d7f7943..4249528d9 100644 --- a/_delphi_utils_python/Makefile +++ b/_delphi_utils_python/Makefile @@ -6,12 +6,12 @@ venv: install: venv . env/bin/activate; \ pip install wheel ; \ - pip install -e . + pip install -e '.[dev]' install-ci: venv . env/bin/activate; \ - pip install wheel ; \ - pip install . + pip install 'build[virtualenv]' pylint pytest pydocstyle wheel twine ; \ + pip install '.[dev]' lint: . env/bin/activate; pylint delphi_utils --rcfile=../pyproject.toml @@ -30,4 +30,5 @@ clean: release: lint test . env/bin/activate ; \ - python setup.py sdist bdist_wheel + pip install 'build[virtualenv]' ; \ + python -m build --sdist --wheel \ No newline at end of file diff --git a/_delphi_utils_python/pyproject.toml b/_delphi_utils_python/pyproject.toml new file mode 100644 index 000000000..6ca3d98b7 --- /dev/null +++ b/_delphi_utils_python/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ["setuptools", "setuptools-scm>=8.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "delphi-utils" +version = "0.3.24" +description = "Shared Utility Functions for Indicators" +readme = "README.md" +requires-python = "== 3.8.*" +license = {text = "MIT License"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.8", + "License :: MIT" +] +dependencies = [ + "boto3", + "covidcast", + "cvxpy", + "epiweeks", + "gitpython", + "importlib_resources>=1.3", + "numpy", + "pandas>=1.1.0", + "slackclient", + "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 + "structlog", + "xlrd", +] + +[project.urls] +Homepage = "https://github.com/cmu-delphi/covidcast-indicators" + + +[project.optional-dependencies] +dev = [ + "darker[isort]~=2.1.1", + "pylint==2.8.3", + "pytest", + "pydocstyle", + "pytest-cov", + "mock", + "moto~=4.2.14", + "requests-mock", + "freezegun", +] + + +[tool.setuptools.packages.find] +where = ["."] +include = ["delphi_utils"] +namespaces = true + +[tool.setuptools.package-data] +"delphi_utils.data" = ["20*/*.csv"] + + + diff --git a/_delphi_utils_python/setup.py b/_delphi_utils_python/setup.py deleted file mode 100644 index 3dee89b53..000000000 --- a/_delphi_utils_python/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -from setuptools import setup -from setuptools import find_packages - -with open("README.md", "r") as f: - long_description = f.read() - -required = [ - "boto3", - "covidcast", - "cvxpy", - "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 - "darker[isort]~=2.1.1", - "epiweeks", - "freezegun", - "gitpython", - "importlib_resources>=1.3", - "mock", - "moto~=4.2.14", - "numpy", - "pandas>=1.1.0", - "pydocstyle", - "pylint==2.8.3", - "pytest-cov", - "pytest", - "requests-mock", - "slackclient", - "structlog", - "xlrd" -] - -setup( - name="delphi_utils", - version="0.3.24", - description="Shared Utility Functions for Indicators", - long_description=long_description, - long_description_content_type="text/markdown", - author="", - author_email="", - url="https://github.com/cmu-delphi/", - install_requires=required, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Programming Language :: Python :: 3.8", - ], - packages=find_packages(), - package_data={'': ['data/20*/*.csv']} -) diff --git a/changehc/Makefile b/changehc/Makefile index 390113eef..1934c9864 100644 --- a/changehc/Makefile +++ b/changehc/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/claims_hosp/Makefile b/claims_hosp/Makefile index 390113eef..1934c9864 100644 --- a/claims_hosp/Makefile +++ b/claims_hosp/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/doctor_visits/Makefile b/doctor_visits/Makefile index 390113eef..1934c9864 100644 --- a/doctor_visits/Makefile +++ b/doctor_visits/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/google_symptoms/Makefile b/google_symptoms/Makefile index 6884278cf..15c428849 100644 --- a/google_symptoms/Makefile +++ b/google_symptoms/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/hhs_hosp/Makefile b/hhs_hosp/Makefile index 69529feb7..5ae0527d7 100644 --- a/hhs_hosp/Makefile +++ b/hhs_hosp/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/nchs_mortality/Makefile b/nchs_mortality/Makefile index 390113eef..1934c9864 100644 --- a/nchs_mortality/Makefile +++ b/nchs_mortality/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/nchs_mortality/setup.py b/nchs_mortality/setup.py index 3fe354ba4..142db6f35 100644 --- a/nchs_mortality/setup.py +++ b/nchs_mortality/setup.py @@ -2,10 +2,12 @@ from setuptools import find_packages required = [ + "boto3", "darker[isort]~=2.1.1", "delphi-utils", "epiweeks", "freezegun", + "moto~=4.2.14", "numpy", "pandas", "pydocstyle", diff --git a/nssp/Makefile b/nssp/Makefile index 390113eef..1934c9864 100644 --- a/nssp/Makefile +++ b/nssp/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/nwss_wastewater/Makefile b/nwss_wastewater/Makefile index 390113eef..1934c9864 100644 --- a/nwss_wastewater/Makefile +++ b/nwss_wastewater/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/quidel_covidtest/Makefile b/quidel_covidtest/Makefile index 390113eef..1934c9864 100644 --- a/quidel_covidtest/Makefile +++ b/quidel_covidtest/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: diff --git a/quidel_covidtest/setup.py b/quidel_covidtest/setup.py index c2791930f..c579da79e 100644 --- a/quidel_covidtest/setup.py +++ b/quidel_covidtest/setup.py @@ -2,6 +2,7 @@ from setuptools import find_packages required = [ + "boto3", "covidcast", "darker[isort]~=2.1.1", "delphi-utils", diff --git a/sir_complainsalot/Makefile b/sir_complainsalot/Makefile index 390113eef..1934c9864 100644 --- a/sir_complainsalot/Makefile +++ b/sir_complainsalot/Makefile @@ -13,7 +13,7 @@ install: venv install-ci: venv . env/bin/activate; \ pip install wheel ; \ - pip install ../_delphi_utils_python ;\ + pip install '../_delphi_utils_python[dev]' ;\ pip install . lint: