From f404515ec47dd80cc3612414baeafe7809826731 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Thu, 12 May 2022 20:53:20 +1200 Subject: [PATCH 01/10] maint: move static metadata to setup.cfg; update requirements --- MANIFEST.in | 1 - Makefile | 7 +++---- README.rst | 2 +- pyproject.toml | 4 ++-- requirements.txt | 1 + setup.cfg | 41 +++++++++++++++++++++++++++++++++++++++++ setup.py | 43 ------------------------------------------- 7 files changed, 48 insertions(+), 51 deletions(-) delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in index 2bbde2d..a7b5a51 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ -include LICENSE include *.rst include requirements*.txt include Makefile diff --git a/Makefile b/Makefile index d7a48b7..9e9154c 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ lint: ## check style with flake8 pretty: find bmi_tester -name '*.py' | xargs isort - black setup.py tests bmi_tester + black tests bmi_tester test: ## run tests quickly with the default Python pytest @@ -83,9 +83,8 @@ release: dist ## package and upload a release twine upload dist/* dist: clean ## builds source and wheel package - python setup.py sdist - python setup.py bdist_wheel + python -m build ls -l dist install: clean ## install the package to the active Python's site-packages - python setup.py develop + pip install -e . diff --git a/README.rst b/README.rst index 41bdca1..1aeba2f 100644 --- a/README.rst +++ b/README.rst @@ -58,7 +58,7 @@ From Source +++++++++++ After downloading the *bmi-tester* source code, run the following from -the project's top-level folder (the one that contains *setup.py*) to +the project's top-level folder (the one that contains *pyproject.toml*) to install into the current environment, .. code:: bash diff --git a/pyproject.toml b/pyproject.toml index 91c2e97..2d3e0b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [build-system] -requires = ["cython", "numpy", "setuptools", "wheel"] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" [tool.pytest.ini_options] minversion = "6.0.0rc1" testpaths = ["tests"] norecursedirs = [".*", "*.egg*", "build", "dist"] addopts = """ - --ignore setup.py --ignore bmi_tester/bootstrap --ignore bmi_tester/tests --tb native diff --git a/requirements.txt b/requirements.txt index 3762ea3..b038a0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ click +gimli.units model_metadata numpy pytest diff --git a/setup.cfg b/setup.cfg index 84dedf4..8508131 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,44 @@ +[metadata] +name = bmi-tester +version = 0.5.6.dev0 +description = Test Python BMI bindings +keywords = bmi +long_description = file: README.rst, CREDITS.rst, CHANGES.rst +long_description_content_type = text/x-rst +author = Eric Hutton +author_email = eric.hutton@colorado.edu +license = MIT +license_files = LICENSE.rst +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Science/Research + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Physics +url = https://github.com/csdms/bmi-tester + +[options] +include_package_data = True +packages = find: +install_requires = + click + gimli.units + model_metadata + numpy + pytest + pytest-dependency + standard_names + +[options.entry_points] +console_scripts = + bmi-test = bmi_tester.bmipytest:main +bmi.plugins = + bmi_test = bmi_tester.bmipytest:configure_parser_test + [zest.releaser] tag-format = v{version} diff --git a/setup.py b/setup.py deleted file mode 100644 index 479ec81..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -#! /usr/bin/env python -from setuptools import find_packages, setup - - -def read(filename): - with open(filename, "r", encoding="utf-8") as fp: - return fp.read() - - -long_description = u"\n\n".join( - [read("README.rst"), read("CREDITS.rst"), read("CHANGES.rst")] -) - - -setup( - name="bmi-tester", - version="0.5.6.dev0", - author="Eric Hutton", - author_email="eric.hutton@colorado.edu", - url="https://github.com/csdms/bmi-tester", - description="Test Python BMI bindings.", - long_description=long_description, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Cython", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering :: Physics", - ], - keywords=["bmi"], - install_requires=open("requirements.txt", "r").read().splitlines(), - packages=find_packages(), - include_package_data=True, - entry_points={ - "console_scripts": ["bmi-test=bmi_tester.bmipytest:main"], - "bmi.plugins": ["bmi_test=bmi_tester.bmipytest:configure_parser_test"], - }, -) From 6a3beb4be1a9eff2ccb4a8fe6b5723c6265cc295 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 17:06:58 -0700 Subject: [PATCH 02/10] Bump checkout and setup-python actions --- .github/workflows/black.yml | 4 ++-- .github/workflows/docs.yml | 2 +- .github/workflows/flake8.yml | 4 ++-- .github/workflows/test.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 04351f7..1b42ee6 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -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/docs.yml b/.github/workflows/docs.yml index 9e38a8e..8e1a28d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,7 +34,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 with: diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index e52096f..b518677 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d498abc..76e1586 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: python-version: [3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 with: From dc58f7cb2f39a3e64f4eecb97ad38467796dffcb Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 17:09:25 -0700 Subject: [PATCH 03/10] Bump python versions for testing --- .github/workflows/flake8.yml | 3 +-- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index b518677..45e68b1 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -15,10 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.11" - name: Lint run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 76e1586..b0c73ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 From d645657c97894c043f047d9783094f896fcf125a Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 17:10:22 -0700 Subject: [PATCH 04/10] gimli.units included in requirements --- .github/workflows/test.yml | 1 - environment.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0c73ee..63c6d82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,6 @@ jobs: - name: Install requirements run: | mamba install --file=requirements.txt --file=requirements-testing.txt - mamba install gimli.units mamba list - name: Build and install package diff --git a/environment.yml b/environment.yml index b67396e..0b81182 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,6 @@ name: bmi-tester channels: - conda-forge dependencies: -- gimli.units - pip - pip: - -r file:requirements.txt From 50bfc3844edd6d10abb926a715bdd54878cb005d Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 17:19:03 -0700 Subject: [PATCH 05/10] Make pretty --- bmi_tester/tests/conftest.py | 1 - docs/conf.py | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bmi_tester/tests/conftest.py b/bmi_tester/tests/conftest.py index 895cb71..98979dd 100644 --- a/bmi_tester/tests/conftest.py +++ b/bmi_tester/tests/conftest.py @@ -159,7 +159,6 @@ def var_name(request): def pytest_generate_tests(metafunc): - if "gid" in metafunc.fixturenames: metafunc.parametrize("gid", params["gid"]) # elif "var_name" in metafunc.fixturenames: diff --git a/docs/conf.py b/docs/conf.py index 668c9a0..60e5df3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,9 +55,9 @@ master_doc = "index" # General information about the project. -project = u"bmi_tester" -copyright = u"2017, Eric Hutton" -author = u"Eric Hutton" +project = "bmi_tester" +copyright = "2017, Eric Hutton" +author = "Eric Hutton" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -228,7 +228,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, "bmi_tester.tex", u"bmi\\_tester Documentation", u"Author", "manual"), + (master_doc, "bmi_tester.tex", "bmi\\_tester Documentation", "Author", "manual"), ] # The name of an image file (relative to this directory) to place at the top of @@ -256,7 +256,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "bmi_tester", u"bmi_tester Documentation", [author], 1)] +man_pages = [(master_doc, "bmi_tester", "bmi_tester Documentation", [author], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -271,7 +271,7 @@ ( master_doc, "bmi_tester", - u"bmi_tester Documentation", + "bmi_tester Documentation", author, "bmi_tester", "One line description of project.", From f5327e4d547452d8ebdafd759e537c0ebeffebd8 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 17:28:11 -0700 Subject: [PATCH 06/10] Set python version for building docs --- .github/workflows/docs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8e1a28d..b132d55 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -39,7 +39,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true - python-version: ${{ matrix.python-version }} + python-version: "3.11" mamba-version: "*" channels: conda-forge,defaults channel-priority: true @@ -47,7 +47,6 @@ jobs: - name: Install requirements run: | mamba install --file=requirements.txt --file=requirements-docs.txt - mamba install gimli.units mamba info mamba list From 684e136452b8e5ee1f676f5730a761dec1aa70bc Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 17:30:59 -0700 Subject: [PATCH 07/10] Fix invalid format --- .github/workflows/flake8.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 45e68b1..22ad273 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 + - uses: actions/setup-python@v4 with: python-version: "3.11" From 13b2592fc9aff7a565d565a189416684996c236e Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 19:11:46 -0700 Subject: [PATCH 08/10] Move project metadata from setup.cfg to pyproject.toml --- pyproject.toml | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 47 ++--------------------------- 2 files changed, 84 insertions(+), 44 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2d3e0b2..c5442a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,84 @@ requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" +[project] +name = "bmi-tester" +description = "Test Python BMI bindings" +version = "0.5.6.dev0" +authors = [ + {email = "eric.hutton@colorado.edu"}, + {name = "Eric Hutton"}, +] +maintainers = [ + {email = "eric.hutton@colorado.edu"}, + {name = "Eric Hutton"}, + {email = "mark.piper@colorado.edu"}, + {name = "Mark Piper"} +] +keywords = [ + "bmi", + "csdms", + "model", + "python", +] +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Physics", +] +requires-python = ">=3.9" +dependencies = [ + "click", + "gimli.units", + "model_metadata", + "numpy", + "pytest", + "pytest-dependency", + "standard_names", +] +dynamic = ["readme"] + +[project.optional-dependencies] +dev = [ + "black", + "flake8", +] +testing = [ + "coveralls", + "pytest>=3.6", + "pytest-cov", +] +docs = [ + "sphinx>=1.5.1", +] +build = [ + "build", + "twine", + "zest.releaser" +] + +[project.urls] +homepage = "https://csdms.colorado.edu" +documentation = "https://csdms.colorado.edu" +repository = "https://github.com/csdms/bmi-tester" +changelog = "https://github.com/csdms/bmi-tester/blob/master/CHANGES.rst" + +[project.scripts] +bmi-test = "bmi_tester.bmipytest:main" + +[project.entry-points."bmi.plugins"] +bmi_test = "bmi_tester.bmipytest:configure_parser_test" + +[tool.setuptools.dynamic] +readme = {file = ["README.rst", "CREDITS.rst", "CHANGES.rst"], content-type = "text/x-rst"} + [tool.pytest.ini_options] minversion = "6.0.0rc1" testpaths = ["tests"] @@ -27,3 +105,6 @@ include_trailing_comma = true force_grid_wrap = 0 combine_as_imports = true line_length = 88 + +[tool.zest-releaser] +tag-format = "v{version}" diff --git a/setup.cfg b/setup.cfg index 8508131..c44ff5d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,47 +1,3 @@ -[metadata] -name = bmi-tester -version = 0.5.6.dev0 -description = Test Python BMI bindings -keywords = bmi -long_description = file: README.rst, CREDITS.rst, CHANGES.rst -long_description_content_type = text/x-rst -author = Eric Hutton -author_email = eric.hutton@colorado.edu -license = MIT -license_files = LICENSE.rst -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: Implementation :: CPython - Topic :: Scientific/Engineering :: Physics -url = https://github.com/csdms/bmi-tester - -[options] -include_package_data = True -packages = find: -install_requires = - click - gimli.units - model_metadata - numpy - pytest - pytest-dependency - standard_names - -[options.entry_points] -console_scripts = - bmi-test = bmi_tester.bmipytest:main -bmi.plugins = - bmi_test = bmi_tester.bmipytest:configure_parser_test - -[zest.releaser] -tag-format = v{version} - [flake8] exclude = docs ignore = @@ -49,3 +5,6 @@ ignore = E501 W503 max-line-length = 88 + +[coverage:run] +relative_files = True From 92bb30b578109b730f97a6c981f4e9b8f18bff2c Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 22:04:29 -0700 Subject: [PATCH 09/10] Remove unused .gitattributes file --- .gitattributes | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 08da846..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -bmi_tester/_version.py export-subst From ff0e3d1c26887dea5727fea1d097de96617f5f5c Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 6 Dec 2023 22:04:54 -0700 Subject: [PATCH 10/10] Update rtfd configuration --- .readthedocs.yaml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5193948..6ef1e3c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,22 +1,17 @@ version: 2 +build: + os: ubuntu-22.04 + tools: + python: "3.11" + sphinx: builder: html configuration: docs/conf.py fail_on_warning: false -formats: - - htmlzip - -conda: - environment: environment.yml - python: - version: 3.8 install: + - requirements: requirements-docs.txt - method: pip path: . - system_packages: false - -build: - image: latest