diff --git a/.github/workflows/black.yml b/.github/workflows/format.yml similarity index 85% rename from .github/workflows/black.yml rename to .github/workflows/format.yml index 0a161f5..2d7a6b9 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/format.yml @@ -1,4 +1,4 @@ -name: Black +name: Format on: [push, pull_request] @@ -14,8 +14,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 - uses: psf/black@stable with: args: ". --check" diff --git a/.github/workflows/flake8.yml b/.github/workflows/lint.yml similarity index 69% rename from .github/workflows/flake8.yml rename to .github/workflows/lint.yml index df6879f..cd1822f 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Flake8 +name: Lint on: [push, pull_request] @@ -14,13 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 - name: Lint run: | - pip install flake8 - make lint + pip install ruff + ruff check . diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/test.yml similarity index 69% rename from .github/workflows/build-test-ci.yml rename to .github/workflows/test.yml index 4b2e7e4..f6df638 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Build/Test CI +name: Test on: [push, pull_request] @@ -20,17 +20,16 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: - auto-update-conda: true + miniforge-variant: Mambaforge + miniforge-version: latest python-version: ${{ matrix.python-version }} - channels: conda-forge - channel-priority: true - name: Show conda installation info run: | @@ -39,21 +38,16 @@ jobs: - name: Install requirements run: | - conda install mamba - mamba install --file=requirements.txt - mamba list + mamba install --file=requirements.txt --file=requirements-testing.txt - name: Build and install package run: pip install -e . - - name: Install testing dependencies - run: mamba install --file=requirements-testing.txt - - name: Test run: | pytest --cov=heat --cov-report=xml:./coverage.xml -vvv bmi-test heat:BmiHeat --config-file=./examples/heat.yaml --root-dir=./examples -vvv - name: Coveralls - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' - uses: AndreMiras/coveralls-python-action@v20201129 + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' + uses: AndreMiras/coveralls-python-action@develop diff --git a/CHANGES.rst b/CHANGES.rst index e1b2eff..80bc279 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,12 @@ Changelog for bmi-example-python 2.1.2 (unreleased) ------------------ -- Nothing changed yet. +- Build and test with Python 3.12 (#29) +- Use random subpackage from numpy instead of scipy (#26) +- Add example notebooks (#25) +- Move static project metadata to pyproject.toml (#23) +- Bundle maintenance tasks (#22) +- Use declarative setuptools configuration setup.cfg (#21) 2.1.1 (2021-08-26) diff --git a/Makefile b/Makefile index 74e6930..1510d24 100644 --- a/Makefile +++ b/Makefile @@ -51,8 +51,8 @@ clean-test: ## remove test and coverage artifacts rm -fr htmlcov/ rm -fr .pytest_cache -lint: ## check style with flake8 - flake8 heat tests +lint: ## check style with ruff + ruff check . --fix pretty: find heat -name '*.py' | xargs isort diff --git a/README.rst b/README.rst index 8466379..4c1425e 100644 --- a/README.rst +++ b/README.rst @@ -2,14 +2,17 @@ :target: https://bmi.readthedocs.io/ :alt: Basic Model Interface -.. image:: https://github.com/csdms/bmi-example-python/workflows/Build/Test%20CI/badge.svg - :target: https://github.com/csdms/bmi-example-python/actions?query=workflow%3A%22Build%2FTest+CI%22 +.. image:: https://github.com/csdms/bmi-example-python/actions/workflows/test.yml/badge.svg + :target: https://github.com/csdms/bmi-example-python/actions/workflows/test.yml + :alt: CI status .. image:: https://coveralls.io/repos/csdms/bmi-example-python/badge.png?branch=master :target: https://coveralls.io/r/csdms/bmi-example-python?branch=master + :alt: Coverage status .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/csdms/bmi + :alt: Black bmi-example-python ================== @@ -66,5 +69,5 @@ To run the tests, .. _Python bindings: https://github.com/csdms/bmi-python -.. _Basic Model Interface: https://bmi-spec.readthedocs.io +.. _Basic Model Interface: https://bmi.readthedocs.io .. _README: https://github.com/csdms/bmi-python/blob/master/README.rst diff --git a/pyproject.toml b/pyproject.toml index 4aa2941..fd4dac2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,15 +7,16 @@ name = "bmi-heat" description = "BMI Python example" authors = [ {email = "eric.hutton@colorado.edu"}, - {name = "The CSDMS team"} + {name = "Eric Hutton"} ] maintainers = [ - {email = "eric.hutton@colorado.edu"}, - {name = "The CSDMS team"} + {name = "Mark Piper", email = "mark.piper@colorado.edu"}, + {name = "Eric Hutton", email = "eric.hutton@colorado.edu"}, ] keywords = [ "bmi", "component modeling", + "csdms", "earth science", ] license = {file = "LICENSE"} @@ -25,14 +26,14 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Physics", ] -requires-python = ">=3.7" +requires-python = ">=3.9" dependencies = [ "numpy", "scipy", @@ -41,20 +42,20 @@ dependencies = [ ] dynamic = ["readme", "version"] - [project.urls] -homepage = "https://github.com/csdms/bmi-example-python" -documentation = "https://github.com/csdms/bmi-example-python#readme" -repository = "https://github.com/csdms/bmi-example-python" -changelog = "https://github.com/csdms/bmi-example-python/blob/master/CHANGES.rst" +Homepage = "https://csdms.colorado.edu" +Documentation = "https://bmi.readthedocs.io" +Repository = "https://github.com/csdms/bmi-example-python" +Changelog = "https://github.com/csdms/bmi-example-python/blob/master/CHANGES.rst" [project.optional-dependencies] testing = [ "coveralls", - "flake8", "pytest", "pytest-cov", - "six", + "black", + "isort", + "ruff", "bmi-tester", ] @@ -72,7 +73,7 @@ norecursedirs = [".*", "*.egg*", "build", "dist"] addopts = """ --ignore setup.py --tb native - --strict + --strict-markers --durations 16 --doctest-modules -vvv @@ -89,3 +90,17 @@ include_trailing_comma = true force_grid_wrap = 0 combine_as_imports = true line_length = 88 + +[tool.ruff] +line-length = 88 +ignore = [ + "E203", + "E501", +] + +[tool.coverage.run] +relative_files = true + +[tool.zest-releaser] +tag-format = "v{version}" +python-file-with-version = "heat/_version.py" diff --git a/requirements-testing.txt b/requirements-testing.txt index 16911dd..fc11c86 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -1,6 +1,7 @@ coveralls -flake8 pytest pytest-cov -six +black +isort +ruff bmi-tester diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 5cc1af3..0000000 --- a/setup.cfg +++ /dev/null @@ -1,16 +0,0 @@ -[coverage:run] -relative_files = True - -[flake8] -ignore = - E203 - E501 - W503 -max-line-length = 88 - -[pylint] -disable = missing-docstring,line-too-long - -[zest.releaser] -tag-format = v{version} -python-file-with-version = heat/_version.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff --git a/tests/test_irf.py b/tests/test_irf.py index 095c8e3..bfe2dc3 100644 --- a/tests/test_irf.py +++ b/tests/test_irf.py @@ -4,7 +4,6 @@ import numpy as np import yaml from numpy.testing import assert_almost_equal, assert_array_equal, assert_array_less -from six.moves import range from heat import BmiHeat