From 7fa76f25c00ff5bac171e74e85c16e23d8fb130e Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:05:51 +0100 Subject: [PATCH] BREAK: drop support for Python 3.6 (#250) --- .constraints/py3.6.txt | 173 ----------------------------- .cspell.json | 2 - .github/workflows/requirements.yml | 1 - .pre-commit-config.yaml | 1 - pyproject.toml | 150 ++++++++++++++++++++++++- setup.cfg | 132 ---------------------- setup.py | 6 - src/qrules/transition.py | 3 +- 8 files changed, 148 insertions(+), 320 deletions(-) delete mode 100644 .constraints/py3.6.txt delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.constraints/py3.6.txt b/.constraints/py3.6.txt deleted file mode 100644 index 97b0b748..00000000 --- a/.constraints/py3.6.txt +++ /dev/null @@ -1,173 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.6 -# To update, run: -# -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.6.txt --strip-extras -# -alabaster==0.7.13 -anyio==3.6.2 -argon2-cffi==21.3.0 -argon2-cffi-bindings==21.2.0 -async-generator==1.10 -attrs==21.4.0 -babel==2.11.0 -backcall==0.2.0 -beautifulsoup4==4.12.3 -black==22.8.0 -bleach==4.1.0 -certifi==2024.2.2 -cffi==1.15.1 -cfgv==3.3.1 -charset-normalizer==2.0.12 -click==8.0.4 -colorama==0.4.5 -comm==0.1.4 -contextvars==2.4 -coverage==6.2 -dataclasses==0.8 -decorator==5.1.1 -defusedxml==0.7.1 -distlib==0.3.8 -docutils==0.16 -entrypoints==0.4 -execnet==1.9.0 -filelock==3.4.1 -gitdb==4.0.9 -gitpython==3.1.18 -gprof2dot==2022.7.29 -graphviz==0.19.1 -greenlet==2.0.2 -hepunits==2.2.1 -identify==2.4.4 -idna==3.6 -imagesize==1.4.1 -immutables==0.19 -importlib-metadata==4.8.3 ; python_version < "3.8.0" -importlib-resources==3.0.0 -iniconfig==1.1.1 -ipykernel==5.5.6 -ipython==7.16.3 -ipython-genutils==0.2.0 -ipywidgets==7.8.1 -isort==5.10.1 -jedi==0.17.2 -jinja2==3.0.3 -json5==0.9.14 -jsonschema==3.2.0 -jupyter-cache==0.4.3 -jupyter-client==7.1.2 -jupyter-core==4.9.2 -jupyter-lsp==1.5.1 -jupyter-server==1.13.1 -jupyter-server-mathjax==0.2.3 -jupyter-sphinx==0.3.2 -jupyterlab==3.2.9 -jupyterlab-code-formatter==1.6.1 -jupyterlab-lsp==3.9.2 -jupyterlab-pygments==0.1.2 -jupyterlab-server==2.10.3 -jupyterlab-widgets==1.1.7 -latexcodec==2.0.1 -livereload==2.6.3 -markdown-it-py==1.1.0 -markupsafe==2.0.1 -mdit-py-plugins==0.2.8 -mistune==0.8.4 -mypy==0.971 -mypy-extensions==1.0.0 -myst-nb==0.13.2 -myst-parser==0.15.2 -nbclassic==0.3.5 -nbclient==0.5.9 -nbconvert==6.0.7 -nbdime==4.0.1 -nbformat==5.1.3 -nbmake==1.2.1 -nest-asyncio==1.6.0 -nodeenv==1.6.0 -notebook==6.4.10 -packaging==21.3 -pandocfilters==1.5.1 -parso==0.7.1 -particle==0.20.1 -pathspec==0.9.0 -pexpect==4.9.0 -pickleshare==0.7.5 -platformdirs==2.4.0 -pluggy==1.0.0 -pre-commit==2.17.0 -prometheus-client==0.17.1 -prompt-toolkit==3.0.36 -ptyprocess==0.7.0 -py==1.11.0 -pybtex==0.24.0 -pybtex-docutils==1.0.2 -pycparser==2.21 -pydantic==1.9.2 -pydata-sphinx-theme==0.7.2 -pydot==1.4.2 -pygments==2.14.0 -pyparsing==3.1.1 -pyrsistent==0.18.0 -pytest==7.0.1 -pytest-cov==4.0.0 -pytest-profiling==1.7.0 -pytest-xdist==3.0.2 -python-constraint==1.4.0 -python-dateutil==2.8.2 -python-lsp-jsonrpc==1.0.0 -python-lsp-server==1.3.3 -pytz==2024.1 -pyyaml==6.0.1 -pyzmq==25.1.2 -requests==2.27.1 -rope==1.1.1 -send2trash==1.8.2 -six==1.16.0 -smmap==5.0.0 -sniffio==1.2.0 -snowballstemmer==2.2.0 -soupsieve==2.3.2.post1 -sphinx==4.5.0 -sphinx-autobuild==2021.3.14 -sphinx-book-theme==0.2.0 -sphinx-codeautolink==0.12.1 -sphinx-comments==0.0.3 -sphinx-copybutton==0.5.0 -sphinx-design==0.0.13 -sphinx-hep-pdgref==0.2.0 -sphinx-thebe==0.2.1 -sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.2 -sphinxcontrib-bibtex==2.5.0 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.0 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.5 -sphobjinv==2.3.1 -sqlalchemy==1.4.51 -terminado==0.12.1 -testpath==0.6.0 -toml==0.10.2 -tomli==1.2.3 -tornado==6.1 -tox==3.28.0 -tqdm==4.64.1 -traitlets==4.3.3 -typed-ast==1.5.5 -types-pyyaml==6.0.12.12 -types-setuptools==68.2.0.0 -typing-extensions==4.1.1 ; python_version < "3.10.0" -ujson==4.3.0 -urllib3==1.26.18 -virtualenv==20.15.1 ; python_version < "3.7.0" -wcwidth==0.2.13 -webencodings==0.5.1 -websocket-client==1.3.1 -wheel==0.37.1 -widgetsnbextension==3.6.6 -zipp==3.6.0 - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/.cspell.json b/.cspell.json index fb7b3352..e1aef5e5 100644 --- a/.cspell.json +++ b/.cspell.json @@ -34,8 +34,6 @@ "codecov.yml", "docs/conf.py", "pyproject.toml", - "setup.cfg", - "setup.py", "tox.ini", "typings" ], diff --git a/.github/workflows/requirements.yml b/.github/workflows/requirements.yml index fef86022..6716e974 100644 --- a/.github/workflows/requirements.yml +++ b/.github/workflows/requirements.yml @@ -13,7 +13,6 @@ on: paths: - .constraints/py3.*.txt - .pre-commit-config.yaml - - setup.cfg schedule: - cron: "0 3 7 */1 *" workflow_dispatch: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ff44cb0..a11921c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,6 @@ repos: - --repo-title=QRules - id: colab-toc-visible - id: fix-nbformat-version - - id: format-setup-cfg - id: set-nb-cells args: - --add-install-cell diff --git a/pyproject.toml b/pyproject.toml index 36579625..1a0cea3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,153 @@ [build-system] +build-backend = "setuptools.build_meta" requires = [ - "setuptools>=36.2.1", # environment markers + "setuptools>=61.2", "setuptools_scm", - "wheel", ] +[project] +authors = [{name = "Common Partial Wave Analysis", email = "compwa-admin@ep1.rub.de"}] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering", + "Typing :: Typed", +] +dependencies = [ + "PyYAML", + "attrs >=20.1.0", # on_setattr and https://www.attrs.org/en/stable/api.html#next-gen + "jsonschema", + "particle", + "python-constraint", + "tqdm >=4.24.0", # autonotebook + 'typing-extensions; python_version <"3.10.0"', # typing.TypeAlias +] +description = "Rule-based particle reaction problem solver on a quantum number level" +dynamic = ["version"] +keywords = [ + "HEP", + "PWA", + "amplitude analysis", + "partial wave analysis", + "particle physics", + "particles", + "physics", +] +license = {text = "GPLv3 or later"} +maintainers = [{email = "compwa-admin@ep1.rub.de"}] +name = "qrules" +requires-python = ">=3.7" + +[project.optional-dependencies] +all = [ + "qrules[viz]", +] +dev = [ + "qrules[all]", + "qrules[doc]", + "qrules[jupyter]", + "qrules[sty]", + "qrules[test]", + "sphinx-autobuild", + "tox >=1.9", # for skip_install, use_develop +] +doc = [ + "Sphinx >=3", + "myst-nb", # nb_ configuration prefixes + "qrules[viz]", + "sphinx-book-theme", + "sphinx-codeautolink[ipython]", + "sphinx-comments", + "sphinx-copybutton", + "sphinx-design", + "sphinx-hep-pdgref", + "sphinx-thebe", + "sphinx-togglebutton", + "sphinxcontrib-bibtex >=2", + "sphobjinv", + 'sphinx-api-relink >=0.0.4', + 'sphinx-pybtex-etal-style', +] +jupyter = [ + "black", + "ipywidgets", + "isort", + "jupyterlab", + "jupyterlab-code-formatter", + "jupyterlab-lsp", + "python-lsp-server[rope]", + 'jupyterlab-git', + 'jupyterlab-myst', + 'python-lsp-ruff', +] +sty = [ + "mypy >=0.730", # attrs and error code support + "pre-commit >=1.4.0", + "qrules[types]", + 'ruff', +] +test = [ + "ipython", + "nbmake", + "pydot <2", # problem with pydot.graph_from_dot_data + "pytest", + "pytest-cov", + "pytest-profiling", + "pytest-xdist", + 'importlib-metadata; python_version <"3.8.0"', + 'nbmake <1.3; python_version=="3.7.*"', +] +types = [ + "ipython", + "pydot <2", # problem with pydot.graph_from_dot_data + "pytest", + "sphobjinv", + "types-PyYAML", + "types-setuptools", + 'sphinx-api-relink >=0.0.4', +] +viz = [ + "graphviz", +] + +[project.readme] +content-type = "text/markdown" +file = "README.md" + +[project.urls] +Changelog = "https://github.com/ComPWA/qrules/releases" +Documentation = "https://qrules.rtfd.io" +Source = "https://github.com/ComPWA/qrules" +Tracker = "https://github.com/ComPWA/qrules/issues" + +[tool.setuptools] +include-package-data = false +package-dir = {"" = "src"} + +[tool.setuptools.package-data] +qrules = [ + "additional_definitions.yml", + "particle-validation.json", + "py.typed", +] + +[tool.setuptools.packages.find] +namespaces = false +where = ["src"] + [tool.setuptools_scm] write_to = "src/qrules/version.py" @@ -160,6 +303,7 @@ extend-select = [ "D", "EM", "ERA", + "FA", "I", "ICN", "INP", @@ -193,6 +337,7 @@ ignore = [ "D407", "D416", "E501", + "FA100", "ISC001", "PLR0913", "PLR2004", @@ -200,7 +345,6 @@ ignore = [ "PLW1514", "PLW2901", "SIM108", - "UP036", ] task-tags = ["cspell"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c531ccc2..00000000 --- a/setup.cfg +++ /dev/null @@ -1,132 +0,0 @@ -[metadata] -name = qrules -description = Rule-based particle reaction problem solver on a quantum number level -author = Common Partial Wave Analysis -author_email = compwa-admin@ep1.rub.de -maintainer_email = compwa-admin@ep1.rub.de -long_description = file: README.md -long_description_content_type = text/markdown -project_urls = - Tracker = https://github.com/ComPWA/qrules/issues - Changelog = https://github.com/ComPWA/qrules/releases - Documentation = https://qrules.rtfd.io - Source = https://github.com/ComPWA/qrules -license = GPLv3 or later -keywords = - HEP - PWA - amplitude analysis - partial wave analysis - particle physics - particles - physics -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - Intended Audience :: Education - Intended Audience :: Science/Research - License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+) - Natural Language :: English - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - 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 :: Physics - Typing :: Typed - -[options] -python_requires = >=3.6 -setup_requires = - setuptools_scm -install_requires = - attrs >=20.1.0 # on_setattr and https://www.attrs.org/en/stable/api.html#next-gen - jsonschema - particle - python-constraint - PyYAML - tqdm >=4.24.0 # autonotebook - typing-extensions; python_version <"3.10.0" # typing.TypeAlias -packages = find: -package_dir = - =src - -[options.extras_require] -viz = - graphviz -all = - %(viz)s -doc = - %(viz)s - myst-nb # nb_ configuration prefixes - Sphinx >=3 - sphinx-api-relink >=0.0.4; python_version >="3.7.0" - sphinx-book-theme - sphinx-codeautolink[ipython] - sphinx-comments - sphinx-copybutton - sphinx-design - sphinx-hep-pdgref - sphinx-pybtex-etal-style; python_version >="3.7.0" - sphinx-thebe - sphinx-togglebutton - sphinxcontrib-bibtex >=2 - sphobjinv -test = - importlib-metadata; python_version <"3.8.0" - ipython - nbmake - nbmake <1.3; python_version=="3.7.*" - pydot <2 # problem with pydot.graph_from_dot_data - pytest - pytest-cov - pytest-profiling - pytest-xdist -types = - ipython - pydot <2 # problem with pydot.graph_from_dot_data - pytest - sphinx-api-relink >=0.0.4; python_version >="3.7.0" - sphobjinv - types-PyYAML - types-setuptools -sty = - %(types)s - mypy >=0.730 # attrs and error code support - pre-commit >=1.4.0 - ruff; python_version >="3.7.0" -jupyter = - black - ipywidgets - isort - jupyterlab - jupyterlab-code-formatter - jupyterlab-git; python_version >="3.7.0" - jupyterlab-lsp - jupyterlab-myst; python_version >="3.7.0" - python-lsp-ruff; python_version >="3.7.0" - python-lsp-server[rope] -dev = - %(all)s - %(doc)s - %(jupyter)s - %(sty)s - %(test)s - sphinx-autobuild - tox >=1.9 # for skip_install, use_develop - virtualenv !=20.16.*; python_version <"3.7.0" # https://github.com/ComPWA/qrules/actions/runs/4116487921/jobs/7106603597#step:3:78 - virtualenv !=20.17.*; python_version <"3.7.0" # https://github.com/ComPWA/qrules/actions/runs/4116447949/jobs/7106515800#step:3:78 - -[options.packages.find] -where = src - -[options.package_data] -qrules = - additional_definitions.yml - particle-validation.json - py.typed diff --git a/setup.py b/setup.py deleted file mode 100644 index 93296978..00000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -from setuptools import setup - -setup( - use_scm_version=True, - setup_requires=["setuptools_scm"], -) diff --git a/src/qrules/transition.py b/src/qrules/transition.py index e6cf30d3..6ed19519 100644 --- a/src/qrules/transition.py +++ b/src/qrules/transition.py @@ -178,8 +178,7 @@ def extend( self.execution_info.extend(other.execution_info, intersect_violations) -if sys.version_info >= (3, 7): - attrs.resolve_types(_SolutionContainer, globals(), locals()) # type: ignore[type-var] +attrs.resolve_types(_SolutionContainer, globals(), locals()) # type: ignore[type-var] @implement_pretty_repr