sync version between manifests

add pyproject-fmt to pre-commit config
This commit is contained in:
2026-09-15 08:24:26 +01:00
parent 8a3647fcb6
commit 0ff628a902
5 changed files with 39 additions and 24 deletions
+5
View File
@@ -6,3 +6,8 @@ repos:
entry: pixi run sync entry: pixi run sync
language: system language: system
stages: [pre-commit] stages: [pre-commit]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 'v2.29.4'
hooks:
- id: pyproject-fmt
Generated
+1 -1
View File
@@ -261,7 +261,7 @@ packages:
timestamp: 1780853175566 timestamp: 1780853175566
- conda: . - conda: .
name: bible name: bible
version: 0.1.0 version: 0.2.0
build: pyh4616a5c_0 build: pyh4616a5c_0
subdir: noarch subdir: noarch
variants: variants:
+2 -4
View File
@@ -2,6 +2,8 @@
channels = ["https://prefix.dev/conda-forge"] channels = ["https://prefix.dev/conda-forge"]
platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"] platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"]
preview = ["pixi-build"] preview = ["pixi-build"]
name = "bible"
version = "0.2.0"
[tasks] [tasks]
cli = "bible-cli" cli = "bible-cli"
@@ -16,10 +18,6 @@ ruff = ">=0.16.7,<0.17"
[dependencies.bible] [dependencies.bible]
path = "." path = "."
[package]
name = "bible"
version = "0.1.0"
[package.build.backend] [package.build.backend]
name = "pixi-build-python" name = "pixi-build-python"
version = "0.4.*" version = "0.4.*"
+22 -17
View File
@@ -1,21 +1,26 @@
[build-system]
build-backend = "hatchling.build"
requires = [ "hatchling" ]
[project] [project]
name = "bible" name = "bible"
version = "0.1.0" version = "0.2.0"
requires-python = ">=3.11" requires-python = ">=3.11"
dependencies = [ classifiers = [
"textual>=8.0.0", "Programming Language :: Python :: 3 :: Only",
"niquests>=3.21.1,<4", "Programming Language :: Python :: 3.11",
"clypi>=1.9.1,<2", "Programming Language :: Python :: 3.12",
"pydantic-settings>=2.15.0,<3", "Programming Language :: Python :: 3.13",
"rich>=15.0.0,<16", "Programming Language :: Python :: 3.14",
"loguru>=0.7.3,<0.8",
"beautifulsoup4>=4.15.0,<5",
] ]
dependencies = [
[project.scripts] "beautifulsoup4>=4.15,<5",
bible-tui = "bible.tui.tui:main" "clypi>=1.9.1,<2",
bible-cli = "bible.cli.cli:main" "loguru>=0.7.3,<0.8",
"niquests>=3.21.1,<4",
[build-system] "pydantic-settings>=2.15,<3",
requires = ["hatchling"] "rich>=15,<16",
build-backend = "hatchling.build" "textual>=8",
]
scripts.bible-cli = "bible.cli.cli:main"
scripts.bible-tui = "bible.tui.tui:main"
+9 -2
View File
@@ -12,7 +12,13 @@ pixi = tomllib.loads(pixi_path.read_text())
pyproject = tomllib.loads(pyproject_path.read_text()) pyproject = tomllib.loads(pyproject_path.read_text())
# --- Sync version --- # --- Sync version ---
pixi_version = pixi['package']['version'] if 'workspace' in pixi and 'version' in pixi['workspace']:
pixi_version = pixi['workspace']['version']
elif 'package' in pixi and 'version' in pixi['package']:
pixi_version = pixi['package']['version']
else:
raise KeyError('No version found in pixi.toml under [workspace] or [package].')
pyproject['project']['version'] = pixi_version pyproject['project']['version'] = pixi_version
# --- Sync only [package.run-dependencies] --- # --- Sync only [package.run-dependencies] ---
@@ -26,5 +32,6 @@ pixi_path.write_text(tomlkit.dumps(pixi))
pyproject_path.write_text(tomlkit.dumps(pyproject)) pyproject_path.write_text(tomlkit.dumps(pyproject))
print( print(
f'Synced version {pixi_version} and {len(runtime_deps)} runtime dependencies from [package.run-dependencies].' f'Synced version {pixi_version} and {len(runtime_deps)} runtime dependencies '
'from [package.run-dependencies].'
) )