Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ditch setup.cfg and use only pyproject.toml #438

Merged
merged 6 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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,
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,
# Add some directives used in our docstrings
rst-directives =
pyvista-plot,
# 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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Collect requirements
run: |
echo "Install Dependente to capture dependencies:"
mamba install dependente==0.1.0 -c conda-forge
mamba install dependente==0.3.0 -c conda-forge
echo ""
echo "Capturing run-time dependencies:"
dependente --source install > requirements-full.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ doc/sample_data
MANIFEST
dask-worker-space
.coverage.*
harmonica/_version_generated.py
harmonica/_version.py
3 changes: 3 additions & 0 deletions harmonica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
from ._utils import magnetic_angles_to_vec, magnetic_vec_to_angles
from ._version import __version__

# Append a leading "v" to the generated version by setuptools_scm
__version__ = f"v{__version__}"


def test(doctest=True, verbose=True, coverage=False, figures=False):
"""
Expand Down
14 changes: 0 additions & 14 deletions harmonica/_version.py

This file was deleted.

54 changes: 48 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,55 @@
# Specify that we use setuptools and setuptools_scm (to generate the version
# string). Actual configuration is in setup.py and setup.cfg.
[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"

[project]
name = "harmonica"
description = "Forward modeling, inversion, and processing gravity and magnetic data"
dynamic = ["version"]
authors = [
{ name="The Harmonica Developers", email="[email protected]" },
]
maintainers = [
{name = "Santiago Soler", email = "[email protected]"}
]
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE.txt"}
keywords = ["geoscience", "geophysics"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"numpy >= 1.21",
"pandas >= 1.1",
"scipy >= 1.5",
"scikit-learn >= 0.24",
"numba >= 0.52",
"xarray >= 0.16",
"verde >= 1.7",
"xrft >= 1.0",
"choclo >= 0.1",
]

[project.urls]
"Homepage" = "https://www.fatiando.org/harmonica"
"Documentation" = "https://www.fatiando.org/harmonica"
"Repository" = "https:/fatiando/harmonica.git"
"Changelog" = "https://www.fatiando.org/harmonica/latest/changes.html"
"Bug Tracker" = "https:/fatiando/harmonica/issues"
"Source Code" = "https:/fatiando/harmonica"
"Release Notes" = "https:/fatiando/harmonica/releases"

[project.optional-dependencies]
visualizations = ["pyvista>=0.27", "vtk>=9"]
numba_progress = ["numba_progress"]

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "node-and-date"
write_to = "harmonica/_version_generated.py"
version_scheme = "post-release"
local_scheme = "node-and-date"
version_file = "harmonica/_version.py"

[tool.pytest.ini_options]
doctest_optionflags = "NUMBER"
Expand Down
104 changes: 0 additions & 104 deletions setup.cfg

This file was deleted.

15 changes: 0 additions & 15 deletions setup.py

This file was deleted.

Loading