From 147d3634b4817d312e102aaaa1cf5cd6ad248f8e Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sun, 9 Jul 2023 15:59:23 +0200 Subject: [PATCH 1/2] MAINT!: merge setup.cfg into pyproject.toml --- .constraints/py3.8.txt | 1 + .cspell.json | 1 - .cspell/this-project.txt | 1 + .editorconfig | 29 ++++---- .github/workflows/ci-docs.yml | 14 ++-- .github/workflows/requirements.yml | 2 +- environment.yml | 2 +- pyproject.toml | 115 ++++++++++++++++++++++++++++- setup.cfg | 101 ------------------------- setup.py | 6 -- 10 files changed, 138 insertions(+), 134 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index 95b6a754..720cc409 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -203,4 +203,5 @@ wrapt==1.15.0 zipp==3.16.0 # The following packages are considered to be unsafe in a requirements file: +# polarimetry # setuptools diff --git a/.cspell.json b/.cspell.json index 7e4ea04f..868b983b 100644 --- a/.cspell.json +++ b/.cspell.json @@ -66,7 +66,6 @@ "miscellchecks/**.C", "pyproject.toml", "pytest.ini", - "setup.cfg", "tox.ini" ], "language": "en-US", diff --git a/.cspell/this-project.txt b/.cspell/this-project.txt index 19b35221..f57bb220 100644 --- a/.cspell/this-project.txt +++ b/.cspell/this-project.txt @@ -25,6 +25,7 @@ pdfnb phsp pushd PyPI +pyproject pyright pytest PYTHONHASHSEED diff --git a/.editorconfig b/.editorconfig index 00343fce..d3d78df8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,16 +1,13 @@ -root = true - -[*] -end_of_line = lf -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -[Makefile] -indent_style = tab - -[*.{py,toml}] -indent_size = 4 - -[setup.cfg] -indent_size = 4 +root = true + +[*] +end_of_line = lf +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[Makefile] +indent_style = tab + +[*.{py,toml}] +indent_size = 4 diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 3ebdee9c..425ea524 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -106,27 +106,27 @@ jobs: uses: actions/cache@v3 with: key: | - sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**')}}-${{hashFiles('docs/**.ipynb')}} + sympy-${{hashFiles('.constraints/py3.*.txt')}}-${{hashFiles('src/**')}}-${{hashFiles('docs/**.ipynb')}} restore-keys: | - sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**')}} - sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}} + sympy-${{hashFiles('.constraints/py3.*.txt')}}-${{hashFiles('src/**')}} + sympy-${{hashFiles('.constraints/py3.*.txt')}} path: ~/.sympy-cache*/ - name: Fetch Jupyter cache uses: actions/cache@v3 with: key: | - jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}-${{hashFiles('docs/**')}} + jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'src/**')}}-${{hashFiles('docs/**')}} restore-keys: | - jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}} + jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'src/**')}} path: | ./docs/_build/.jupyter_cache - name: Fetch output files uses: actions/cache@v3 with: key: | - output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}-${{hashFiles('docs/**')}} + output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'src/**')}}-${{hashFiles('docs/**')}} restore-keys: | - output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}} + output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'src/**')}} output-files path: | ./docs/_images diff --git a/.github/workflows/requirements.yml b/.github/workflows/requirements.yml index b8f8c9e0..dac6b208 100644 --- a/.github/workflows/requirements.yml +++ b/.github/workflows/requirements.yml @@ -12,7 +12,7 @@ on: paths: - .constraints/py3.*.txt - .pre-commit-config.yaml - - setup.cfg + - pyproject.toml schedule: - cron: "0 3 7 */3 *" workflow_dispatch: diff --git a/environment.yml b/environment.yml index a17671fc..2908c369 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - defaults dependencies: - python==3.8.* - - pip + - pip>=21.3 # pyproject.toml - pip: - | -c .constraints/py3.8.txt diff --git a/pyproject.toml b/pyproject.toml index 66bfa969..db7b741c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,123 @@ [build-system] +build-backend = "setuptools.build_meta" requires = [ - "setuptools>=36.2.1", # environment markers + "setuptools>=61.2", "setuptools_scm", "wheel", ] +[project] +authors = [ + { name = "Mikhail Mikhasenko" }, + { name = "Remco de Boer" }, +] +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.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering", + "Typing :: Typed", +] +dependencies = [ + "IPython", + "PyYAML", + "ampform >=0.14.1", + "attrs >=20.1.0", + "cloudpickle", + "matplotlib", + "numpy", + "sympy >=1.10", + "tensorwaves[jax] >=0.4.5", + 'typing-extensions; python_version <"3.8.0"', +] +description = "Symbolic expressions that describe an aligned polarimeter vector field" +dynamic = ["version"] +license = { text = "GPLv3 or later" } +name = "polarimetry" +requires-python = ">=3.7" + +[project.optional-dependencies] +dev = [ + "polarimetry[doc]", + "polarimetry[jupyter]", + "polarimetry[sty]", + "polarimetry[test]", + "sphinx-autobuild", + "tox >=1.9", +] +doc = [ + "cairosvg", + "ipympl", + "ipywidgets", + "kaleido", + "matplotlib-inline !=0.1.5", + "myst-nb >=0.14", + "pandas", + "plotly", + "psutil", + "scipy", + "sphinx-book-theme", + "sphinx-codeautolink[ipython]", + "sphinx-copybutton", + "sphinx-design", + "sphinx-reredirects", + "sphinx-togglebutton", + "sphinxcontrib-bibtex >=2.2", + "sphinxcontrib-svg2pdfconverter", + "svgutils", + "tqdm", + 'importlib-metadata; python_version <"3.8.0"', +] +jupyter = [ + "jupyterlab >=3.0", + "jupyterlab-code-formatter", + "jupyterlab-myst", + "polarimetry[doc]", + 'ypy-websocket <0.8.3; python_version <"3.8.0"', +] +sty = [ + "black", + "pre-commit >=1.4.0", + "pytest", + "ruff", +] +test = [ + "nbmake", + "pytest >=6.0", + "pytest-xdist", + 'nbmake <1.3; python_version<"3.8.0"', +] + +[project.readme] +content-type = "text/markdown" +file = "README.md" + +[tool.setuptools] +include-package-data = false +package-dir = { "" = "src" } + +[tool.setuptools.packages.find] +namespaces = false +where = ["src"] + +[tool.setuptools.package-data] +"polarimetry.lhcb" = [ + "model-definitions.yaml", + "particle-definitions.yaml", +] + + [tool.setuptools_scm] write_to = "src/polarimetry/version.py" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1c49668f..00000000 --- a/setup.cfg +++ /dev/null @@ -1,101 +0,0 @@ -[metadata] -name = polarimetry -description = Symbolic expressions that describe an aligned polarimeter vector field -author = Mikhail Mikhasenko, Remco de Boer, Miriam Fritsch -long_description = file: README.md -long_description_content_type = text/markdown -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.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Scientific/Engineering - Topic :: Scientific/Engineering :: Physics - Typing :: Typed -license = GPLv3 or later - -[options] -python_requires = >=3.7 -setup_requires = - setuptools_scm -install_requires = - ampform >=0.14.1 # Kibble and Kallen functions - attrs >=20.1.0 # on_setattr and https://www.attrs.org/en/stable/api.html#next-gen - cloudpickle - IPython - matplotlib - numpy - sympy >=1.10 # module sympy.printing.numpy and array expressions with shape kwarg - tensorwaves[jax] >=0.4.5 # lambdify sympy.Indexed - typing-extensions; python_version <"3.8.0" - PyYAML -packages = find: -package_dir = - =src - -[options.extras_require] -doc = - cairosvg - importlib-metadata; python_version <"3.8.0" - ipympl - ipywidgets - kaleido # plotly static figure export - matplotlib-inline !=0.1.5 # problem with plt.ioff() - myst-nb >=0.14 # nb_render_markdown_format for Markdown tables - pandas - plotly - psutil - scipy - sphinx-book-theme - sphinx-codeautolink[ipython] - sphinx-codeautolink !=0.14.0 # https://github.com/ComPWA/polarimetry/actions/runs/4044891117/jobs/6955624561 - sphinx-copybutton - sphinx-design - sphinx-reredirects - sphinx-togglebutton - sphinxcontrib-bibtex >=2.2 # bibtex_reference_style - sphinxcontrib-svg2pdfconverter - svgutils - tqdm -jupyter = - %(doc)s - jupyterlab >=3.0 - jupyterlab-code-formatter - jupyterlab-myst - ypy-websocket <0.8.3; python_version <"3.8.0" -test = - nbmake - nbmake <1.3; python_version<"3.8.0" - pytest >=6.0 # pyproject.toml - pytest-xdist -format = - black -sty = - %(format)s - ruff - pytest # for type hints - pre-commit >=1.4.0 -dev = - %(doc)s - %(jupyter)s - %(sty)s - %(test)s - sphinx-autobuild - tox >=1.9 # for skip_install, use_develop - -[options.packages.find] -where = src - -[options.package_data] -polarimetry.lhcb = - model-definitions.yaml - particle-definitions.yaml 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"], -) From 652b75e9c7b80d2d7cb1ffd57ad11ad14972e42f Mon Sep 17 00:00:00 2001 From: GitHub Date: Tue, 11 Jul 2023 08:15:53 +0000 Subject: [PATCH 2/2] MAINT: update pip constraints and pre-commit --- .constraints/py3.10.txt | 7 ++++--- .constraints/py3.11.txt | 7 ++++--- .constraints/py3.7.txt | 11 ++++++----- .constraints/py3.8.txt | 6 +++--- .constraints/py3.9.txt | 7 ++++--- .pre-commit-config.yaml | 2 +- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.constraints/py3.10.txt b/.constraints/py3.10.txt index 8ccb5e70..1663f396 100644 --- a/.constraints/py3.10.txt +++ b/.constraints/py3.10.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.10.txt --resolver=backtracking --strip-extras +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.10.txt --resolver=backtracking --strip-extras --unsafe-package=pip --unsafe-package=polarimetry --unsafe-package=setuptools # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -17,7 +17,7 @@ attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 cairocffi==1.6.0 @@ -122,7 +122,7 @@ platformdirs==3.8.1 plotly==5.15.0 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -201,4 +201,5 @@ wrapt==1.15.0 zipp==3.16.0 # The following packages are considered to be unsafe in a requirements file: +# polarimetry # setuptools diff --git a/.constraints/py3.11.txt b/.constraints/py3.11.txt index c6dcf8ab..502a726b 100644 --- a/.constraints/py3.11.txt +++ b/.constraints/py3.11.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.11.txt --resolver=backtracking --strip-extras +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.11.txt --resolver=backtracking --strip-extras --unsafe-package=pip --unsafe-package=polarimetry --unsafe-package=setuptools # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -17,7 +17,7 @@ attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 cairocffi==1.6.0 @@ -121,7 +121,7 @@ platformdirs==3.8.1 plotly==5.15.0 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -199,4 +199,5 @@ wrapt==1.15.0 zipp==3.16.0 # The following packages are considered to be unsafe in a requirements file: +# polarimetry # setuptools diff --git a/.constraints/py3.7.txt b/.constraints/py3.7.txt index 41ee4964..1d0b211b 100644 --- a/.constraints/py3.7.txt +++ b/.constraints/py3.7.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.7.txt --resolver=backtracking --strip-extras +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.7.txt --resolver=backtracking --strip-extras --unsafe-package=pip --unsafe-package=polarimetry --unsafe-package=setuptools # accessible-pygments==0.0.4 aiofiles==22.1.0 @@ -52,7 +52,7 @@ identify==2.5.24 idna==3.4 imagesize==1.4.1 iminuit==2.18.0 -importlib-metadata==6.7.0 ; python_version < "3.8.0" +importlib-metadata==6.7.0 importlib-resources==5.12.0 iniconfig==2.0.0 ipykernel==6.16.2 @@ -102,7 +102,7 @@ nbclassic==1.0.0 nbclient==0.5.13 nbconvert==7.6.0 nbformat==5.8.0 -nbmake==1.2.1 ; python_version < "3.8.0" +nbmake==1.2.1 nest-asyncio==1.5.6 nodeenv==1.8.0 notebook==6.5.4 @@ -123,7 +123,7 @@ platformdirs==3.8.1 plotly==5.15.0 pluggy==1.2.0 pre-commit==2.21.0 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -198,8 +198,9 @@ wheel==0.40.0 widgetsnbextension==4.0.8 wrapt==1.15.0 y-py==0.5.9 -ypy-websocket==0.8.2 ; python_version < "3.8.0" +ypy-websocket==0.8.2 zipp==3.15.0 # The following packages are considered to be unsafe in a requirements file: +# polarimetry # setuptools diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index 720cc409..55c1394f 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.8.txt --resolver=backtracking --strip-extras +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.8.txt --resolver=backtracking --strip-extras --unsafe-package=pip --unsafe-package=polarimetry --unsafe-package=setuptools # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -17,7 +17,7 @@ attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 cairocffi==1.6.0 @@ -124,7 +124,7 @@ platformdirs==3.8.1 plotly==5.15.0 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index c8bef6ef..c095822e 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.9.txt --resolver=backtracking --strip-extras +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.9.txt --resolver=backtracking --strip-extras --unsafe-package=pip --unsafe-package=polarimetry --unsafe-package=setuptools # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -17,7 +17,7 @@ attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 cairocffi==1.6.0 @@ -123,7 +123,7 @@ platformdirs==3.8.1 plotly==5.15.0 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -202,4 +202,5 @@ wrapt==1.15.0 zipp==3.16.0 # The following packages are considered to be unsafe in a requirements file: +# polarimetry # setuptools diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0255cc2b..4d269aa6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black