From e28f1eca8478cf6ec78d8ace87397baeea2a304c Mon Sep 17 00:00:00 2001 From: Philipp A Date: Thu, 14 Mar 2024 18:17:03 +0100 Subject: [PATCH] Release workflow (#20) * VCS versioning * Add publish workflow --- .github/workflows/publish.yml | 21 +++++++++++++++++++++ pyproject.toml | 7 +++++-- 2 files changed, 26 insertions(+), 2 deletions(-) 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..c679730 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Publish Python Package + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write # to authenticate as Trusted Publisher to pypi.org + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + cache: "pip" + - run: pip install build + - run: python -m build + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 529934b..7870564 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [project] name = "sklearn-ann" -version = "0.1.0" description = "Various integrations for ANN (Approximate Nearest Neighbours) libraries into scikit-learn." authors = [ { name = "Frankie Robertson", email = "frankie@robertson.name" }, { name = "Philipp Angerer", email = "phil.angerer@gmail.com" } ] license = "BSD-3-Clause" +dynamic = ["version"] requires-python = "<3.13,>=3.9" # enforced by scipy dependencies = [ "scikit-learn>=0.24.0", @@ -43,6 +43,9 @@ annlibs = [ "sklearn-ann[annoy,faiss,pynndescent,nmslib]", ] +[tool.hatch.version] +source = "vcs" + [tool.pytest.ini_options] addopts = [ "--import-mode=importlib", @@ -88,5 +91,5 @@ build-docs = "sphinx-build -M html docs docs/_build" packages = ["src/sklearn_ann"] [build-system] -requires = ["hatchling"] +requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build"