From e23ce1912d733777aaf3bfb9f003a3ddc2e4de8d Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Tue, 26 Oct 2021 14:53:49 -0400 Subject: [PATCH 1/2] move version specification from setup.cfg to _version.__version__ within each subpackage. In future a public api will be exposed allowing users to more easily check the version they are using whilst using it --- python/_restclient/setup.cfg | 2 +- python/_restclient/src/hydrotools/_restclient/_version.py | 1 + python/caches/setup.cfg | 2 +- python/caches/src/hydrotools/caches/_version.py | 1 + python/events/setup.cfg | 2 +- python/events/src/hydrotools/events/event_detection/_version.py | 1 + python/gcp_client/setup.cfg | 2 +- python/gcp_client/src/hydrotools/gcp_client/_version.py | 1 + python/metrics/setup.cfg | 2 +- python/metrics/src/hydrotools/metrics/_version.py | 1 + python/nwis_client/setup.cfg | 2 +- python/nwis_client/src/hydrotools/nwis_client/_version.py | 1 + python/nwm_client/setup.cfg | 2 +- python/nwm_client/src/hydrotools/nwm_client/_version.py | 1 + setup.cfg | 2 +- src/hydrotools/_version.py | 1 + 16 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 python/_restclient/src/hydrotools/_restclient/_version.py create mode 100644 python/caches/src/hydrotools/caches/_version.py create mode 100644 python/events/src/hydrotools/events/event_detection/_version.py create mode 100644 python/gcp_client/src/hydrotools/gcp_client/_version.py create mode 100644 python/metrics/src/hydrotools/metrics/_version.py create mode 100644 python/nwis_client/src/hydrotools/nwis_client/_version.py create mode 100644 python/nwm_client/src/hydrotools/nwm_client/_version.py create mode 100644 src/hydrotools/_version.py diff --git a/python/_restclient/setup.cfg b/python/_restclient/setup.cfg index 7583b141..ca394bf2 100644 --- a/python/_restclient/setup.cfg +++ b/python/_restclient/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools._restclient -version = 3.0.4 +version = attr: hydrotools._restclient._version.__version__ author = Austin Raney author_email = aaraney@protonmail.com description = General REST api client with built in request caching and retries. diff --git a/python/_restclient/src/hydrotools/_restclient/_version.py b/python/_restclient/src/hydrotools/_restclient/_version.py new file mode 100644 index 00000000..8e10cb46 --- /dev/null +++ b/python/_restclient/src/hydrotools/_restclient/_version.py @@ -0,0 +1 @@ +__version__ = "3.0.4" diff --git a/python/caches/setup.cfg b/python/caches/setup.cfg index 69da9787..1b19c35a 100644 --- a/python/caches/setup.cfg +++ b/python/caches/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools.caches -version = 0.1.3 +version = attr: hydrotools.caches._version.__version__ author = Jason A. Regina author_email = jason.regina@noaa.gov description = Variety of object caching utilities for OWPHydroTools. diff --git a/python/caches/src/hydrotools/caches/_version.py b/python/caches/src/hydrotools/caches/_version.py new file mode 100644 index 00000000..ae736254 --- /dev/null +++ b/python/caches/src/hydrotools/caches/_version.py @@ -0,0 +1 @@ +__version__ = "0.1.3" diff --git a/python/events/setup.cfg b/python/events/setup.cfg index 417334c0..63205390 100644 --- a/python/events/setup.cfg +++ b/python/events/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools.events -version = 1.1.5 +version = attr: hydrotools.events.event_detection._version.__version__ author = Jason A. Regina author_email = jason.regina@noaa.gov description = Various methods to support event-based evaluations. diff --git a/python/events/src/hydrotools/events/event_detection/_version.py b/python/events/src/hydrotools/events/event_detection/_version.py new file mode 100644 index 00000000..9b102be7 --- /dev/null +++ b/python/events/src/hydrotools/events/event_detection/_version.py @@ -0,0 +1 @@ +__version__ = "1.1.5" diff --git a/python/gcp_client/setup.cfg b/python/gcp_client/setup.cfg index 660fc749..9334a202 100644 --- a/python/gcp_client/setup.cfg +++ b/python/gcp_client/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools.gcp_client -version = 4.1.2 +version = attr: hydrotools.gcp_client._version.__version__ author = Jason A. Regina author_email = jason.regina@noaa.gov description = Retrieve National Water Model data from Google Cloud Platform. diff --git a/python/gcp_client/src/hydrotools/gcp_client/_version.py b/python/gcp_client/src/hydrotools/gcp_client/_version.py new file mode 100644 index 00000000..13ffcf42 --- /dev/null +++ b/python/gcp_client/src/hydrotools/gcp_client/_version.py @@ -0,0 +1 @@ +__version__ = "4.1.2" diff --git a/python/metrics/setup.cfg b/python/metrics/setup.cfg index fd82d88c..39f040a8 100644 --- a/python/metrics/setup.cfg +++ b/python/metrics/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools.metrics -version = 1.0.3 +version = attr: hydrotools.metrics._version.__version__ author = Jason A. Regina author_email = jason.regina@noaa.gov description = Variety of standard model evaluation metrics. diff --git a/python/metrics/src/hydrotools/metrics/_version.py b/python/metrics/src/hydrotools/metrics/_version.py new file mode 100644 index 00000000..976498ab --- /dev/null +++ b/python/metrics/src/hydrotools/metrics/_version.py @@ -0,0 +1 @@ +__version__ = "1.0.3" diff --git a/python/nwis_client/setup.cfg b/python/nwis_client/setup.cfg index 8174c058..ef5d89f9 100644 --- a/python/nwis_client/setup.cfg +++ b/python/nwis_client/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools.nwis_client -version = 3.0.6 +version = attr: hydrotools.nwis_client._version.__version__ author = Austin Raney author_email = aaraney@protonmail.com description = A convenient interface to the USGS NWIS Instantaneous Values (IV) REST Service API. diff --git a/python/nwis_client/src/hydrotools/nwis_client/_version.py b/python/nwis_client/src/hydrotools/nwis_client/_version.py new file mode 100644 index 00000000..6ed01825 --- /dev/null +++ b/python/nwis_client/src/hydrotools/nwis_client/_version.py @@ -0,0 +1 @@ +__version__ = "3.0.6" diff --git a/python/nwm_client/setup.cfg b/python/nwm_client/setup.cfg index 18619fd3..989a3c61 100644 --- a/python/nwm_client/setup.cfg +++ b/python/nwm_client/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools.nwm_client -version = 5.0.1 +version = attr: hydrotools.nwm_client._version.__version__ author = Jason A. Regina author_email = jason.regina@noaa.gov description = Retrieve National Water Model data from various sources. diff --git a/python/nwm_client/src/hydrotools/nwm_client/_version.py b/python/nwm_client/src/hydrotools/nwm_client/_version.py new file mode 100644 index 00000000..2fe5fde1 --- /dev/null +++ b/python/nwm_client/src/hydrotools/nwm_client/_version.py @@ -0,0 +1 @@ +__version__ = "5.0.1" diff --git a/setup.cfg b/setup.cfg index 78002996..fd185901 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hydrotools -version = 2.1.2 +version = attr: hydrotools._version.__version__ author = Jason A. Regina and Austin Raney author_email = jason.regina@noaa.gov description = Suite of tools for retrieving USGS NWIS observations and evaluating National Water Model (NWM) data. diff --git a/src/hydrotools/_version.py b/src/hydrotools/_version.py new file mode 100644 index 00000000..4eabd0b3 --- /dev/null +++ b/src/hydrotools/_version.py @@ -0,0 +1 @@ +__version__ = "2.1.2" From 0871dd7fcb2d857436d17bda4fe57db5eaf7a01c Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Tue, 26 Oct 2021 15:12:05 -0400 Subject: [PATCH 2/2] import __version__ in __init__.py. needed by setuptools for ast parsing. see setuptools #1724 for more information --- python/_restclient/src/hydrotools/_restclient/__init__.py | 3 +++ python/caches/src/hydrotools/caches/__init__.py | 2 ++ .../events/src/hydrotools/events/event_detection/__init__.py | 2 ++ python/gcp_client/src/hydrotools/gcp_client/__init__.py | 3 +++ python/metrics/src/hydrotools/metrics/__init__.py | 2 ++ python/nwis_client/src/hydrotools/nwis_client/__init__.py | 3 +++ python/nwm_client/src/hydrotools/nwm_client/__init__.py | 2 ++ src/hydrotools/__init__.py | 2 ++ 8 files changed, 19 insertions(+) diff --git a/python/_restclient/src/hydrotools/_restclient/__init__.py b/python/_restclient/src/hydrotools/_restclient/__init__.py index 780b7d1e..49454378 100644 --- a/python/_restclient/src/hydrotools/_restclient/__init__.py +++ b/python/_restclient/src/hydrotools/_restclient/__init__.py @@ -1,3 +1,6 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__ + from ._restclient import RestClient from .utilities import Alias, AliasGroup from .urllib import Url, Variadic diff --git a/python/caches/src/hydrotools/caches/__init__.py b/python/caches/src/hydrotools/caches/__init__.py index e69de29b..a1826172 100644 --- a/python/caches/src/hydrotools/caches/__init__.py +++ b/python/caches/src/hydrotools/caches/__init__.py @@ -0,0 +1,2 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__ diff --git a/python/events/src/hydrotools/events/event_detection/__init__.py b/python/events/src/hydrotools/events/event_detection/__init__.py index e69de29b..a1826172 100644 --- a/python/events/src/hydrotools/events/event_detection/__init__.py +++ b/python/events/src/hydrotools/events/event_detection/__init__.py @@ -0,0 +1,2 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__ diff --git a/python/gcp_client/src/hydrotools/gcp_client/__init__.py b/python/gcp_client/src/hydrotools/gcp_client/__init__.py index 30e272eb..e623f659 100644 --- a/python/gcp_client/src/hydrotools/gcp_client/__init__.py +++ b/python/gcp_client/src/hydrotools/gcp_client/__init__.py @@ -1,3 +1,6 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__ + from .gcp import NWMDataService import warnings diff --git a/python/metrics/src/hydrotools/metrics/__init__.py b/python/metrics/src/hydrotools/metrics/__init__.py index e69de29b..a1826172 100644 --- a/python/metrics/src/hydrotools/metrics/__init__.py +++ b/python/metrics/src/hydrotools/metrics/__init__.py @@ -0,0 +1,2 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__ diff --git a/python/nwis_client/src/hydrotools/nwis_client/__init__.py b/python/nwis_client/src/hydrotools/nwis_client/__init__.py index b5634eda..3a22ee1e 100644 --- a/python/nwis_client/src/hydrotools/nwis_client/__init__.py +++ b/python/nwis_client/src/hydrotools/nwis_client/__init__.py @@ -1 +1,4 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__ + from .iv import IVDataService diff --git a/python/nwm_client/src/hydrotools/nwm_client/__init__.py b/python/nwm_client/src/hydrotools/nwm_client/__init__.py index e69de29b..a1826172 100644 --- a/python/nwm_client/src/hydrotools/nwm_client/__init__.py +++ b/python/nwm_client/src/hydrotools/nwm_client/__init__.py @@ -0,0 +1,2 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__ diff --git a/src/hydrotools/__init__.py b/src/hydrotools/__init__.py index e69de29b..a1826172 100644 --- a/src/hydrotools/__init__.py +++ b/src/hydrotools/__init__.py @@ -0,0 +1,2 @@ +# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822 +from ._version import __version__