Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/localize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ jobs:
run: |
uv sync --project .lizardbyte-common --frozen --only-group locale \
--python "${PYTHON_VERSION}" \
--no-python-downloads \
--no-install-project
--no-python-downloads

- name: Set up xgettext
run: |
Expand Down Expand Up @@ -87,7 +86,7 @@ jobs:
echo "NEW_FILE=${new_file}" >> "${GITHUB_ENV}"

uv run --project .lizardbyte-common --frozen --only-group locale --no-sync \
python .lizardbyte-common/scripts/localize.py --root-dir "${GITHUB_WORKSPACE}" --extract
lb-localize --root-dir "${GITHUB_WORKSPACE}" --extract

- name: git diff
if: env.NEW_FILE == 'false'
Expand Down
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,51 @@ uv sync --locked
Run the clang-format helper:

```bash
uv run --locked python scripts/update_clang_format.py
uv run --locked --only-group c lb-update-clang-format
```

Run gettext extraction:

```bash
uv run --locked --only-group locale python scripts/localize.py --extract
uv run --locked --only-group locale lb-localize --extract
```

## Consuming Projects

Projects with a `pyproject.toml` can use this repository as a local path dependency. For a submodule at
`third-party/lizardbyte-common`, add the dependency and source to the consuming project's `pyproject.toml`:

```toml
[project]
dependencies = [
"lizardbyte-common[c]",
]

[tool.uv.sources]
lizardbyte-common = { path = "third-party/lizardbyte-common" }
```

Then sync and run the installed commands from the consuming project root:

```bash
uv sync --python 3.14
uv run lb-update-clang-format
uv run lb-localize --extract
```

Projects without a `pyproject.toml` can still create a `.venv` in the consuming project root and install
the local checkout into it:

```bash
uv venv --python 3.14
uv pip install --editable "third-party/lizardbyte-common[c]"
```

Then run the commands from the consuming project root:

```bash
lb-update-clang-format
lb-localize --extract
```

## Workflows
Expand Down
35 changes: 34 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,39 @@ authors = [
]
dependencies = []

[project.scripts]
lb-localize = "scripts.localize:main"
lb-update-clang-format = "scripts.update_clang_format:main"

[project.optional-dependencies]
dev = [
"lizardbyte-common[c]",
"lizardbyte-common[lint-python]",
"lizardbyte-common[test-python]",
]
c = [
"lizardbyte-common[lint-c]",
"lizardbyte-common[locale]",
"lizardbyte-common[test-c]",
]
lint-c = [
"clang-format==21.1.8",
"cmakelang==0.6.13",
]
lint-python = [
"flake8==7.3.0",
]
locale = [
"babel==2.18.0",
]
test-c = [
"gcovr==8.6",
]
test-python = [
"pytest==9.0.3",
"pytest-cov==7.1.0",
]

[dependency-groups]
dev = [
{include-group = "c"},
Expand Down Expand Up @@ -48,7 +81,7 @@ Repository = "https://github.com/LizardByte/lizardbyte-common"
Issues = "https://github.com/LizardByte/lizardbyte-common/issues"

[tool.setuptools]
py-modules = []
packages = ["scripts"]

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
1 change: 1 addition & 0 deletions scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Shared LizardByte command modules."""
50 changes: 50 additions & 0 deletions uv.lock

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

Loading