Skip to content

Commit

Permalink
Replace setup.py by pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae committed Oct 18, 2024
1 parent ea4a050 commit 01b5517
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 74 deletions.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install .[docs]
- name: Create docs
shell: bash -l {0}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ jobs:
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install .[all]
- name: Flake8
shell: bash -l {0}
run: flake8 docs/conf.py setup.py resmda/ tests/
run: flake8 docs/conf.py resmda/ tests/

- name: Test with pytest
shell: bash -l {0}
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with Test PyPI.
sed --in-place 's/"root"/"local_scheme":"no-local-version","root"/g' setup.py
sed --in-place 's/version_file/local_scheme = "no-local-version"\nversion_file/g' pyproject.toml
- name: Build source and wheel distributions
run: |
Expand Down
6 changes: 2 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ prune examples
prune .github
exclude MANIFEST.in
exclude Makefile
exclude requirements.txt
exclude requirements-dev.txt
exclude setup.cfg
exclude .gitignore
exclude .coveragerc
exclude .git_archival.txt
exclude .gitattributes
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ help:
@echo ""

install:
python -m pip install --no-build-isolation --no-deps -e .
python -m pip install -e .

dev-install:
python -m pip install -r requirements-dev.txt && python -m pip install --no-build-isolation --no-deps -e .
python -m pip install -e .[all]

.ONESHELL:
pytest:
Expand All @@ -26,7 +26,7 @@ pytest:
coverage html

flake8:
flake8 docs/conf.py setup.py resmda/ tests/ examples/
flake8 docs/conf.py resmda/ tests/ examples/

html:
cd docs && make html
Expand Down
78 changes: 78 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "resmda"
description = "A simple 2D reservoir modeller plus ESMDA"
readme = "README.rst"
requires-python = ">=3.10"
authors = [
{name = "Dieter Werthmüller", email = "[email protected]"},
{name = "Gabriel Serrao Seabra"},
{name = "Femke C. Vossepoel"},
]
dependencies = [
"numpy",
"scipy>=1.10",
"scooby",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
]
dynamic = ["version"]

[project.license]
file = "LICENSE"

[project.urls]
Homepage = "https://tuda-geo.github.io/resmda"
Documentation = "https://tuda-geo.github.io/resmda"
Repository = "https://github.com/tuda-geo/resmda"

[project.optional-dependencies]
docs = [
"pooch",
"ipympl",
"sphinx>=7.3",
"numpydoc",
"ipykernel",
"matplotlib",
"pickleshare",
"sphinx_design",
"sphinx_numfig",
"sphinx_gallery>=0.16",
"sphinx_automodapi",
"pydata_sphinx_theme",
]
tests = [
"flake8",
"pytest",
"coveralls",
"pytest_cov",
"flake8-pyproject",
]
all = [
"resmda[docs]",
"resmda[tests]",
]
build = [
"setuptools_scm>=8",
"setuptools>=64",
]

[tool.setuptools.packages.find]
include = ["resmda*"]

[tool.setuptools_scm]
version_file = "resmda/version.py"

[tool.flake8]
per-file-ignores = [
"__init__.py: F401",
]

[tool.coverage.run]
relative_files = true
26 changes: 0 additions & 26 deletions requirements-dev.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

34 changes: 0 additions & 34 deletions setup.py

This file was deleted.

0 comments on commit 01b5517

Please sign in to comment.