Skip to content

Commit

Permalink
Update project metadata and CI workflows (#79)
Browse files Browse the repository at this point in the history
* Move build-system table after project table

Also add py3.13 and Forum link to metadata.

* Use venv instead of conda for test-bmi sesssion

* Use setup-python action instead of setup-miniconda

* Update BMI docs URL

* Use py312 to build docs

* Update changelog in docs

* Use importlib instead of pkg_resources for version

* Make pretty

* Use py312 for linting

* Use OT API key for notebook tests

* Include importlib-metadata in docs dependencies

* Use setup-python action instead of setup-miniconda

* Use setup-python action instead of setup-miniconda

* Change docs url to csdms.io
  • Loading branch information
mdpiper authored Feb 8, 2025
1 parent e5b3ce3 commit ee01d48
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: 3.11
python-version: 3.12
auto-activate-base: false

- name: Install dependencies
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
- uses: actions/setup-python@v5
with:
miniforge-version: latest
python-version: 3.11
auto-activate-base: false
python-version: 3.12

- name: Install nox
run: pip install nox
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Miniforge3
miniforge-version: latest
auto-update-conda: true

- name: Install nox
run: pip install nox

- name: Check Jupyter notebooks
env:
OPENTOPOGRAPHY_API_KEY: ${{ secrets.OPENTOPOGRAPHY_API_KEY }}
MPLBACKEND: "Agg"
run: |
nox --verbose -s check-notebooks --force-pythons="${{ matrix.python-version }}"
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
miniforge-version: latest
python-version: ${{ matrix.python-version }}

- name: Install nox
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![PyPI](https://img.shields.io/pypi/v/bmi-topography)](https://pypi.org/project/bmi-topography)
[![Build/Test CI](https://github.com/csdms/bmi-topography/actions/workflows/test.yml/badge.svg)](https://github.com/csdms/bmi-topography/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/csdms/bmi-topography/badge.svg?branch=main)](https://coveralls.io/github/csdms/bmi-topography?branch=main)
[![Documentation Status](https://readthedocs.org/projects/bmi-topography/badge/?version=latest)](https://bmi-topography.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/bmi-topography/badge/?version=latest)](https://bmi-topography.csdms.io/en/latest/?badge=latest)

# bmi-topography

Expand Down Expand Up @@ -187,11 +187,11 @@ included in the [examples][bmi-topo-examples] directory
of the *bmi-topography* repository.

User and developer documentation for *bmi-topography*
is available at https://bmi-topography.readthedocs.io.
is available at https://bmi-topography.csdms.io.

<!-- Links (by alpha) -->

[bmi]: https://bmi.readthedocs.io
[bmi]: https://bmi.csdms.io
[bmi-topo-examples]: https://github.com/csdms/bmi-topography/tree/main/examples
[bmi-topo-repo]: https://github.com/csdms/bmi-topography
[conda-env]: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
Expand Down
2 changes: 1 addition & 1 deletion bmi_topography/api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, api_key, source="user"):
if self.is_demo_key():
warnings.warn(
"You are using a demo key to fetch data from OpenTopography, functionality "
"will be limited. See https://bmi-topography.readthedocs.io/en/latest/#api-key "
"will be limited. See https://bmi-topography.csdms.io/en/latest/#api-key "
"for more information."
)

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx
recommonmark
pandoc
importlib-metadata
41 changes: 24 additions & 17 deletions docs/source/CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
Changes for bmi-topography
==========================

0.8.5 (unreleased)
0.8.6 (unreleased)
------------------

- Make an examples landing page (#77)

0.8.5 (2024-08-18)
------------------

- Check example notebooks (#75)
Expand All @@ -10,14 +15,16 @@ Changes for bmi-topography
- Use pre-commit for linting and formatting (#72)
- De-lint project files (#71)

.. _section-1:

0.8.4 (2024-03-28)
------------------

- Update docs build (#68)
- Set minimum python>=3.10 (#67)
- Link to project contributing and code of conduct docs (#65)

.. _section-1:
.. _section-2:

0.8.3 (2023-12-18)
------------------
Expand All @@ -27,14 +34,14 @@ Changes for bmi-topography
- Fix failing docs build (#58)
- Use nox in CI testing (#54)

.. _section-2:
.. _section-3:

0.8.2 (2023-02-06)
------------------

- Fix problem getting CRS info for AAIGrid type (#53)

.. _section-3:
.. _section-4:

0.8.1 (2023-01-27)
------------------
Expand All @@ -45,38 +52,38 @@ Changes for bmi-topography
- Use rio accessor for geospatial information (#47)
- Update contents of source and binary distributions (#46)

.. _section-4:
.. _section-5:

0.8 (2022-07-05)
----------------

- Switch from xarray to rioxarray (#45)
- Move metadata from setup.cfg to pyproject.toml (#44)

.. _section-5:
.. _section-6:

0.7.1 (2022-06-03)
------------------

- Provide a better reason for 401 errors (#41)

.. _section-6:
.. _section-7:

0.7 (2022-03-24)
----------------

- Support all OpenTopography global datasets (#39)
- Create test matrix of datasets and file types (#38)

.. _section-7:
.. _section-8:

0.6 (2022-02-17)
----------------

- Use dashes in command line options (#36)
- Use a demo API key if a user key can’t be found (#34)

.. _section-8:
.. _section-9:

0.5.1 (2022-02-15)
------------------
Expand All @@ -85,7 +92,7 @@ Changes for bmi-topography
- Add text to exception raised when API key is missing (#32)
- Use new black syntax (#31)

.. _section-9:
.. _section-10:

0.5 (2022-01-25)
----------------
Expand All @@ -94,7 +101,7 @@ Changes for bmi-topography
- Add python 3.10 to tests (#24)
- Address technical debt (#22)

.. _section-10:
.. _section-11:

0.4 (2021-09-03)
----------------
Expand All @@ -104,7 +111,7 @@ Changes for bmi-topography
- Add format job to CI
- Use CITATION.cff file

.. _section-11:
.. _section-12:

0.3.2 (2021-04-23)
------------------
Expand All @@ -113,23 +120,23 @@ Changes for bmi-topography
- Fix typos, update text in example notebooks
- Create CREDITS.md and rearrange docs

.. _section-12:
.. _section-13:

0.3.1 (2021-03-04)
------------------

- Install with conda
- Include shell script demonstrating CLI

.. _section-13:
.. _section-14:

0.3 (2021-02-25)
----------------

- Update README with overview and install instructions
- Write documentation

.. _section-14:
.. _section-15:

0.2 (2021-02-24)
----------------
Expand All @@ -139,15 +146,15 @@ Changes for bmi-topography
- Include sample config file and Jupyter Notebook to demo BMI
- Add CI with GitHub Actions

.. _section-15:
.. _section-16:

0.1.1 (2021-02-22)
------------------

- Add Makefile rule to test upload to TestPyPI
- Test upload to TestPyPI

.. _section-16:
.. _section-17:

0.1 (2021-02-22)
----------------
Expand Down
12 changes: 6 additions & 6 deletions docs/source/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ through
`rioxarray <https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html>`__.

The *bmi-topography* API is wrapped with a `Basic Model
Interface <https://bmi.readthedocs.io>`__ (BMI), which provides a
standard set of functions for coupling with data or models that also
expose a BMI. More information on the BMI can found in its
`documentation <https://bmi.readthedocs.io>`__.
Interface <https://bmi.csdms.io>`__ (BMI), which provides a standard set
of functions for coupling with data or models that also expose a BMI.
More information on the BMI can found in its
`documentation <https://bmi.csdms.io>`__.

Installation
------------
Expand Down Expand Up @@ -214,7 +214,7 @@ script, and shell script included in the
directory of the *bmi-topography* repository.
User and developer documentation for *bmi-topography* is available at
https://bmi-topography.readthedocs.io.
https://bmi-topography.csdms.io.
.. raw:: html
Expand All @@ -231,4 +231,4 @@ https://bmi-topography.readthedocs.io.
.. |Coverage Status| image:: https://coveralls.io/repos/github/csdms/bmi-topography/badge.svg?branch=main
:target: https://coveralls.io/github/csdms/bmi-topography?branch=main
.. |Documentation Status| image:: https://readthedocs.org/projects/bmi-topography/badge/?version=latest
:target: https://bmi-topography.readthedocs.io/en/latest/?badge=latest
:target: https://bmi-topography.csdms.io/en/latest/?badge=latest
5 changes: 2 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import datetime

import pkg_resources
from importlib.metadata import version as package_version

# The master toctree document.
master_doc = "index"
Expand All @@ -25,7 +24,7 @@

project = "bmi-topography"
author = "Community Surface Dynamics Modeling System"
version = pkg_resources.get_distribution("bmi_topography").version
version = package_version("bmi_topography")
release = version
this_year = datetime.date.today().year
copyright = f"{this_year}, {author}"
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test(session: nox.Session) -> None:
session.run("coverage", "report", "--ignore-errors", "--show-missing")


@nox.session(name="test-bmi", python=PYTHON_VERSIONS, venv_backend="conda")
@nox.session(name="test-bmi", python=PYTHON_VERSIONS)
def test_bmi(session: nox.Session) -> None:
"""Test the Basic Model Interface."""
session.install("bmi-tester>=0.5.9")
Expand Down
13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "bmi-topography"
description = "Fetch and cache land elevation data from OpenTopography"
Expand Down Expand Up @@ -30,6 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
Expand All @@ -50,9 +47,10 @@ dynamic = ["readme", "version"]

[project.urls]
Homepage = "https://csdms.colorado.edu"
Documentation = "https://bmi-topography.readthedocs.io/"
Documentation = "https://bmi-topography.csdms.io/"
Repository = "https://github.com/csdms/bmi-topography"
Changelog = "https://github.com/csdms/bmi-topography/blob/main/CHANGES.md"
Forum = "https://forum.csdms.io"

[project.optional-dependencies]
dev = [
Expand All @@ -74,6 +72,7 @@ docs = [
"sphinx",
"recommonmark",
"pandoc",
"importlib-metadata",
]
examples = [
"matplotlib",
Expand All @@ -82,6 +81,10 @@ examples = [
[project.scripts]
bmi-topography = "bmi_topography.cli:main"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
readme = {file = ["README.md", "CREDITS.md", "LICENSE.md"], content-type = "text/markdown"}
version = {attr = "bmi_topography._version.__version__"}
Expand Down

0 comments on commit ee01d48

Please sign in to comment.