diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 77d9bc3..1145586 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,6 +46,9 @@ jobs: create-args: >- python=${{matrix.python-version}} conda + - name: Fetch all history for all tags and branches + run: | + git fetch --prune --unshallow - name: Set up conda environment run: | python -m pip install -e . diff --git a/ci/environment.yml b/ci/environment.yml index 3a03ba2..8fa3b6c 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -7,3 +7,5 @@ dependencies: - pooch - pre-commit - pytest-cov + - setuptools + - setuptools-scm diff --git a/open_radar_data/__init__.py b/open_radar_data/__init__.py index 1f8a4be..8def243 100644 --- a/open_radar_data/__init__.py +++ b/open_radar_data/__init__.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 # flake8: noqa """Top-level module for pythia-datasets .""" -from pkg_resources import DistributionNotFound, get_distribution +import importlib.metadata as _importlib_metadata from .dataset import DATASETS, locate try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: # pragma: no cover + __version__ = _importlib_metadata.version("open-radar-data") +except _importlib_metadata.PackageNotFoundError: # pragma: no cover # package is not installed __version__ = 'unknown' # pragma: no cover diff --git a/open_radar_data/dataset.py b/open_radar_data/dataset.py index 2118477..c016ee7 100644 --- a/open_radar_data/dataset.py +++ b/open_radar_data/dataset.py @@ -1,4 +1,4 @@ -import pkg_resources +import importlib.resources import pooch DATASETS = pooch.create( @@ -7,7 +7,7 @@ env='OPEN_RADAR_DATA_DIR', ) -with pkg_resources.resource_stream('open_radar_data', 'registry.txt') as registry_file: +with open(importlib.resources.files('open_radar_data') / 'registry.txt') as registry_file: DATASETS.load_registry(registry_file)