Skip to content

Commit 71cd2c3

Browse files
committed
Use uv, pyproject.toml files, and markdown
1 parent e4fc3c2 commit 71cd2c3

File tree

19 files changed

+922
-241
lines changed

19 files changed

+922
-241
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
exclude=.tox
2+
exclude=.venv
33
extend-ignore = E203
44
max-line-length=120

.github/workflows/ci.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,34 @@ on:
55
branches:
66
- main
77
pull_request:
8+
workflow_dispatch:
89

910
jobs:
1011
lint:
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-python@v5
14+
- uses: actions/checkout@v6
15+
- uses: astral-sh/setup-uv@v7
1516
with:
16-
cache: pip
17-
cache-dependency-path: |
18-
dev-requirements.txt
19-
fluent.syntax/setup.py
20-
fluent.runtime/setup.py
21-
- run: python -m pip install -r dev-requirements.txt
22-
- run: python -m pip install ./fluent.syntax ./fluent.runtime
23-
- run: python -m flake8
24-
- run: python -m mypy fluent.syntax/fluent fluent.runtime/fluent
17+
python-version: 3.8
18+
- uses: actions/setup-python@v6
19+
- run: uv sync --dev --all-packages
20+
- run: uv run python -m flake8
21+
- run: uv run mypy fluent.syntax/fluent fluent.runtime/fluent
2522
test:
2623
runs-on: ${{ matrix.os }}
2724
strategy:
2825
matrix:
2926
os: [ubuntu-22.04, windows-2022]
3027
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12, pypy3.9, pypy3.10]
3128
steps:
32-
- uses: actions/checkout@v4
33-
- uses: actions/setup-python@v5
29+
- uses: actions/checkout@v6
30+
- uses: astral-sh/setup-uv@v7
3431
with:
3532
python-version: ${{ matrix.python-version }}
36-
cache: pip
37-
cache-dependency-path: |
38-
fluent.syntax/setup.py
39-
fluent.runtime/setup.py
40-
- run: python -m pip install ./fluent.syntax ./fluent.runtime
41-
- run: python -m unittest discover -s fluent.syntax
42-
- run: python -m unittest discover -s fluent.runtime
33+
- run: uv sync --dev --all-packages
34+
- run: uv run python -m unittest discover -s fluent.syntax
35+
- run: uv run python -m unittest discover -s fluent.runtime
4336

4437
# Test compatibility with the oldest Python version we claim to support,
4538
# and for fluent.runtime's compatibility with a range of fluent.syntax versions.
@@ -53,10 +46,10 @@ jobs:
5346
- fluent.syntax==0.18.1 six
5447
- fluent.syntax==0.17.0 six
5548
steps:
56-
- uses: actions/checkout@v3
57-
- uses: actions/setup-python@v4
49+
- uses: actions/checkout@v6
50+
- uses: astral-sh/setup-uv@v7
5851
with:
5952
python-version: 3.6
60-
- run: python -m pip install ${{ matrix.fluent-syntax }}
61-
- run: python -m pip install ./fluent.runtime
62-
- run: python -m unittest discover -s fluent.runtime
53+
- run: uv pip install ${{ matrix.fluent-syntax }}
54+
- run: uv pip install ./fluent.runtime
55+
- run: uv run python -m unittest discover -s fluent.runtime

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Project Fluent
2+
3+
This is a collection of Python packages to use the
4+
[Fluent localization system](http://projectfluent.org/):
5+
6+
## `fluent.syntax`
7+
8+
The [syntax package](./fluent.syntax) includes the
9+
parser, serializer, and traversal utilities like `Visitor` and `Transformer`.
10+
You’re looking for this package if you work on tooling for Fluent in Python.
11+
12+
## `fluent.runtime`
13+
14+
The [runtime package](./fluent.runtime) includes the library required to
15+
use Fluent to localize your Python application.
16+
It comes with a `Localization` class to use, based on an implementation of `FluentBundle`.
17+
It uses the tooling parser above to read Fluent files.
18+
19+
## `fluent.pygments`
20+
21+
A [plugin for pygments](./fluent.pygments) to add syntax highlighting to Sphinx.
22+
23+
## Discuss
24+
25+
We’d love to hear your thoughts on Project Fluent! Whether you’re a
26+
localizer looking for a better way to express yourself in your language,
27+
or a developer trying to make your app localizable and multilingual, or
28+
a hacker looking for a project to contribute to, please do get in touch
29+
on the mailing list and the IRC channel.
30+
31+
- Mozilla Discourse: https://discourse.mozilla.org/c/fluent
32+
- Matrix channel: [#fluent:mozilla.org](https://chat.mozilla.org/#/room/#fluent:mozilla.org)
33+
34+
## Get Involved
35+
36+
python-fluent is open-source, licensed under the Apache License, Version
37+
2.0. We encourage everyone to take a look at our code and we’ll listen
38+
to your feedback.

README.rst

Lines changed: 0 additions & 47 deletions
This file was deleted.

dev-requirements.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

fluent.runtime/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# fluent.runtime
2+
3+
Use [Fluent](https://projectfluent.org/) to localize your Python application.
4+
It comes with a `Localization` class to use, based on an implementation of `FluentBundle`.
5+
It uses the parser from `fluent.syntax` to read Fluent files.
6+
7+
```python
8+
from datetime import date
9+
l10n = DemoLocalization("today-is = Today is { $today }")
10+
val = l10n.format_value("today-is", { "today": date.today() })
11+
val # 'Today is Jun 16, 2018'
12+
```
13+
14+
Find the full documentation at https://projectfluent.org/python-fluent/fluent.runtime/.

fluent.runtime/README.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

fluent.runtime/pyproject.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[project]
2+
name = "fluent.runtime"
3+
version = "0.4.0"
4+
requires-python = ">= 3.6"
5+
dependencies = [
6+
"fluent.syntax>=0.17,<0.20",
7+
"attrs",
8+
"babel",
9+
"pytz",
10+
"typing-extensions>=3.7,<5",
11+
]
12+
license = { text = "Apache-2.0" }
13+
description = "Localization library for expressive translations."
14+
keywords = ["fluent", "localization", "l10n"]
15+
authors = [
16+
{ name = "Mozilla", email = "l10n-drivers@mozilla.org" },
17+
{ name = "Eemeli Aro", email = "eemeli@mozilla.com" },
18+
{ name = "Luke Plant", email = "L.Plant.98@cantab.net" },
19+
]
20+
classifiers = [
21+
"Development Status :: 3 - Alpha",
22+
"Intended Audience :: Developers",
23+
"License :: OSI Approved :: Apache Software License",
24+
"Programming Language :: Python :: 3.6",
25+
"Programming Language :: Python :: 3.7",
26+
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3 :: Only",
29+
]
30+
31+
[project.urls]
32+
repository = "https://github.com/projectfluent/python-fluent"
33+
34+
[build-system]
35+
requires = ["setuptools"]
36+
build-backend = "setuptools.build_meta"

fluent.runtime/setup.cfg

Lines changed: 0 additions & 5 deletions
This file was deleted.

fluent.runtime/setup.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)