From 434a17e2ef7f9cac3f18e35e6ed4321c5587263a Mon Sep 17 00:00:00 2001 From: James Whale Date: Tue, 18 Oct 2022 22:18:41 +0100 Subject: [PATCH 1/4] change packaging to toml file --- .github/workflows/test-python-publish.yml | 8 +++---- pyproject.toml | 21 ++++++++++++++++ setup.py | 29 ----------------------- 3 files changed, 25 insertions(+), 33 deletions(-) delete mode 100644 setup.py diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml index e28e6cd..a1dbbea 100644 --- a/.github/workflows/test-python-publish.yml +++ b/.github/workflows/test-python-publish.yml @@ -21,12 +21,12 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + python3 -m pip install --upgrade pip + python3 -m pip install build wheel twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel - twine upload --repository testpypi dist/* + python3 -m build + python3 -m twine upload --repository testpypi dist/* diff --git a/pyproject.toml b/pyproject.toml index e89202a..a794e3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,27 @@ requires = [ ] build-backend = "setuptools.build_meta" +[project] +name = "librenms-handler" +version = "0.4.2" +authors = [ + { name="James Whale", email="james@james-whale.com" }, +] +description = "A Python library to interact with the LibreNMS API (v0)" +readme = "README.md" +requires-python = ">=3.6" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", +] +dependencies = [ + "requests" +] + +[project.urls] +"Homepage" = "https://github.com/WhaleJ84/librenms_handler" +"Bug Tracker" = "https://github.com/WhaleJ84/librenms_handler/issues" + [tool.pylint.FORMAT] max-line-length=120 min-similarity-lines=5 diff --git a/setup.py b/setup.py deleted file mode 100644 index 0400b37..0000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -from setuptools import find_packages, setup - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - -setup( - name="librenms-handler", - version="0.4.1", - author="James Whale", - author_email="james@james-whale.com", - description="A Python library to interact with the LibreNMS API (v0)", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/WhaleJ84/librenms_handler", - project_urls={ - "Bug Tracker": "https://github.com/WhaleJ84/librenms_handler/issues", - }, - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - ], - package_dir={"": "src"}, - packages=find_packages( - where="src", - include="Pipfile" - ), - python_requires=">=3.6", -) - From 086b46462984fc3ab3594218671a38b185013114 Mon Sep 17 00:00:00 2001 From: James Whale Date: Tue, 18 Oct 2022 22:20:25 +0100 Subject: [PATCH 2/4] changed version for test release --- .github/workflows/test-python-publish.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml index a1dbbea..66ec281 100644 --- a/.github/workflows/test-python-publish.yml +++ b/.github/workflows/test-python-publish.yml @@ -6,7 +6,7 @@ name: Upload Test Python Package on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+-*' + - 'v[0-9]+.[0-9]+.[0-9]+.*' jobs: deploy: diff --git a/pyproject.toml b/pyproject.toml index a794e3c..a766d6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "librenms-handler" -version = "0.4.2" +version = "0.4.2.1" authors = [ { name="James Whale", email="james@james-whale.com" }, ] From c427fce7d3e7cfbe634664bfb917fdd66f191f71 Mon Sep 17 00:00:00 2001 From: James Whale Date: Wed, 19 Oct 2022 19:39:55 +0100 Subject: [PATCH 3/4] changing ci to address #126 --- .github/workflows/python-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1a03a7b..11a130f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -20,12 +20,12 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + python3 -m pip install --upgrade pip + python3 -m pip install build wheel twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel - twine upload dist/* + python3 -m build + python3 -m twine upload dist/* From e25ba54bdf70f6e17b1c1edbff239c066311f044 Mon Sep 17 00:00:00 2001 From: James Whale Date: Wed, 19 Oct 2022 19:41:27 +0100 Subject: [PATCH 4/4] changed version for release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a766d6f..a794e3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "librenms-handler" -version = "0.4.2.1" +version = "0.4.2" authors = [ { name="James Whale", email="james@james-whale.com" }, ]