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
56 changes: 30 additions & 26 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b
with:
check-latest: true
python-version: '3.13'
python-version: '3.14'
version: '0.9.16'

- name: Install Python
run: uv python install "$UV_PYTHON"

- name: Run pre-commit
uses: pre-commit/action@v3.0.1
run: uv tool run --with pre-commit-uv pre-commit run --show-diff-on-failure --color=always --all-files

test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
Expand All @@ -33,28 +36,29 @@ jobs:
- ubuntu-latest
- windows-latest
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b
with:
allow-prereleases: true
check-latest: true
python-version: ${{ matrix.python-version }}
version: '0.9.16'

- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install
run: |
python -m pip install .[chameleon,dev]
- name: Install dependencies
run: uv sync --frozen --extra chameleon --link-mode=copy

- name: Run tests
run: python -m pytest -v
run: uv run --no-sync pytest -v

publish:
name: Publish to PyPI
Expand All @@ -65,20 +69,20 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python 3.12
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b
with:
check-latest: true
python-version: "3.12"
python-version: '3.14'
version: '0.9.16'

- name: Install Python
run: uv python install "$UV_PYTHON"

- name: Build wheel
run: |
python -m pip install build
python -m build
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.cache
/.Python
/src/lingva.egg-info
/bin/
/build
/dist
Expand All @@ -18,6 +17,7 @@
*.pyo
*.pyc
*.egg
*.egg-info
*.swp
.vscode
.idea
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-yaml
- id: end-of-file-fixer
- id: fix-encoding-pragma
args:
- --remove
- id: mixed-line-ending
args:
- --fix=lf
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.5
rev: v0.14.11
hooks:
- id: ruff
- id: ruff-check
- id: ruff-format

- repo: https://github.com/pycqa/isort
rev: 6.0.1
rev: 7.0.0
hooks:
- id: isort

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.11.1
hooks:
- id: pyproject-fmt
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.0.7
104 changes: 55 additions & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,72 +1,78 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [ "setuptools>=61", "wheel" ]

[project]
name = "lingva"
description = "Translation toolset"
authors = [
{name = "Wichert Akkerman", email = "wichert@wiggy.net"},
]
readme = "README.rst"
keywords = [ "Babel", "gettext", "po", "translation" ]
license = "BSD-3-Clause"
license-files = [ "LICENSE" ]
maintainers = [
{ name = "Arkadii Yakovets" },
{ name = "Serhii Murza" },
{ name = "Arkadii Yakovets" },
{ name = "Serhii Murza" },
]
authors = [
{ name = "Wichert Akkerman", email = "wichert@wiggy.net" },
]
requires-python = ">=3.10"

readme = "README.rst"
dynamic = ["version"]
license = "BSD-3-Clause"
license-files = ["LICENSE"]
keywords = ["translation", "po", "gettext", "Babel"]
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dynamic = [ "version" ]
dependencies = [
"click >= 8.0.3",
"polib >= 1.1.1"
"click>=8,<9",
"polib>=1.2,<2",
]

[project.optional-dependencies]
dev = [
"pytest >= 8.0.0",
"ruff >= 0.11.0"
]
chameleon = [
"chameleon"
optional-dependencies.chameleon = [
"chameleon",
]
urls.homepage = "https://github.com/vacanza/lingva"
urls.tracker = "https://github.com/vacanza/lingva/issues"
scripts.polint = "lingva.polint:main"
scripts.pot-create = "lingva.extract:main"
entry-points."lingva.extractors".chameleon = "lingva.extractors.xml:ChameleonExtractor"
entry-points."lingva.extractors".python = "lingva.extractors.python:PythonExtractor"
entry-points."lingva.extractors".xml = "lingva.extractors.xml:ChameleonExtractor"
entry-points."lingva.extractors".zcml = "lingva.extractors.zcml:ZCMLExtractor"
entry-points."lingva.extractors".zope = "lingva.extractors.xml:ZopeExtractor"

[project.scripts]
polint = "lingva.polint:main"
pot-create = "lingva.extract:main"
[dependency-groups]
dev = [
"pre-commit>=4.5,<5",
"pytest>=9,<10",
]

[project.entry-points."lingva.extractors"]
python = "lingva.extractors.python:PythonExtractor"
chameleon = "lingva.extractors.xml:ChameleonExtractor"
xml = "lingva.extractors.xml:ChameleonExtractor"
zope = "lingva.extractors.xml:ZopeExtractor"
zcml = "lingva.extractors.zcml:ZCMLExtractor"
[tool.setuptools.dynamic]
version = { file = "VERSION" }

[project.urls]
homepage = "https://github.com/vacanza/lingva"
tracker = "https://github.com/vacanza/lingva/issues"
[tool.setuptools.packages.find]
where = [ "src" ]

[tool.pytest.ini_options]
testpaths = "tests"
norecursedirs = ".git tmp* .eggs bin build include lib share src"
[tool.ruff]
target-version = "py310"

[tool.setuptools.dynamic]
version = { attr = "lingva.__version__" }
line-length = 99
lint.select = [ "E4", "E5", "E7", "E9", "F", "W" ]
lint.flake8-errmsg.max-string-length = 99

[tool.isort]
known_first_party = ["lingva", "tests"]
known_first_party = [ "lingva", "tests" ]
line_length = 99
multi_line_output = 3
profile = "black"

[tool.ruff]
line-length = 99

[tool.ruff.lint]
select = ["E4", "E5", "E7", "E9", "F", "W"]

[tool.ruff.lint.flake8-errmsg]
max-string-length = 99
[tool.pytest.ini_options]
testpaths = "tests"
norecursedirs = ".git tmp* .eggs bin build include lib share src"
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions src/lingva/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Translation toolset"""
from importlib.metadata import version

__version__ = "5.0.6"
__version__ = version("lingva")
13 changes: 0 additions & 13 deletions tox.ini

This file was deleted.

Loading