diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cce5cc6..5e78bc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,3 +6,8 @@ repos: entry: pixi run sync language: system stages: [pre-commit] + + - repo: https://github.com/tox-dev/pyproject-fmt + rev: 'v2.29.4' + hooks: + - id: pyproject-fmt diff --git a/pixi.lock b/pixi.lock index e2b1df6..db4f608 100644 --- a/pixi.lock +++ b/pixi.lock @@ -261,7 +261,7 @@ packages: timestamp: 1780853175566 - conda: . name: bible - version: 0.1.0 + version: 0.2.0 build: pyh4616a5c_0 subdir: noarch variants: diff --git a/pixi.toml b/pixi.toml index a82333e..256dde3 100644 --- a/pixi.toml +++ b/pixi.toml @@ -2,6 +2,8 @@ channels = ["https://prefix.dev/conda-forge"] platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"] preview = ["pixi-build"] +name = "bible" +version = "0.2.0" [tasks] cli = "bible-cli" @@ -16,10 +18,6 @@ ruff = ">=0.16.7,<0.17" [dependencies.bible] path = "." -[package] -name = "bible" -version = "0.1.0" - [package.build.backend] name = "pixi-build-python" version = "0.4.*" diff --git a/pyproject.toml b/pyproject.toml index 6f8a930..714b7ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,26 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ "hatchling" ] + [project] name = "bible" -version = "0.1.0" +version = "0.2.0" requires-python = ">=3.11" -dependencies = [ - "textual>=8.0.0", - "niquests>=3.21.1,<4", - "clypi>=1.9.1,<2", - "pydantic-settings>=2.15.0,<3", - "rich>=15.0.0,<16", - "loguru>=0.7.3,<0.8", - "beautifulsoup4>=4.15.0,<5", +classifiers = [ + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] - -[project.scripts] -bible-tui = "bible.tui.tui:main" -bible-cli = "bible.cli.cli:main" - -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +dependencies = [ + "beautifulsoup4>=4.15,<5", + "clypi>=1.9.1,<2", + "loguru>=0.7.3,<0.8", + "niquests>=3.21.1,<4", + "pydantic-settings>=2.15,<3", + "rich>=15,<16", + "textual>=8", +] +scripts.bible-cli = "bible.cli.cli:main" +scripts.bible-tui = "bible.tui.tui:main" diff --git a/scripts/sync_manifests.py b/scripts/sync_manifests.py index 6d12f33..8fb6421 100755 --- a/scripts/sync_manifests.py +++ b/scripts/sync_manifests.py @@ -12,7 +12,13 @@ pixi = tomllib.loads(pixi_path.read_text()) pyproject = tomllib.loads(pyproject_path.read_text()) # --- 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 # --- Sync only [package.run-dependencies] --- @@ -26,5 +32,6 @@ pixi_path.write_text(tomlkit.dumps(pixi)) pyproject_path.write_text(tomlkit.dumps(pyproject)) 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].' )