Automate khoj python package versioning using hatch-vcs and Git tags

This commit is contained in:
Debanjum Singh Solanky 2023-02-17 17:08:05 -06:00
parent 053d6141f3
commit a8940462c4
2 changed files with 6 additions and 12 deletions

View file

@ -35,16 +35,6 @@ jobs:
- name: Install Application
run: python -m pip install --upgrade pip && pip install --upgrade .
- name: 📝 Set Pre-Release Version for Master
if: github.ref == 'refs/heads/master'
run: sed -E -i "s/version = (.*)\"/version = \1a$(date +%s)\"/g" pyproject.toml
- name: 📝 Set Development Version for PR
if: github.event_name == 'pull_request'
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}
run: sed -E -i "s/version = (.*)\"/version = \1.dev$PULL_REQUEST_NUMBER$(date +%s)\"/g" pyproject.toml
- name: ⚙️ Build Python Package
run: |
# Setup Environment for Reproducible Builds

View file

@ -1,10 +1,9 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "khoj-assistant"
version = "0.3.0"
description = "A natural language search engine for your personal notes, transactions and images"
readme = "README.md"
license = "GPL-3.0-or-later"
@ -52,6 +51,7 @@ dependencies = [
"torch == 1.13.1",
"uvicorn == 0.17.6",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/debanjum/khoj#readme"
@ -73,6 +73,10 @@ dev = [
"pre-commit >= 3.0.4",
]
[tool.hatch.version]
source = "vcs"
raw-options.local_scheme = "no-local-version" # PEP440 compliant version for PyPi
[tool.hatch.build.targets.sdist]
include = ["src/khoj"]