Skip to content

Commit

Permalink
fix setuptools scm config (#30)
Browse files Browse the repository at this point in the history
* fix setuptools scm config

* uv sync

* nocov

* relock

* check lock first?

* remove setuptools scm

* fix setuptools scm + uv

* enable dynamic versioning on release
  • Loading branch information
rmorshea authored Nov 24, 2024
1 parent 332f3aa commit 54af92d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
run: uv python install ${{ matrix.python-version }}
- name: Build package
run: uv build
- name: Enable dynamic versioning (https://github.com/astral-sh/uv/issues/7533)
run: echo "[tool.setuptools_scm]" >> pyproject.toml
- name: Publish package
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Dependency injection without the boilerplate.

## Install
## Installation

```bash
pip install -U pybooster
Expand Down
4 changes: 2 additions & 2 deletions project.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def lint(
no_yml_style: bool,
):
"""Linting commands."""
if not no_uv_locked:
run(["uv", "lock", "--locked"])
if not no_py_style:
if check:
run(["ruff", "format", "--check", "--diff"])
Expand All @@ -96,8 +98,6 @@ def lint(
run(["yamlfix", "docs", ".github"])
if not no_py_types:
run(["pyright"])
if not no_uv_locked:
run(["uv", "sync", "--locked"])


@main.group("docs")
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

[tool.uv]
default-groups = ["all"]
cache-keys = [{ file = "pyproject.toml" }, { git = true }]

[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
Expand All @@ -9,7 +10,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pybooster"
dynamic = ["version"]
description = "A dependency injection framework for Python using type hints."
description = "Dependency injection without the boilerplate."
readme = "README.md"
requires-python = ">=3.11,<4"
license = { file = "LICENSE.txt" }
Expand Down
8 changes: 7 additions & 1 deletion src/pybooster/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version

from pybooster.core import injector
from pybooster.core import provider
from pybooster.core.injector import required
from pybooster.core.solution import solved

__version__ = "0.0.1"
try:
__version__ = version(__name__)
except PackageNotFoundError: # nocov
__version__ = "0.0.0"

__all__ = (
"injector",
Expand Down

0 comments on commit 54af92d

Please sign in to comment.