From a894f2ea47b0a3edec3979be48978e8cdefa9e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:34:08 -0600 Subject: [PATCH] chore: Use dynamic versioning (#367) --- .github/workflows/build.yaml | 42 ++++++++++++++++++------------------ .pre-commit-config.yaml | 5 +++++ pyproject.toml | 16 +++++++++++--- tap_stackexchange/tap.py | 2 +- 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 063b1f9..aa63f7e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,25 +16,25 @@ jobs: fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v2 -# publish: -# runs-on: ubuntu-latest -# needs: build -# environment: -# name: publishing -# url: https://pypi.org/project/tap-stackexchange/ -# if: startsWith(github.ref, 'refs/tags/') -# steps: -# - uses: actions/download-artifact@v4 -# with: -# name: Packages -# path: dist -# - name: Upload wheel to release -# uses: svenstaro/upload-release-action@v2 -# with: -# file: dist/*.whl -# tag: ${{ github.ref }} -# overwrite: true -# file_glob: true + publish: + runs-on: ubuntu-latest + needs: build + environment: + name: publishing + url: https://pypi.org/project/tap-stackexchange/ + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + - name: Upload wheel to release + uses: svenstaro/upload-release-action@v2 + with: + file: dist/*.whl + tag: ${{ github.ref }} + overwrite: true + file_glob: true -# - name: Publish -# uses: pypa/gh-action-pypi-publish@v1.8.11 + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.8.11 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd14cae..4febff4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,11 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace +- repo: https://github.com/tox-dev/pyproject-fmt + rev: "1.5.3" + hooks: + - id: pyproject-fmt + - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: 'v0.1.13' diff --git a/pyproject.toml b/pyproject.toml index e933d14..d0fe174 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tap-stackexchange" -version = "0.0.1" +version = "0.0.0" description = "`tap-stackexchange` is a Singer tap for StackExchange, built with the Meltano SDK for Singer Taps." authors = ["Edgar Ramírez-Mondragón "] classifiers = [ @@ -13,6 +13,8 @@ classifiers = [ ] keywords = [ "ELT", + "meltano", + "singer-io", "StackExchange", ] license = "Apache-2.0" @@ -35,13 +37,21 @@ module = [ ignore_missing_imports = true [build-system] -requires = ["poetry-core==1.8.1"] -build-backend = "poetry.core.masonry.api" +build-backend = "poetry_dynamic_versioning.backend" +requires = [ + "poetry-core==1.8.1", + "poetry-dynamic-versioning==1.2", +] [tool.poetry.scripts] # CLI declaration tap-stackexchange = 'tap_stackexchange.tap:TapStackExchange.cli' +[tool.poetry-dynamic-versioning] +enable = true +metadata = true +style = "pep440" + [tool.ruff] line-length = 88 target-version = "py38" diff --git a/tap_stackexchange/tap.py b/tap_stackexchange/tap.py index cdd45d9..db684c3 100644 --- a/tap_stackexchange/tap.py +++ b/tap_stackexchange/tap.py @@ -47,7 +47,7 @@ class TapStackExchange(Tap): th.Property( "tags", th.ArrayType(th.StringType), - default=["LimeSurvey"], + default=[], description="Question tags", ), th.Property(