Skip to content

Commit

Permalink
get version dynamically from git
Browse files Browse the repository at this point in the history
  • Loading branch information
palotasb committed Mar 26, 2024
1 parent 7bba044 commit 0fb4224
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 19 deletions.
55 changes: 49 additions & 6 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*/boldi/_*version.py
11 changes: 9 additions & 2 deletions pkg/boldi-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "boldi-cli"
version = "0.1.1"
description = "boldi.cli part of Boldi's Python libraries"
authors = [
{ name = "Boldizsár Palotás", email = "[email protected]" },
]
requires-python = ">=3.9"
readme = "../../README.md"
license = { text = "MIT" }
dynamic = ["version"]

dependencies = ["boldi-ctx", "rich"]
optional-dependencies = {}
Expand All @@ -19,12 +19,19 @@ boldi = "boldi.cli:main"
help = "boldi.cli:HelpCliAction"

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build]
packages = ["boldi"]

[tool.hatch.build.hooks.vcs]
version-file = "boldi/_cli_version.py"

[tool.hatch.version]
source = "vcs"
raw-options = { "root" = "../.." }

[tool.pdm]

[tool.pdm.dev-dependencies]
11 changes: 9 additions & 2 deletions pkg/boldi-ctx/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
[project]
name = "boldi-ctx"
version = "0.1.1"
description = "boldi.ctx part of Boldi's Python libraries"
authors = [
{ name = "Boldizsár Palotás", email = "[email protected]" },
]
requires-python = ">=3.9"
readme = "../../README.md"
license = { text = "MIT" }
dynamic = ["version"]

dependencies = ["typing_extensions"]
optional-dependencies = {}

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build]
packages = ["boldi"]

[tool.hatch.build.hooks.vcs]
version-file = "boldi/_ctx_version.py"

[tool.hatch.version]
source = "vcs"
raw-options = { "root" = "../.." }

[tool.pdm]

[tool.pdm.dev-dependencies]
11 changes: 9 additions & 2 deletions pkg/boldi-dev/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "boldi-dev"
version = "0.1.1"
description = "boldi.dev part of Boldi's Python libraries"
authors = [
{ name = "Boldizsár Palotás", email = "[email protected]" },
]
requires-python = ">=3.9"
readme = "../../README.md"
license = { text = "MIT" }
dynamic = ["version"]

dependencies = [
# boldi:
Expand All @@ -24,12 +24,19 @@ optional-dependencies = {}
dev = "boldi.dev:DevCliAction"

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build]
packages = ["boldi"]

[tool.hatch.build.hooks.vcs]
version-file = "boldi/_dev_version.py"

[tool.hatch.version]
source = "vcs"
raw-options = { "root" = "../.." }

[tool.pdm]

[tool.pdm.dev-dependencies]
11 changes: 9 additions & 2 deletions pkg/boldi-plugins/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
[project]
name = "boldi-plugins"
version = "0.1.1"
description = "boldi.plugins part of Boldi's Python libraries"
authors = [
{name = "Boldizsár Palotás", email = "[email protected]"},
]
requires-python = ">=3.9"
readme = "../../README.md"
license = { text = "MIT" }
dynamic = ["version"]

dependencies = [
"backports.entry-points-selectable",
]
optional-dependencies = {}

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build]
packages = ["boldi"]

[tool.hatch.build.hooks.vcs]
version-file = "boldi/_plugins_version.py"

[tool.hatch.version]
source = "vcs"
raw-options = { "root" = "../.." }

[tool.pdm]

[tool.pdm.dev-dependencies]
Empty file added pkg/boldi/boldi/.keep
Empty file.
11 changes: 9 additions & 2 deletions pkg/boldi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "boldi"
version = "0.1.1"
description = "Boldi's Python libraries"
authors = [
{ name = "Boldizsár Palotás", email = "[email protected]" },
]
requires-python = ">=3.9"
readme = "../../README.md"
license = { text = "MIT" }
dynamic = ["version"]

dependencies = [
# boldi libs:
Expand All @@ -18,12 +18,19 @@ dependencies = [
optional-dependencies = { dev = ["boldi-dev"] }

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build]
packages = ["boldi"]

[tool.hatch.build.hooks.vcs]
version-file = "boldi/_version.py"

[tool.hatch.version]
source = "vcs"
raw-options = { "root" = "../.." }

[tool.pdm]

[tool.pdm.dev-dependencies]
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "boldi-devmetapackage"
version = "0.1.1"
description = "Development Metapackage for Boldi's Python libraries"
authors = [
{ name = "Boldizsár Palotás", email = "[email protected]" },
]
requires-python = ">=3.9"
readme = "README.md"
license = { file = "LICENSE" }
dynamic = ["version"]

# Intentionally no dependencies as this is just a development metapackage.
# this just includes the real packages (boldi, boldi-cli, etc.) as dev-dependencies,
Expand All @@ -16,11 +16,14 @@ dependencies = []
optional-dependencies = {}

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

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

[tool.hatch.build]
packages = ["boldi"]
packages = ["."]

[tool.pdm]

Expand All @@ -39,6 +42,7 @@ dev = [
# building and packaging:
"pdm",
"hatchling",
"hatch-vcs",
"build",
]

Expand Down

0 comments on commit 0fb4224

Please sign in to comment.