Skip to content

Commit

Permalink
build: use dynamic version
Browse files Browse the repository at this point in the history
  • Loading branch information
necusjz committed Dec 11, 2023
1 parent 1a45b7a commit 2e64fd4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
fail-fast: false
matrix:
python: ["3.8", "3.10"]
task:
- name: Test
run: |
pytest -v --color=yes tests/
include:
- python: "3.10"
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "splatbot"
version = "0.1.0"
dynamic = ["version"]
description = "Automate plotting detailed posts in Splatoon wirelessly based on BlueZ, and optimize its efficiency by treating the process as a variant of Traveling Salesman Problem (TSP)."
authors = [{name = "necusjz", email = "[email protected]"}]
requires-python = ">=3.8"
Expand Down Expand Up @@ -33,6 +33,7 @@ repository = "https://github.com/necusjz/splatbot"
[project.optional-dependencies]
dev = [
"build>=1.0.3",
"pytest>=7.2.1",
"twine>=1.11.0",
]

Expand All @@ -44,3 +45,6 @@ exclude = [
"tests*",
"vagrant*",
]

[tool.setuptools.dynamic]
version = {attr = "src.splatbot.version.VERSION"}
11 changes: 11 additions & 0 deletions src/splatbot/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_MAJOR = "0"
_MINOR = "1"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "0"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""

VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR)
VERSION = "{0}.{1}.{2}{3}".format(_MAJOR, _MINOR, _PATCH, _SUFFIX)

0 comments on commit 2e64fd4

Please sign in to comment.