From 1bea747fd54d037c6333e79c3a6ec3a067e3ab42 Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Wed, 27 Sep 2023 17:56:11 +0200 Subject: [PATCH 01/10] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Add=20build=20inform?= =?UTF-8?q?ation=20into=20pyproject.toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3b23a9ad7..18efaa41c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,55 @@ [build-system] -requires = ["setuptools>=41.0", "wheel", "setuptools_scm[toml]>=3.4"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=1.8.0", "hatch-vcs", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + +[project] +name = "bo4e-python" +description = "Python Library that implements the BO4E Standard." +license = { text = "MIT" } +requires-python = ">=3.10" +authors = [{ name = "Kevin Krechan", email = "kevin.krechan@hochfrequenz.de" }] +keywords = ["bo4e", "bdew", "edi@energy"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "iso3166", + "pydantic>=2.0.0", + "pyhumps", +] +dynamic = ["readme", "version"] + +[project.urls] +Changelog = "https://github.com/Hochfrequenz/BO4E-python/releases" +Homepage = "https://github.com/Hochfrequenz/BO4E-python" +Documentation = "https://bo4e-python.readthedocs.io/en/latest/" + +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/x-rst" +fragments = [{ path = "README.rst" }] + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "src/_kohlrahbi_version.py" +template = ''' +version = "{version}" +''' + +[tool.hatch.build.targets.sdist] +exclude = ["/unittests"] + +[tool.hatch.build.targets.wheel] +only-include = ["src"] +sources = ["src"] [tool.black] line-length = 120 From 480bca0152592deb2bd2c045824e14ee06dfc266 Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 10:40:35 +0200 Subject: [PATCH 02/10] =?UTF-8?q?=F0=9F=94=A5=20Remove=20setup.cfg=20and?= =?UTF-8?q?=20setup.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.cfg | 38 -------------------------------------- setup.py | 17 ----------------- 2 files changed, 55 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a288f30d0..000000000 --- a/setup.cfg +++ /dev/null @@ -1,38 +0,0 @@ -[metadata] -url = https://github.com/Hochfrequenz/BO4E-python -project_urls = - Documentation = https://bo4e-python.readthedocs.io/en/latest/ - Code = https://github.com/Hochfrequenz/BO4E-python - Issue tracker = https://github.com/Hochfrequenz/BO4E-python/issues -license = mit -author = Kevin Krechan -author_email = kevin.krechan@hochfrequenz.de -description = Python Library that implements the BO4E Standard. -long_description = file: README.rst -long_description_content_type = text/x-rst; charset=UTF-8 -platforms = any -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3.10 - -[options] -zip_safe = False -packages = find: -package_dir = = src -include_package_data = True -python_requires = >=3.10 -install_requires = - iso3166 - pydantic>=2.0.0 - pyhumps - -[options.packages.find] -where = src -exclude = - tests - -[options.package_data] -* = py.typed diff --git a/setup.py b/setup.py deleted file mode 100644 index d0df000c5..000000000 --- a/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -import sys - -from setuptools import setup - -min_version = (3, 10) - -if sys.version_info < min_version: - error = f""" -bo4e needs Python {min_version} or above. -You are using Python {sys.version_info} -""".format( - ".".join(str(n) for n in min_version), - ".".join(str(n) for n in sys.version_info[:3]), - ) - sys.exit(error) - -setup(name="bo4e", use_scm_version=True) From e74c26d69bc49040bd0c2157f46666783a04a33e Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 10:40:48 +0200 Subject: [PATCH 03/10] =?UTF-8?q?=F0=9F=A9=B9=20improve=20grammar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index a6cf4ab1e..8fd322ff1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,7 +30,7 @@ # 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. -# Additionally it helps us to avoid running apidoc manually +# Additionally, it helps us to avoid running apidoc manually try: # for Sphinx >= 1.7 from sphinx.ext import apidoc From bb6eb1fb19fd4ca71c7729df63310da301595825 Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 12:44:22 +0200 Subject: [PATCH 04/10] =?UTF-8?q?=F0=9F=99=88=20add=20version=20file=20to?= =?UTF-8?q?=20git=20ignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 9f3741e1d..fcc3b49b0 100644 --- a/.gitignore +++ b/.gitignore @@ -167,3 +167,7 @@ Temporary Items docs/api docs/plantuml.jar docs/_static/images + +# version number for bo4e-python; gets auto-generated during the command +# python -m build +src/_kohlrahbi_version.py From 1e57a37eb889df13331b84a941dfd15291f08bdf Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 28 Sep 2023 12:46:13 +0200 Subject: [PATCH 05/10] =?UTF-8?q?=F0=9F=92=9A=20Update=20GH=20Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-publish.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 689c592a5..2b6f717e5 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -40,13 +40,12 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.10.x" - - name: Install dependencies + - name: Install pip, build and twine run: | - python -m pip install --upgrade pip - pip install setuptools setuptools-scm wheel twine - - name: Build a binary wheel and a source tarball - run: | - python setup.py sdist bdist_wheel + python -m pip install --upgrade --disable-pip-version-check pip + python -m pip install --upgrade build twine + - name: Build wheel and source distributions + run: python -m build - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags/v') uses: pypa/gh-action-pypi-publish@release/v1 From 96b23b7aa5a3c80d8330fe2e50c5dca12ce6b7e0 Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 13:01:50 +0200 Subject: [PATCH 06/10] =?UTF-8?q?=F0=9F=A9=B9=20Change=20name=20for=20vers?= =?UTF-8?q?ion=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fcc3b49b0..6c0160ccf 100644 --- a/.gitignore +++ b/.gitignore @@ -170,4 +170,4 @@ docs/_static/images # version number for bo4e-python; gets auto-generated during the command # python -m build -src/_kohlrahbi_version.py +src/_bo4e_python_version.py diff --git a/pyproject.toml b/pyproject.toml index 18efaa41c..6273f971f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ fragments = [{ path = "README.rst" }] source = "vcs" [tool.hatch.build.hooks.vcs] -version-file = "src/_kohlrahbi_version.py" +version-file = "src/_bo4e_python_version.py" template = ''' version = "{version}" ''' From b7177e07ea914c07cc675dd8ee08151f9fed0c5e Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 13:05:12 +0200 Subject: [PATCH 07/10] =?UTF-8?q?=F0=9F=92=9A=20Use=20extra=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2b6f717e5..734d7ab67 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -40,10 +40,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.10.x" - - name: Install pip, build and twine + - name: Install dependencies run: | - python -m pip install --upgrade --disable-pip-version-check pip - python -m pip install --upgrade build twine + python -m pip install --upgrade pip + pip install -r dev_requirements/requirements-packaging.txt - name: Build wheel and source distributions run: python -m build - name: Publish distribution 📦 to PyPI From 088cc5d7b00994f7df4b0d86f9c8ac77f7930b7d Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 13:05:31 +0200 Subject: [PATCH 08/10] =?UTF-8?q?=F0=9F=A9=B9=20Update=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev_requirements/requirements-packaging.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev_requirements/requirements-packaging.in b/dev_requirements/requirements-packaging.in index ae57afe11..9fef06202 100644 --- a/dev_requirements/requirements-packaging.in +++ b/dev_requirements/requirements-packaging.in @@ -1,3 +1,3 @@ -# requirements for the hatchling build ssystem +# requirements for the hatchling build system +build twine -wheel From c317834d4614f14b56b5c17ec786fc738faa8ed2 Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 13:16:01 +0200 Subject: [PATCH 09/10] =?UTF-8?q?=F0=9F=8E=A8=20Update=20bo4e=20urls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6273f971f..0334a6842 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,8 +27,8 @@ dependencies = [ dynamic = ["readme", "version"] [project.urls] -Changelog = "https://github.com/Hochfrequenz/BO4E-python/releases" -Homepage = "https://github.com/Hochfrequenz/BO4E-python" +Changelog = "https://github.com/bo4e/bo4e-python/releases" +Homepage = "https://github.com/bo4e/bo4e-python" Documentation = "https://bo4e-python.readthedocs.io/en/latest/" [tool.hatch.metadata.hooks.fancy-pypi-readme] From 8ddbcda9ac1e6ed134bc22f51030be4d8357e5a5 Mon Sep 17 00:00:00 2001 From: hf-krechan Date: Thu, 28 Sep 2023 13:20:20 +0200 Subject: [PATCH 10/10] =?UTF-8?q?=F0=9F=93=9D=20add=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 0334a6842..b26e2f609 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] +# This list must be in synq with the ./requirements.in file! dependencies = [ "iso3166", "pydantic>=2.0.0",