Skip to content

Commit

Permalink
Migrate to uv (package & project management) and ruff (formatting + l…
Browse files Browse the repository at this point in the history
…inting)
  • Loading branch information
jherbel committed Jan 13, 2025
1 parent 99899b4 commit ffa18f4
Show file tree
Hide file tree
Showing 16 changed files with 260 additions and 520 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@ on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v5
with:
python-version-file: "pyproject.toml"
version: "latest"

- run: python3 -m pip install poetry
- run: uv sync

- run: poetry install --with dev
- run: uv ruff format --diff

- run: poetry run black --check ./
- run: uv ruff check

- run: poetry run isort --check-only ./
- run: uv run mypy src tests

- run: poetry run mypy ./

- run: poetry run pylint checkmk_weblate_syncer/ tests/

- run: poetry run pytest tests/
- run: uv run pytest
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
477 changes: 0 additions & 477 deletions poetry.lock

This file was deleted.

47 changes: 22 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
[tool.poetry]
[project]
name = "checkmk-weblate-syncer"
version = "0.1.0"
description = ""
authors = ["Joerg Herbel <[email protected]>"]
version = "0.2.0"
description = "Add your description here"
readme = "README.md"
authors = [
{ name = "Jörg Herbel", email = "[email protected]" }
]
requires-python = ">=3.13"
dependencies = [
"gitpython>=3.1.44",
"pydantic>=2.10.5",
]

[tool.poetry.dependencies]
python = "^3.12"
pydantic = "^2.7.1"
gitpython = "^3.1.43"

[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
mypy = "*"
black = "*"
isort = "*"
pylint = "*"
pytest = "*"
[project.scripts]
checkmk-weblate-syncer = "checkmk_weblate_syncer:__main__"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
"mypy>=1.14.1",
"pytest>=8.3.4",
"ruff>=0.9.1",
]

[tool.mypy]
strict = true

[tool.pylint.'MESSAGES CONTROL']
disable = "missing-docstring"

[tool.isort]
profile = "black"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ def run(config: UpdateTranslationsConfig) -> int:

for file_pair in config.po_file_pairs:
LOGGER.info("Processing %s, %s", file_pair.locale, file_pair.checkmk)
match (
result := _process_po_file_pair(
file_pair=file_pair,
checkmk_repo=config.checkmk_repository,
locale_repo=config.locale_repository,
)
match result := _process_po_file_pair(
file_pair=file_pair,
checkmk_repo=config.checkmk_repository,
locale_repo=config.locale_repository,
):
case _Success():
successes.append(result)
Expand Down
225 changes: 225 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit ffa18f4

Please sign in to comment.