diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a43fe753..240fbe51a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,11 @@ repos: - id: fix-encoding-pragma args: [--remove] + - repo: https://github.com/tox-dev/pyproject-fmt + rev: "1.3.0" + hooks: + - id: pyproject-fmt + - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index f8ad00eb1..0fb1a5bd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,12 +7,14 @@ requires = [ [project] name = "pyglotaran" description = "The Glotaran fitting engine." +readme = "README.md" +license = { text = "LGPL-3.0" } authors = [ { name = "Joern Weissenborn", email = "joern.weissenborn@gmail.com" }, { name = "Joris Snellenburg", email = "j.snellenburg@gmail.com" }, { name = "Ivo van Stokkum", email = "i.h.m.van.stokkum@vu.nl" }, ] -license = { text = "LGPL-3.0" } +requires-python = ">=3.10, <3.12" classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Education", @@ -20,48 +22,83 @@ classifiers = [ "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Natural Language :: English", "Operating System :: OS Independent", - "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Chemistry", "Topic :: Scientific/Engineering :: Physics", ] -requires-python = ">=3.10, <3.12" +dynamic = [ + "version", +] dependencies = [ "asteval!=0.9.28,>=0.9.22", "netCDF4>=1.5.7", - "numba>=0.55.0", - "numpy>=1.21.2,<1.25", + "numba>=0.55", + "numpy<1.25,>=1.21.2", "odfpy>=1.4.1", "openpyxl>=3.0.10", "pandas>=1.3.4", - "pydantic>=2.0", + "pydantic>=2", "ruamel.yaml>=0.17.17", "scipy>=1.7.2", "sdtfile>=2020.8.3", "tabulate>=0.8.9", - "xarray>=2022.3.0", + "xarray>=2022.3", +] +[project.optional-dependencies] +dev = [ + "pyglotaran[docs,test]", +] +docs = [ + # documentation dependencies + "IPython>=7.2", + "Jinja2<3.1.0", + "jupyterlab>=3", + "matplotlib>=3", + "myst-parser>=0.12", + "nbsphinx>=0.8.1", # notebook docs + "nbval>=0.9.6", + "numpydoc>=0.8", + "Sphinx>=3.2", + "sphinx-click>=3.0.1", + "sphinx-copybutton>=0.3", + "sphinx-last-updated-by-git>=0.3", + "sphinx-rtd-theme>=1.2", + "sphinxcontrib-jquery>=4.1", # Needed for the search to work Ref.: https://github.com/readthedocs/sphinx_rtd_theme/issues/1434 +] +extras = [ + "pyglotaran-extras>=0.5", +] +full = [ + "pyglotaran[extras]", +] +test = [ + "coverage[toml]", + "pluggy>=0.7", + "pytest>=3.7.1", + "pytest-allclose>=1", + "pytest-benchmark>=3.1.1", + "pytest-cov>=2.5.1", + "pytest-env>=0.6.2", + "pytest-runner>=2.11.1", + "types-dataclasses>=0.1.7", ] -dynamic = ["version"] - -[project.readme] -file = "README.md" -content-type = "text/markdown" - [project.urls] -Homepage = "https://github.com/glotaran/pyglotaran" -"Glotaran Ecosystem" = "https://glotaran.org" -Documentation = "https://pyglotaran.readthedocs.io" Changelog = "https://pyglotaran.readthedocs.io/en/latest/changelog.html" +Documentation = "https://pyglotaran.readthedocs.io" +"Glotaran Ecosystem" = "https://glotaran.org" +Homepage = "https://github.com/glotaran/pyglotaran" Source = "https://github.com/glotaran/pyglotaran" Tracker = "https://github.com/glotaran/pyglotaran/issues" - +[project.scripts] +glotaran = "glotaran.cli.main:main" [project.entry-points."glotaran.plugins.data_io"] ascii = "glotaran.builtin.io.ascii.wavelength_time_explicit_file" -sdt = "glotaran.builtin.io.sdt.sdt_file_reader" nc = "glotaran.builtin.io.netCDF.netCDF" +sdt = "glotaran.builtin.io.sdt.sdt_file_reader" yml = "glotaran.builtin.io.yml.yml" - [project.entry-points."glotaran.plugins.elements"] baseline = "glotaran.builtin.elements.baseline" clp_guide = "glotaran.builtin.elements.clp_guide" @@ -69,54 +106,12 @@ coherent_artifact = "glotaran.builtin.elements.coherent_artifact" damped_oscillation = "glotaran.builtin.elements.damped_oscillation" kinetic = "glotaran.builtin.elements.kinetic" spectral = "glotaran.builtin.elements.spectral" - [project.entry-points."glotaran.plugins.project_io"] csv = "glotaran.builtin.io.pandas.csv" tsv = "glotaran.builtin.io.pandas.tsv" xlsx = "glotaran.builtin.io.pandas.xlsx" xsx = "glotaran.builtin.io.pandas.xlsx" -[project.optional-dependencies] -docs = [ - # documentation dependencies - "Sphinx>=3.2.0", - "sphinx-click>=3.0.1", - "sphinx-rtd-theme>=1.2.0", - # Needed for the search to work - # Ref.: https://github.com/readthedocs/sphinx_rtd_theme/issues/1434 - "sphinxcontrib-jquery>=4.1", - "sphinx-copybutton>=0.3.0", - "myst-parser>=0.12.0", - "numpydoc>=0.8.0", - # notebook docs - "nbsphinx>=0.8.1", - "sphinx-last-updated-by-git>=0.3.0", - "jupyterlab>=3.0.0", - "matplotlib>=3.0.0", - "IPython>=7.2.0", - "nbval>=0.9.6", - "Jinja2<3.1.0", -] -test = [ - "pytest>=3.7.1", - "pluggy>=0.7", - "coverage[toml]", - "pytest-cov>=2.5.1", - "pytest-env>=0.6.2", - "pytest-runner>=2.11.1", - "pytest-benchmark>=3.1.1", - "pytest-allclose>=1.0.0", - "types-dataclasses>=0.1.7", -] -dev = [ - "pyglotaran[docs,test]", -] -extras = ["pyglotaran-extras>=0.5.0"] -full = ["pyglotaran[extras]"] - -[project.scripts] -glotaran = "glotaran.cli.main:main" - [tool.hatch.version] path = "glotaran/__init__.py" @@ -129,7 +124,6 @@ only-include = ["glotaran"] [tool.hatch.envs.default] features = ["dev"] - [tool.black] line-length = 99 target-version = ['py38'] @@ -148,7 +142,6 @@ exclude = ''' )/ ''' - [tool.ruff] select = [ @@ -245,7 +238,6 @@ unfixable = ["F401"] # Needs a full rewrite anyway "glotaran/builtin/io/ascii/wavelength_time_explicit_file.py" = ["PTH"] - [tool.isort] profile = "hug" src_paths = ["glotaran"] @@ -255,14 +247,21 @@ known_first_party = ["glotaran", "tests"] force_single_line = true remove_redundant_aliases = true -[tool.interrogate] -exclude = ["setup.py", "docs", "tests", "benchmark/*"] -ignore-init-module = true -fail-under = 63 - -[tool.nbqa.addopts] -flake8 = ["--extend-ignore=E402,F404"] - +[tool.pytest.ini_options] +# env = [ +# "DEACTIVATE_GTA_PLUGINS=1", +# # Uncomment the following lines to deactivate pyglotaran all plugins +# # Uncomment "env =" and "COMPARE_RESULTS_LOCAL" and set it to a local folder +# # with results to use as a reference in lieu of the comparison-results branch +# # in the pyglotaran-examples git repository +# "COMPARE_RESULTS_LOCAL=~/local_results/", # On *nix +# "COMPARE_RESULTS_LOCAL=%USERPROFILE%/local_results/", # On Windows +# ] +# Uncomment to ignore deprecation warnings coming from pyglotaran +# (this helps to see the warnings from dependencies) +# filterwarnings = [ +# "ignore:.+glotaran:GlotaranApiDeprecationWarning", +# ] [tool.coverage.run] branch = true @@ -293,23 +292,6 @@ exclude_lines = [ 'if TYPE_CHECKING:', ] -[tool.pytest.ini_options] -# env = [ -# "DEACTIVATE_GTA_PLUGINS=1", -# # Uncomment the following lines to deactivate pyglotaran all plugins -# # Uncomment "env =" and "COMPARE_RESULTS_LOCAL" and set it to a local folder -# # with results to use as a reference in lieu of the comparison-results branch -# # in the pyglotaran-examples git repository -# "COMPARE_RESULTS_LOCAL=~/local_results/", # On *nix -# "COMPARE_RESULTS_LOCAL=%USERPROFILE%/local_results/", # On Windows -# ] -# Uncomment to ignore deprecation warnings coming from pyglotaran -# (this helps to see the warnings from dependencies) -# filterwarnings = [ -# "ignore:.+glotaran:GlotaranApiDeprecationWarning", -# ] - - [tool.mypy] plugins = "pydantic.mypy" ignore_missing_imports = true @@ -335,3 +317,11 @@ ignore_errors = true [[tool.mypy.overrides]] module = "benchmark.*" ignore_errors = true + +[tool.interrogate] +exclude = ["setup.py", "docs", "tests", "benchmark/*"] +ignore-init-module = true +fail-under = 63 + +[tool.nbqa.addopts] +flake8 = ["--extend-ignore=E402,F404"]