From b1ddd2080f48f411cd69d7d27a1c31ccdc661fd8 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 10 Apr 2024 11:35:07 -0700 Subject: [PATCH 1/2] Remplace setup.cfg for pyproject.toml Ditch the `setup.cfg` file and use only `pyproject.toml`. Move flake8 configurations to their own `.flake8` file. --- .flake8 | 38 ++++++++++++++++++++ pyproject.toml | 56 ++++++++++++++++++++++++++++-- setup.cfg | 94 -------------------------------------------------- 3 files changed, 91 insertions(+), 97 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..507cf6886 --- /dev/null +++ b/.flake8 @@ -0,0 +1,38 @@ +# 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, +exclude = + .git, + __pycache__, + .ipynb_checkpoints, +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/pyproject.toml b/pyproject.toml index ffd9f449b..a1b96af1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,57 @@ -# Specify that we use setuptools and setuptools_scm (to generate the version -# string). Actual configuration is in setup.cfg. +[project] +name = "verde" +description = "Processing and gridding spatial data, machine-learning style" +dynamic = ["version"] +authors = [ + {name="The Verde Developers", email="fatiandoaterra@protonmail.com"}, +] +maintainers = [ + {name = "Leonardo Uieda", email = "leouieda@gmail.com"} +] +readme = "README.md" +license = {text = "BSD-3-Clause"} +keywords = ["spatial", "geoscience", "geophysics", "gridding", "interpolation"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "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.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +requires-python = ">=3.9" +dependencies = [ + "numpy>=1.23", + "scipy>=1.8", + "pandas>=1.4", + "xarray>=2022.03", + "scikit-learn>=1.0", + "pooch>=1.2", + "dask>=2022.01.0", +] + +[project.optional-dependencies] +fast = ["numba>=0.55", "pykdtree>=1.3"] + +[tool.setuptools.package-data] +verde.tests = ["data/*", "baseline/*"] +verde.datasets = ["registry.txt"] + +[project.urls] +"Documentation" = "https://www.fatiando.org/verde" +"Release Notes" = "https://github.com/fatiando/verde/releases" +"Bug Tracker" = "https://github.com/fatiando/verde/issues" +"Source Code" = "https://github.com/fatiando/verde" + [build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] +requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=8.0.3"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e47261fbf..000000000 --- a/setup.cfg +++ /dev/null @@ -1,94 +0,0 @@ -[metadata] -name = verde -fullname = Verde -description = Processing and gridding spatial data, machine-learning style -long_description = file: README.md -long_description_content_type = text/markdown -author = The Verde Developers -author_email = fatiandoaterra@protonmail.com -maintainer = "Leonardo Uieda" -maintainer_email = leouieda@gmail.com -license = BSD 3-Clause License -license_file = LICENSE.txt -platform = any -keywords = spatial, geoscience, geophysics, gridding, interpolation -classifiers = - Development Status :: 5 - Production/Stable - 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.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 -url = https://github.com/fatiando/verde -project_urls = - Documentation = https://www.fatiando.org/verde - Release Notes = https://github.com/fatiando/verde/releases - Bug Tracker = https://github.com/fatiando/verde/issues - Source Code = https://github.com/fatiando/verde - -[options] -zip_safe = True -include_package_data = True -packages = find: -python_requires = >=3.9 -install_requires = - numpy>=1.23 - scipy>=1.8 - pandas>=1.4 - xarray>=2022.03 - scikit-learn>=1.0 - pooch>=1.2 - dask>=2022.01.0 - -[options.extras_require] -fast = - numba>=0.55 - pykdtree>=1.3 - -[options.package_data] -verde.tests = data/*, baseline/* -verde.datasets = registry.txt - -[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, -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 From b56b3b260ea291b01f586a62cefeb05267c57f1d Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 10 Apr 2024 14:31:11 -0700 Subject: [PATCH 2/2] Bump dependente to 0.3.0 --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c9ccd304f..4fad053d2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -70,7 +70,7 @@ jobs: - name: Collect requirements run: | echo "Install Dependente to capture dependencies:" - conda install dependente==0.1.0 -c conda-forge + conda install dependente==0.3.0 -c conda-forge echo "" echo "Capturing run-time dependencies:" dependente --source install,extras > requirements-full.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12777440a..beea21c0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,7 +94,7 @@ jobs: - name: Collect requirements run: | echo "Install Dependente to capture dependencies:" - conda install dependente==0.1.0 -c conda-forge + conda install dependente==0.3.0 -c conda-forge echo "" echo "Capturing run-time dependencies:" if [[ "${{ matrix.dependencies }}" == "oldest" ]]; then