From d0118b29baa20fcc5bbe09e944f2e2ff97011bc2 Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Thu, 29 Aug 2024 06:51:13 +0000 Subject: [PATCH 1/8] add pypi publishing workflow --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..61f20d7 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish release to PyPI + +on: + release: + types: [created] + +jobs: + pypi-publish: + name: Publish release to PyPI + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/mcclient-lib + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + + - name: Build package + run: | + python -m build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v \ No newline at end of file From 7e14b4d6b634c9fb8c7903f9bda30581f84cb330 Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Thu, 29 Aug 2024 06:55:32 +0000 Subject: [PATCH 2/8] fix typo in action version number --- .github/workflows/publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 61f20d7..b83ea80 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,8 +27,7 @@ jobs: pip install setuptools wheel - name: Build package - run: | - python -m build + run: python -m build - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file From ea8ac6ac7c6c209a6cd7856edbe6807dcbdc3abb Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Thu, 29 Aug 2024 07:07:57 +0000 Subject: [PATCH 3/8] add missing build dependencies --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b83ea80..1700751 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel + pip install build - name: Build package run: python -m build From 5830c8af228dd5231137d65c56d2fece8be8b6d0 Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Thu, 29 Aug 2024 07:17:29 +0000 Subject: [PATCH 4/8] remove set version from project file --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2cf9e02..e61433b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,6 @@ description = "A lightweight Minecraft client for querying the status data of a name = "mcclient-lib" readme = "README.md" requires-python = ">=3.7" -version = "1.2.0" [project.urls] "Bug Tracker" = "https://github.com/sch8ill/mcclient-lib/issues" From ea40eb78c8349233f5937b448738cb7628390378 Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Thu, 29 Aug 2024 07:53:49 +0000 Subject: [PATCH 5/8] use setuptools-scm for version incremention --- .github/workflows/publish.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1700751..02d11d4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build + pip install build setuptools-scm - name: Build package run: python -m build diff --git a/pyproject.toml b/pyproject.toml index e61433b..afba307 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools>=61.0"] +requires = ["setuptools>=61.0", "setuptools_scm>=8"] [project] authors = [{ name = "Sch8ill", email = "noreply@noreply.com" }, From b589b4269a29c3fd9f5c283b073d4961f6162539 Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Thu, 29 Aug 2024 07:59:47 +0000 Subject: [PATCH 6/8] set version as dynamic --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index afba307..61ff306 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ requires = ["setuptools>=61.0", "setuptools_scm>=8"] [project] authors = [{ name = "Sch8ill", email = "noreply@noreply.com" }, ] +dynamic = ["version"] classifiers = ["Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", From d04a254be05e886d4ad3fa3dbf21749dc4a92a53 Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Thu, 29 Aug 2024 08:12:20 +0000 Subject: [PATCH 7/8] force action to clone entire repo --- .github/workflows/publish.yml | 4 ++++ pyproject.toml | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 02d11d4..c13a9df 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,8 +14,12 @@ jobs: url: https://pypi.org/p/mcclient-lib permissions: id-token: write + steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 61ff306..6e726e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,8 +10,7 @@ classifiers = ["Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -dependencies = ["dnspython>=2.2.1", -] +dependencies = ["dnspython>=2.2.1"] description = "A lightweight Minecraft client for querying the status data of a Minecraft server." name = "mcclient-lib" readme = "README.md" From cf3877cf1c93111f1821703d5590e8f360700780 Mon Sep 17 00:00:00 2001 From: Sch8ill <92382209+Sch8ill@users.noreply.github.com> Date: Sat, 31 Aug 2024 01:21:52 +0200 Subject: [PATCH 8/8] add setuptools_scm config --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6e726e3..97a67e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ requires-python = ">=3.7" [project.urls] "Bug Tracker" = "https://github.com/sch8ill/mcclient-lib/issues" -"Homepage" = "https://github.com/Sch8ill/mcclient-lib" +"Homepage" = "https://github.com/sch8ill/mcclient-lib" [tool.pytest.ini_options] addopts = "--cov=mcclient --ignore=examples" @@ -27,3 +27,6 @@ minversion = "6.0" [tool.mypy] check_untyped_defs = true exclude = ["tests"] + +[tool.setuptools_scm] +version_scheme = "post-release"