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 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..b132d55 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,12 +34,12 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - 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 diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index e52096f..22ad273 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -14,11 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - 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 d498abc..63c6d82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,10 +20,10 @@ 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@v2 + - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 with: @@ -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/.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 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/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.", 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 diff --git a/pyproject.toml b/pyproject.toml index 91c2e97..c5442a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,90 @@ [build-system] -requires = ["cython", "numpy", "setuptools", "wheel"] +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"] norecursedirs = [".*", "*.egg*", "build", "dist"] addopts = """ - --ignore setup.py --ignore bmi_tester/bootstrap --ignore bmi_tester/tests --tb native @@ -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/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..c44ff5d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[zest.releaser] -tag-format = v{version} - [flake8] exclude = docs ignore = @@ -8,3 +5,6 @@ ignore = E501 W503 max-line-length = 88 + +[coverage:run] +relative_files = True 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"], - }, -)