diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 02b0915..0000000 --- a/.flake8 +++ /dev/null @@ -1,28 +0,0 @@ -[flake8] -# References: -# https://flake8.readthedocs.io/en/latest/user/configuration.html -# https://flake8.readthedocs.io/en/latest/user/error-codes.html -# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes - -ignore = - # E203: whitespace before ':' - E203, - # E226: missing whitespace around arithmetic operator - E226, - # E231: missing whitespace after ',', ';', or ':' - E231, - # E402: module level imports on one line - E402, - # E501: line too long - E501, - # W503: line break before binary operator - W503, - # W504: line break after binary operator - W504, -exclude = - # - # ignore the following directories - # - .eggs, - build, - sphinxext, diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index aa0b4b6..a295947 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -27,4 +27,6 @@ jobs: .tox - name: Run tox - run: pipx run 'tox<4' + run: | + pipx run 'tox<4' + tox -e py311-test diff --git a/MANIFEST.in b/MANIFEST.in index 9cfe63a..7ab0267 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,6 @@ include *.yaml include *.yml include *.cff include .coveragerc -include .flake8 include .git-blame-ignore-revs include tox.ini recursive-include requirements *.yml @@ -15,3 +14,7 @@ recursive-include docs *.png recursive-include docs *.py recursive-include docs *.rst recursive-include docs Makefile +recursive-include tephi *.json +recursive-include tephi *.npz +recursive-include tephi *.txt + diff --git a/pyproject.toml b/pyproject.toml index 84e8bb6..2ba6db6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,14 @@ # See https://github.com/SciTools/.github/wiki/Linting # for SciTools linting guidelines +[build-system] +# Defined by PEP 518 +requires = ["setuptools>=45"] +# Defined by PEP 517 +build-backend = "setuptools.build_meta" [tool.black] line-length = 79 -target-version = ["py37", "py38", "py39", "py310"] +target-version = ["py38", "py39", "py310", "py311"] include = '\.pyi?$' [project] @@ -26,10 +31,8 @@ classifiers = [ ] description = "Tephigram plotting in Python" dynamic = [ - "dependencies", - "optional-dependencies", - "readme", "version", + "readme", ] keywords = [ "tephigram", @@ -40,18 +43,37 @@ keywords = [ license = {text = "BSD-3-Clause"} name = "tephi" requires-python = ">=3.8" +dependencies = ["matplotlib", "numpy", "scipy"] [project.urls] Code = "https://github.com/SciTools/tephi" -Issues = "issues = https://github.com/SciTools/tephi/issues" +Issues = "https://github.com/SciTools/tephi/issues" Binder= "https://mybinder.org/v2/gh/SciTools/tephi/main?filepath=index.ipynb" Docs = "https://tephi.readthedocs.io/en/latest/" -[build-system] -# Defined by PEP 518 -requires = ["setuptools>=45"] -# Defined by PEP 517 -build-backend = "setuptools.build_meta" +[tool.setuptools.package-data] +tephi = [ + "etc/test_data/*.txt", + "tests/results/*.npz", + "tests/results/imagerepo.json" +] + +[tool.setuptools.dynamic] +version = { attr = "tephi.__version__"} +readme = {file = ["README.md"], content-type = "text/markdown"} + +[tool.setuptools.packages.find] +include = ["tephi*"] + +[tool.pytest.ini_options] +minversion = "6.0" +addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] +xfail_strict = true +#filterwarnings = ["error"] +log_cli_level = "info" +testpaths = [ + "tephi/tests", +] [tool.repo-review] # These are a list of the currently failing tests: @@ -64,9 +86,6 @@ ignore = [ # TODO: exceptions that still need investigating are below. Might be fixable, or might become permanent (above): - # https://learn.scientific-python.org/development/guides/pytest/#PP301 - "PP301", # Has pytest in pyproject - # https://learn.scientific-python.org/development/guides/gha-basic/#GH212 "GH212", # Require GHA update grouping @@ -77,7 +96,6 @@ ignore = [ "PC901", # Custom pre-commit CI message ] - [tool.mypy] strict = false ignore_missing_imports = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 65cf4f9..0000000 --- a/setup.cfg +++ /dev/null @@ -1,70 +0,0 @@ -[flake8] -exclude = - .git, - docs, - tephi/tests/__init__.py - .eggs - -[tool:pytest] -testpaths = - tephi/ -markers = - graphical: mark a test as a graphical test -addopts = - -ra - -v - --cov-config=.coveragerc - --cov=tephi - --cov-report=term-missing - --doctest-modules -doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS NUMBER - -[metadata] -name = tephi -version = attr: tephi.__version__ -author = UK Met Office -author_email = scitools-iris-dev@googlegroups.com -url = https://github.com/SciTools/tephi -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Science/Research - Operating System :: OS Independent - License :: OSI Approved :: BSD License - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Topic :: Scientific/Engineering :: Atmospheric Science - Topic :: Scientific/Engineering :: Visualization -license_files = LICENSE -description = Tephigram plotting in Python -long_description = file: README.md -long_description_content_type = text/markdown -project_urls = - code = https://github.com/SciTools/tephi - issues = https://github.com/SciTools/tephi/issues - binder = https://mybinder.org/v2/gh/SciTools/tephi/main?filepath=index.ipynb - documentation = https://tephi.readthedocs.io/en/latest/ -keywords = - tephigram - radiosonde - meteorology - visualization - -[options] -packages = find: -setup_requires = - setuptools>=40.8.0 - wheel -install_requires = - matplotlib - numpy - scipy -python_requires = >=3.8 - -[options.package_data] -tephi = - etc/test_data/*.txt - tests/results/*.npz - tests/results/imagerepo.json diff --git a/setup.py b/setup.py deleted file mode 100644 index 093148b..0000000 --- a/setup.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -"""A file to be used for installing or building the package.""" -# Copyright Tephi contributors -# -# This file is part of Tephi and is released under the BSD license. -# See LICENSE in the root of the repository for full licensing details. - -from setuptools import setup - -if __name__ == "__main__": - setup() diff --git a/tox.ini b/tox.ini index 7f7b389..a74c467 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,9 @@ [tox] requires = tox-conda -minversion = 3.15 -base_python = py311 -envlist=py{38,39,310,311} +isolated_build=True -[testenv] +[testenv:py{38,39,310,311}-test] description = invoke pytest to run automated tests deps = pytest @@ -28,5 +26,5 @@ commands = sphinx-apidoc -o "{env:DOCSDIR}/api" tephi tephi/tests sphinx-build -W --keep-going -b html -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/html" {posargs} # when running the doctests, also check that any snippets in the - # docs are representative of the module output + # docs are representative Sof the module output doctests: sphinx-build -b doctest -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/doctest" {posargs}