From 3a12c9a7ed3f5d21d61259e9d437b90113b5d456 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 21 Mar 2024 11:56:51 -0300 Subject: [PATCH] Move package configuration to pyproject.toml With the more recent setuptools, we can now have all of the package configuration in the pyproject.toml file and remove the old setup.cfg. Update Dependente in the Actions so it can read the dependencies from the toml file. --- .coveragerc | 2 +- .flake8 | 41 +++++++++++++++++++ .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- pyproject.toml | 44 +++++++++++++++++++- setup.cfg | 82 -------------------------------------- 6 files changed, 86 insertions(+), 87 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.coveragerc b/.coveragerc index a2deea8f..2debec87 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,5 +2,5 @@ branch = True omit = */tests/* - */_version.py + */_version_generated.py **/__init__.py diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..0d43ba7b --- /dev/null +++ b/.flake8 @@ -0,0 +1,41 @@ +# Configure flake8 + +[flake8] +max-line-length = 88 +max-doc-length = 79 +ignore = + # Too many leading '#' for block comment + E266, + # Line too long (82 > 79 characters) + E501, + # Do not use variables named 'I', 'O', or 'l' + E741, + # Line break before binary operator (conflicts with black) + W503, + # Ignore spaces before a colon (Black handles it) + E203, +exclude = + .git, + __pycache__, + .ipynb_checkpoints, + doc/_build, +per-file-ignores = + # disable unused-imports errors on __init__.py + __init__.py: F401 + +# Configure flake8-rst-docstrings +# ------------------------------- +# Add some roles used in our docstrings +rst-roles = + class, + func, + mod, + meth, + ref, +# Ignore "Unknown target name" raised on citations +extend-ignore = RST306 + +# Configure flake8-functions +# -------------------------- +# Allow a max of 10 arguments per function +max-parameters-amount = 10 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5f5e2052..d82dc876 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -66,7 +66,7 @@ jobs: - name: Collect requirements run: | echo "Install Dependente to capture dependencies:" - python -m pip install dependente==0.1.0 + python -m pip install dependente==0.3.0 echo "" echo "Capturing run-time dependencies:" dependente --source install > requirements-full.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 931bea79..17efe862 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,7 +84,7 @@ jobs: - name: Collect requirements run: | echo "Install Dependente to capture dependencies:" - python -m pip install dependente==0.1.0 + python -m pip install dependente==0.3.0 echo "" echo "Capturing run-time dependencies:" if [[ "${{ matrix.dependencies }}" == "oldest" ]]; then diff --git a/pyproject.toml b/pyproject.toml index 05b9e4a8..5c31b0e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,45 @@ -# Specify that we use setuptools and setuptools_scm (to generate the version -# string). Actual configuration is in setup.cfg. +[project] +name = "boule" +description = "Reference ellipsoids for geodesy and geophysics" +dynamic = ["version"] +authors = [ + {name="The Boule Developers", email="fatiandoaterra@protonmail.com"}, +] +maintainers = [ + {name = "Leonardo Uieda", email = "leo@uieda.com"} +] +readme = "README.md" +license = {text = "BSD 3-Clause"} +keywords = ["geophysics", "geodesy", "gravity", "ellipsoid"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries", + "Programming Language :: Python", + "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", +] +requires-python = ">=3.7" +dependencies = [ + "numpy>=1.19", + "attrs>=19.3.0", +] + +[project.urls] +"Documentation" = "https://www.fatiando.org/boule" +"Changelog" = "https://www.fatiando.org/boule/latest/changes.html" +"Bug Tracker" = "https://github.com/fatiando/boule/issues" +"Source Code" = "https://github.com/fatiando/boule" + [build-system] requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index bc610650..00000000 --- a/setup.cfg +++ /dev/null @@ -1,82 +0,0 @@ -[metadata] -name = boule -fullname = Boule -description = Reference ellipsoids for geodesy and geophysics -long_description = file: README.md -long_description_content_type = text/markdown -author = The Boule Developers -author_email = fatiandoaterra@protonmail.com -maintainer = Leonardo Uieda -maintainer_email = leouieda@gmail.com -license = BSD 3-Clause License -license_files = LICENSE.txt -platform = any -keywords = geophysics, geodesy, data -classifiers = - Development Status :: 3 - Alpha - Intended Audience :: Science/Research - Intended Audience :: Developers - Intended Audience :: Education - License :: OSI Approved :: BSD License - Natural Language :: English - Operating System :: OS Independent - Topic :: Scientific/Engineering - Topic :: Software Development :: Libraries - Programming Language :: Python :: 3 :: Only - 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 -url = https://github.com/fatiando/boule -project_urls = - Documentation = https://www.fatiando.org/boule - Release Notes = https://github.com/fatiando/boule/releases - Bug Tracker = https://github.com/fatiando/boule/issues - Source Code = https://github.com/fatiando/boule - -[options] -zip_safe = True -packages = find: -python_requires = >=3.7 -install_requires = - numpy>=1.19 - attrs>=19.3.0 - -[flake8] -max-line-length = 88 -max-doc-length = 79 -ignore = - # Too many leading '#' for block comment - E266, - # Line too long (82 > 79 characters) - E501, - # Do not use variables named 'I', 'O', or 'l' - E741, - # Line break before binary operator (conflicts with black) - W503, -exclude = - .git, - __pycache__, - .ipynb_checkpoints, - doc/_build, -per-file-ignores = - # disable unused-imports errors on __init__.py - __init__.py: F401 - -# Configure flake8-rst-docstrings -# ------------------------------- -# Add some roles used in our docstrings -rst-roles = - class, - func, - mod, - meth, - ref, -# Ignore "Unknown target name" raised on citations -extend-ignore = RST306 - -# Configure flake8-functions -# -------------------------- -# Allow a max of 10 arguments per function -max-parameters-amount = 10