Skip to content

Commit e28f1ec

Browse files
authored
Release workflow (#20)
* VCS versioning * Add publish workflow
1 parent 378c01a commit e28f1ec

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
environment: pypi
11+
permissions:
12+
id-token: write # to authenticate as Trusted Publisher to pypi.org
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.x"
18+
cache: "pip"
19+
- run: pip install build
20+
- run: python -m build
21+
- uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
name = "sklearn-ann"
3-
version = "0.1.0"
43
description = "Various integrations for ANN (Approximate Nearest Neighbours) libraries into scikit-learn."
54
authors = [
65
{ name = "Frankie Robertson", email = "[email protected]" },
76
{ name = "Philipp Angerer", email = "[email protected]" }
87
]
98
license = "BSD-3-Clause"
9+
dynamic = ["version"]
1010
requires-python = "<3.13,>=3.9" # enforced by scipy
1111
dependencies = [
1212
"scikit-learn>=0.24.0",
@@ -43,6 +43,9 @@ annlibs = [
4343
"sklearn-ann[annoy,faiss,pynndescent,nmslib]",
4444
]
4545

46+
[tool.hatch.version]
47+
source = "vcs"
48+
4649
[tool.pytest.ini_options]
4750
addopts = [
4851
"--import-mode=importlib",
@@ -88,5 +91,5 @@ build-docs = "sphinx-build -M html docs docs/_build"
8891
packages = ["src/sklearn_ann"]
8992

9093
[build-system]
91-
requires = ["hatchling"]
94+
requires = ["hatchling", "hatch-vcs"]
9295
build-backend = "hatchling.build"

0 commit comments

Comments
 (0)