-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrate setup configuration to pyproject.toml
Moved all package metadata and dependencies from setup.cfg and setup.py to pyproject.toml for a more modern and standardized project setup. Updated pre-commit hooks and made minor corrections in the code to align with the new configurations.
- Loading branch information
1 parent
53d23b5
commit 198ec95
Showing
5 changed files
with
133 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,97 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"setuptools_scm[toml]>=3.4" | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "hepstats" | ||
description = "statistics tools and utilities" | ||
authors = [{ name = "Matthieu Marinangeli", email = "[email protected]" }] | ||
maintainers = [{ name = "Scikit-HEP", email = "[email protected]" }] | ||
license = { text = "BSD 3-Clause License" } | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Programming Language :: C++", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Scientific/Engineering :: Information Analysis", | ||
"Topic :: Scientific/Engineering :: Mathematics", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
"Topic :: Software Development", | ||
"Topic :: Utilities", | ||
] | ||
urls = { Homepage = "https://github.com/scikit-hep/hepstats" } | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"asdf", | ||
"numpy", | ||
"pandas", | ||
"scipy", | ||
"tqdm", | ||
"uhi", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.readme] | ||
file = "README.md" | ||
content-type = "text/markdown" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"hepstats[docs]", | ||
"hepstats[test]", | ||
"pre-commit", | ||
] | ||
docs = [ | ||
"matplotlib", | ||
"pydata-sphinx-theme", | ||
"sphinx>=3.1.2", | ||
"sphinx-autodoc-typehints", | ||
"sphinx-copybutton", | ||
"sphinxcontrib-bibtex>=2.0.0", | ||
] | ||
doc = ["hepstats[docs]"] # alias | ||
test = [ | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-runner", | ||
"zfit>=0.20.0", | ||
] | ||
zfit = ["zfit>=0.20.0"] | ||
|
||
|
||
|
||
[tool.pytest.ini_options] | ||
junit_family = "xunit2" | ||
testpaths = ["tests"] | ||
|
||
[tool.check-manifest] | ||
ignore = ["src/hepstats/_version.py"] | ||
|
||
[tool.build_sphinx] | ||
project = "hepstats" | ||
source-dir = "docs" | ||
build-dir = "docs/_build" | ||
all-files = "1" | ||
warning-is-error = "0" | ||
|
||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/hepstats/version.py" | ||
[tool.hatch] | ||
version.source = "vcs" | ||
build.hooks.vcs.version-file = "src/hepstats/_version.py" | ||
|
||
[tool.ruff] | ||
#src = ["src"] | ||
|
@@ -20,41 +104,42 @@ exclude = [ | |
] | ||
[tool.ruff.lint] | ||
extend-select = [ | ||
"B", # flake8-bugbear | ||
"I", # isort | ||
"ARG", # flake8-unused-arguments | ||
"C4", # flake8-comprehensions | ||
"EM", # flake8-errmsg | ||
"ICN", # flake8-import-conventions | ||
"G", # flake8-logging-format | ||
"PGH", # pygrep-hooks | ||
"PIE", # flake8-pie | ||
"PL", # pylint | ||
"PT", # flake8-pytest-style | ||
"PTH", # flake8-use-pathlib | ||
"RET", # flake8-return | ||
"RUF", # Ruff-specific | ||
"SIM", # flake8-simplify | ||
"T20", # flake8-print | ||
"UP", # pyupgrade | ||
"YTT", # flake8-2020 | ||
"EXE", # flake8-executable | ||
"NPY", # NumPy specific rules | ||
"PD", # pandas-vet | ||
"B", # flake8-bugbear | ||
"I", # isort | ||
"ARG", # flake8-unused-arguments | ||
"C4", # flake8-comprehensions | ||
"EM", # flake8-errmsg | ||
"ICN", # flake8-import-conventions | ||
"G", # flake8-logging-format | ||
"PGH", # pygrep-hooks | ||
"PIE", # flake8-pie | ||
"PL", # pylint | ||
"PT", # flake8-pytest-style | ||
"PTH", # flake8-use-pathlib | ||
"RET", # flake8-return | ||
"RUF", # Ruff-specific | ||
"SIM", # flake8-simplify | ||
"T20", # flake8-print | ||
"UP", # pyupgrade | ||
"YTT", # flake8-2020 | ||
"EXE", # flake8-executable | ||
"NPY", # NumPy specific rules | ||
"PD", # pandas-vet | ||
] | ||
ignore = [ | ||
"UP007", # type annotation upgrade, breaks pydantic for Python 3.9 (remove once above) | ||
"PLR09", # Too many <...> | ||
"PLR2004", # Magic value used in comparison | ||
"ISC001", # Conflicts with formatter | ||
"RET505", # This is sometimes wanted, protets against accidental intendation | ||
"PD901", # "avoid using `df[...].values`" -> no, this is a very good name if there is only one df | ||
"PD011", # "replace `df[...].values` with `df[...].to_numpy()`" -> not yet, it's not deprecated. | ||
"UP007", # type annotation upgrade, breaks pydantic for Python 3.9 (remove once above) | ||
"PLR09", # Too many <...> | ||
"PLR2004", # Magic value used in comparison | ||
"ISC001", # Conflicts with formatter | ||
"RET505", # This is sometimes wanted, protets against accidental intendation | ||
"PD901", # "avoid using `df[...].values`" -> no, this is a very good name if there is only one df | ||
"PD011", # "replace `df[...].values` with `df[...].to_numpy()`" -> not yet, it's not deprecated. | ||
# Prefer to have a single way to access the data if we don't care about whether it's a numpy array or not. | ||
"PLW0603", # updating global variables with a function is bad, but we use it for | ||
"PLW2901", # "for loop overwritten by assignment" -> we use this to update the loop variable | ||
"PD013", # "melt over stack": df function, but triggers on tensors | ||
"NPY002", # "Use rnd generator in numpy" -> we use np.random for some legacy stuff but do use the new one where we can | ||
"PLW0603", # updating global variables with a function is bad, but we use it for | ||
"PLW2901", # "for loop overwritten by assignment" -> we use this to update the loop variable | ||
"PD013", # "melt over stack": df function, but triggers on tensors | ||
"NPY002", # "Use rnd generator in numpy" -> we use np.random for some legacy stuff but do use the new one where we can | ||
"T201", # "print used" -> we use print for displaying information in verbose mode | ||
|
||
] | ||
isort.required-imports = ["from __future__ import annotations"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters