From b7c3732d1245ec66bd44c3541c5cdb223f0d193a Mon Sep 17 00:00:00 2001 From: Kristen Thyng Date: Fri, 27 Jan 2023 17:11:39 -0600 Subject: [PATCH 1/2] updates make sure docs run fixed release issue fixed test CI mamba issue updated to use importlib for version --- .github/workflows/release.yaml | 2 +- .github/workflows/test.yaml | 3 ++- docs/conf.py | 6 +++--- docs/index.rst | 18 ++++++++++++------ intake_axds/utils.py | 6 +++--- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f6d91b3..3e1a7ee 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ jobs: - uses: actions/setup-python@v4 - name: Install dependencies run: | - python -m pip install -U pip wheel setuptools setuptools-scm twine + python -m pip install -U pip wheel "setuptools<66.0.0" setuptools-scm twine - name: Build distributions run: python setup.py sdist bdist_wheel diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bfda1e5..40df97d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,7 +30,8 @@ jobs: key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }} - uses: conda-incubator/setup-miniconda@v2 with: - mamba-version: "*" # activate this to build with mamba. + python-version: ${{ matrix.python-version }} + miniforge-variant: Mambaforge channels: conda-forge, defaults # These need to be specified to use mamba channel-priority: true environment-file: ci/environment-py${{ matrix.python-version }}.yml diff --git a/docs/conf.py b/docs/conf.py index ab59c41..6aad4ea 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,17 +26,17 @@ # -- Project information ----------------------------------------------------- project = "intake-axds" -copyright = "2022, Axiom Data Science" +copyright = "2022–2023, Axiom Data Science" author = "Axiom Data Science" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # see https://pypi.org/project/setuptools-scm/ for details -from pkg_resources import get_distribution +from importlib.metadata import version as imversion -release = get_distribution("intake_axds").version +release = imversion("intake-axds") # for example take major/minor version = ".".join(release.split(".")[:2]) diff --git a/docs/index.rst b/docs/index.rst index 1db49b3..6b73925 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,11 +9,17 @@ Welcome to intake-axds's documentation! Installation ------------ +To install from conda-forge: + + >>> conda install -c intake-axds + To install from PyPI: >>> pip install intake-axds .. toctree:: :maxdepth: 2 + :hidden: + :caption: User Documentation demo_overview.md api @@ -21,11 +27,11 @@ To install from PyPI: -Indices and tables -================== +.. Indices and tables +.. ================== -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` +.. * :ref:`genindex` +.. * :ref:`modindex` +.. * :ref:`search` -.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html +.. .. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html diff --git a/intake_axds/utils.py b/intake_axds/utils.py index c23e217..953f9db 100644 --- a/intake_axds/utils.py +++ b/intake_axds/utils.py @@ -5,7 +5,7 @@ import cf_pandas as cfp import requests -from pkg_resources import DistributionNotFound, get_distribution +from importlib.metadata import PackageNotFoundError, version search_headers = {"Accept": "application/json"} @@ -14,8 +14,8 @@ def _get_version() -> str: """Fixes circular import issues.""" try: - __version__ = get_distribution("intake-axds").version - except DistributionNotFound: + __version__ = version("ocean-model-skill-assessor") + except PackageNotFoundError: # package is not installed __version__ = "unknown" From a1acab1bab562aa52afecca4d622504dbef49124 Mon Sep 17 00:00:00 2001 From: Kristen Thyng Date: Fri, 27 Jan 2023 17:15:46 -0600 Subject: [PATCH 2/2] lint --- intake_axds/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/intake_axds/utils.py b/intake_axds/utils.py index 953f9db..adae296 100644 --- a/intake_axds/utils.py +++ b/intake_axds/utils.py @@ -1,12 +1,11 @@ """Utils to run.""" +from importlib.metadata import PackageNotFoundError, version from typing import Optional import cf_pandas as cfp import requests -from importlib.metadata import PackageNotFoundError, version - search_headers = {"Accept": "application/json"}