Skip to content

Commit

Permalink
update build sytem to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer committed Nov 6, 2023
1 parent da8b6b8 commit f5cda45
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 114 deletions.
12 changes: 11 additions & 1 deletion index_calculator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

__author__ = """Ludwig Lierhammer"""
__email__ = "ludwig.lierhammer@dwd.de"
__version__ = "0.11.0"

import pkg_resources

from ._outputwriter import OutputWriter as outputwriter
from ._postprocessing import PostProcessing as postprocessing
Expand All @@ -16,6 +17,15 @@
from ._tables import xjson # noqa
from .index_calculator import IndexCalculator as index_calculator


try:
__version__ = pkg_resources.get_distribution("index_calculator").version
except Exception:
# Local copy or not installed with setuptools.
# Disable minimum version checks on downstream libraries.
__version__ = "999"


preprocessing.__module__ = __name__
preprocessing.__name__ = "preprocessing"
processing.__module__ = __name__
Expand Down
139 changes: 139 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
[project]
name = "index_calculator"
description="Python index-calculator is an xclim wrapper"
readme = "README.rst"
requires-python = ">=3.9"
license = {file = "LICENSE"}
keywords = ["index_calculator"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"xarray",
"dask",
"xclim",
"pyhomogenize>=0.5.1",
"pint>=0.1",
"pooch"
]
dynamic = ["version"]

[project.urls]
homepage = "https://index-calculator.readthedocs.io"
documentation = "https://index-calculator.readthedocs.io"
repository = "https://github.com/ludwiglierhammer/index_calculator.git"
changelog = "https://index-calculator.readthedocs.io/en/latest/history.html"

[build-system]
requires = [
"xarray",
"setuptools>=45",
"wheel",
"setuptools_scm[toml]>=6.2",
]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["index_calculator"]

[tool.setuptools_scm]
fallback_version = "999"
write_to = "index_calculator/_version.py"
write_to_template= '__version__ = "{version}"'
tag_regex= "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"

[tool.black]
target-version = ["py38"]

[tool.ruff]
target-version = "py38"
builtins = ["ellipsis"]
exclude = [
".eggs",
"doc",
]
# E402: module level import not at top of file
# E501: line too long - let black worry about that
# E731: do not assign a lambda expression, use a def
ignore = [
"E203",
"E402",
"E501",
"E731",
]
select = [
# Pyflakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I",
# Pyupgrade
"UP",
]

[tool.ruff.isort]
known-first-party = ["index_calculator"]
known-third-party = [
"dask",
"matplotlib",
"numpy",
"pandas",
"pint",
"pkg_resources",
"pytest",
"setuptools",
"sphinx_autosummary_accessors",
"xarray"
]

[tool.pytest]
python_files = "test_*.py"
testpaths = ["./tests"]

[tool.rstcheck]
report_level = "WARNING"
ignore_roles = [
"pr",
"issue",
]
ignore_directives = [
"ipython",
"autodata",
"autosummary",
]

[tool.nbqa.md]
mdformat = true

[tool.mypy]
exclude = "doc|flycheck"
files = "index_calculator/"
show_error_codes = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
module=[
"cftime",
"pandas",
"pooch",
"pint",
"matplotlib",
"pytest",
"shapely.geometry",
"xarray.core.pycompat",
]
ignore_missing_imports = true

[tool.coverage.run]
omit = [
"test.py"
]
21 changes: 0 additions & 21 deletions setup.cfg

This file was deleted.

67 changes: 0 additions & 67 deletions setup.py

This file was deleted.

25 changes: 0 additions & 25 deletions tox.ini

This file was deleted.

0 comments on commit f5cda45

Please sign in to comment.