Skip to content

Commit

Permalink
Release workflow (#20)
Browse files Browse the repository at this point in the history
* VCS versioning

* Add publish workflow
  • Loading branch information
flying-sheep authored Mar 14, 2024
1 parent 378c01a commit e28f1ec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
{ name = "Philipp Angerer", email = "[email protected]" }
]
license = "BSD-3-Clause"
dynamic = ["version"]
requires-python = "<3.13,>=3.9" # enforced by scipy
dependencies = [
"scikit-learn>=0.24.0",
Expand Down Expand Up @@ -43,6 +43,9 @@ annlibs = [
"sklearn-ann[annoy,faiss,pynndescent,nmslib]",
]

[tool.hatch.version]
source = "vcs"

[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
Expand Down Expand Up @@ -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"

0 comments on commit e28f1ec

Please sign in to comment.