diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 97713dc..062e63e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11", "3.12", "3.13"] + python-version: ["3.11", "3.13"] steps: - uses: MathRobin/timezone-action@v1.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cd4b474 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Create release + +on: + push: + tags: + - '*.*.*' + +permissions: + contents: write + +jobs: + tests: + uses: ./.github/workflows/pytest.yml + release: + name: Release pushed tag + needs: [tests] + runs-on: ubuntu-22.04 + steps: + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + run: | + gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ + --generate-notes + publish: + name: Publish to PyPI + needs: [tests] # require tests to pass before deploy runs + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Build package + run: | + python -m pip install -U pip build + python -m build + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.PYPI_KEY }} \ No newline at end of file diff --git a/irm_kmi_api/__init__.py b/irm_kmi_api/__init__.py index e69de29..541f859 100644 --- a/irm_kmi_api/__init__.py +++ b/irm_kmi_api/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.0' \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b94ba41 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,46 @@ +[build-system] +requires = ["setuptools>=61.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "irm-kmi-api" +version = "0.1.0" +description = "Retrieve data from the Belgian IRM KMI in Python" +readme = "README.md" +authors = [{ name = "Jules Dejaeghere", email = "curable.grass491@mailer.me" }] +license = { file = "LICENSE" } +classifiers = [ + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +] +keywords = ["weather", "weather-api", "netherlands", "weather-forecast", "pollen", "belgium", "luxembourg", "rain-radar"] +dependencies = [ + "aiohttp==3.11.13", + "async-timeout==4.0.3", + "svgwrite==1.4.3", +] +requires-python = ">=3.11" + +[project.urls] +Homepage = "https://github.com/jdejaegh/irm-kmi-api" + +[tool.bumpver] +current_version = "0.1.0" +version_pattern = "MAJOR.MINOR.PATCH" +commit_message = "bump version {old_version} -> {new_version}" +tag_message = "{new_version}" +tag_scope = "default" +pre_commit_hook = "" +post_commit_hook = "" +commit = true +tag = true +push = true + +[tool.bumpver.file_patterns] +"pyproject.toml" = [ + 'current_version = "{version}"', + 'version = "{version}"' +] +"irm_kmi_api/__init__.py" = ["{version}"] +