From 0423ed60697ce116225958055f1ad4321f5a3c73 Mon Sep 17 00:00:00 2001 From: Fstei Date: Fri, 20 Sep 2024 12:19:04 +0200 Subject: [PATCH 1/2] Hatchlinger Update --- .../requirements-test_packaging.in | 4 +- docs/conf.py | 6 +- pyproject.toml | 67 +++++++++++++++++-- setup.cfg | 48 ------------- setup.py | 3 - 5 files changed, 66 insertions(+), 62 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/dev_requirements/requirements-test_packaging.in b/dev_requirements/requirements-test_packaging.in index b17b678f..6a10a918 100644 --- a/dev_requirements/requirements-test_packaging.in +++ b/dev_requirements/requirements-test_packaging.in @@ -1,6 +1,4 @@ # specific requirements for the tox test_packaging env build twine -# tools below for the actual packaging -setuptools -setuptools-scm + diff --git a/docs/conf.py b/docs/conf.py index 9b4581ee..f0ddadda 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,7 +32,7 @@ # `sphinx-build -b html . _build/html`. See Issue: # https://github.com/rtfd/readthedocs.org/issues/1139 # DON'T FORGET: Check the box "Install your project inside a virtualenv using -# setup.py install" in the RTD Advanced Settings. +# pyproject.toml install" in the RTD Advanced Settings. # Additionally, it helps us to avoid running apidoc manually try: # for Sphinx >= 1.7 @@ -104,9 +104,9 @@ # built documents. # # The short X.Y version. -version = "" # Is set by calling `setup.py docs` +version = "" # Is set by calling `pyproject.toml docs` # The full version, including alpha/beta/rc tags. -release = "" # Is set by calling `setup.py docs` +release = "" # Is set by calling `pyproject.toml docs` # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/pyproject.toml b/pyproject.toml index a4b31eef..98dd3c2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,44 @@ -[build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] -build-backend = "setuptools.build_meta" +[project] +name = "ahbicht" +description = "Python Library to parse AHB expressions." +license = { text = "MIT" } +requires-python = ">=3.8" +authors = [{ name = "Annika Schlögl", email = "annika.schloegl@hochfrequenz.de" }] +keywords = ["AHB", "Parsing", "Expressions"] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "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", +] + +[project.urls] +Changelog = "https://github.com/Hochfrequenz/ahbicht/releases" +Homepage = "https://github.com/Hochfrequenz/ahbicht" +Documentation = "https://ahbicht.readthedocs.io/en/latest/" + +dependencies = [ + "attrs>=21.4.0", + "lark>=1.1.4", + "inject", + "marshmallow", + "marshmallow_enum", + "maus>=0.6.0", + "pytz", + "efoli>=1.1.0" +] # add all the dependencies here +dynamic = ["readme", "version"] + +[project.optional-dependencies] -[tool.setuptools_scm] [tool.black] line-length = 120 @@ -25,4 +61,25 @@ markers = [ ] [tool.mypy] -# warn_unused_ignores = true # doesn't work,because either 'error: Cannot infer type argument 1 of "Tree" [misc]' but this is also flagged as unused ignore \ No newline at end of file +# warn_unused_ignores = true # doesn't work,because either 'error: Cannot infer type argument 1 of "Tree" [misc]' but this is also flagged as unused ignore + +[build-system] +requires = ["hatchling>=1.8.0", "hatch-vcs", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + + +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/markdown" +fragments = [{ path = "README.md" }] + +[tool.hatch.version] +source = "vcs" + + + +[tool.hatch.build.targets.sdist] +exclude = ["/unittests"] + +[tool.hatch.build.targets.wheel] +only-include = ["src"] +sources = ["src"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 0426eef2..00000000 --- a/setup.cfg +++ /dev/null @@ -1,48 +0,0 @@ -[metadata] -author = Annika Schlögl -author_email = annika.schloegl@hochfrequenz.de -description = Python Library to parse AHB expressions. -long_description = file: README.rst -long_description_content_type = text/x-rst; charset=UTF-8 -url = https://github.com/Hochfrequenz/ahbicht -project_urls = - Documentation = https://ahbicht.readthedocs.io/en/latest/ - Code = https://github.com/Hochfrequenz/ahbicht/ - Bug tracker = https://github.com/Hochfrequenz/ahbicht/issues -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - Programming Language :: Python - 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 - Operating System :: OS Independent -license = mit -platforms = any - -[options] -package_dir = - = src -packages = find: -zip_safe = False -include_package_data = True -python_requires = >=3.8 -install_requires = - attrs>=21.4.0 - lark>=1.1.4 - inject - marshmallow - marshmallow_enum - maus>=0.6.0 - pytz - efoli>=1.1.0 - -[options.packages.find] -where = src -exclude = - unittests - -[options.package_data] -* = py.typed diff --git a/setup.py b/setup.py deleted file mode 100644 index fbf54326..00000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup(name="ahbicht", use_scm_version=True) From 9ee2b945799b425d98cdfb0e538dbdbbdff75431 Mon Sep 17 00:00:00 2001 From: Fstei Date: Fri, 20 Sep 2024 14:32:25 +0200 Subject: [PATCH 2/2] fix hatchi --- pyproject.toml | 13 ++++++------- requirements.txt | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 98dd3c2b..c2f0e509 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,11 +20,6 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] -[project.urls] -Changelog = "https://github.com/Hochfrequenz/ahbicht/releases" -Homepage = "https://github.com/Hochfrequenz/ahbicht" -Documentation = "https://ahbicht.readthedocs.io/en/latest/" - dependencies = [ "attrs>=21.4.0", "lark>=1.1.4", @@ -39,6 +34,10 @@ dynamic = ["readme", "version"] [project.optional-dependencies] +[project.urls] +Changelog = "https://github.com/Hochfrequenz/ahbicht/releases" +Homepage = "https://github.com/Hochfrequenz/ahbicht" +Documentation = "https://ahbicht.readthedocs.io/en/latest/" [tool.black] line-length = 120 @@ -70,7 +69,7 @@ build-backend = "hatchling.build" [tool.hatch.metadata.hooks.fancy-pypi-readme] content-type = "text/markdown" -fragments = [{ path = "README.md" }] +fragments = [{ path = "README.rst" }] [tool.hatch.version] source = "vcs" @@ -82,4 +81,4 @@ exclude = ["/unittests"] [tool.hatch.build.targets.wheel] only-include = ["src"] -sources = ["src"] \ No newline at end of file +sources = ["src"] diff --git a/requirements.txt b/requirements.txt index e912bcf7..05195ea7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile requirements.in