polyglot-python 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polyglot_python-0.2.0/src/polyglot_python.egg-info → polyglot_python-0.2.1}/PKG-INFO +33 -22
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/README.md +32 -21
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/pyproject.toml +1 -1
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/__init__.py +1 -1
- {polyglot_python-0.2.0 → polyglot_python-0.2.1/src/polyglot_python.egg-info}/PKG-INFO +33 -22
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_cli.py +3 -1
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_metadata.py +10 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/LICENSE +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/setup.cfg +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/__main__.py +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/cli.py +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/locales.json +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/translator.py +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/SOURCES.txt +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/dependency_links.txt +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/entry_points.txt +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/requires.txt +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/top_level.txt +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_examples.py +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_locales.py +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_translate.py +0 -0
- {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyglot-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Deterministic multilingual Python keyword transpiler: write Python in your own language.
|
|
5
5
|
Author: Furox-Art
|
|
6
6
|
License-Expression: MIT
|
|
@@ -37,15 +37,21 @@ syntax with your words.
|
|
|
37
37
|
## Install
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
pip install polyglot-python
|
|
40
|
+
pip install polyglot-python
|
|
41
41
|
pip install -e . # from source
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
is published. Requires Python 3.12+. Python 3.10/3.11 are not supported because
|
|
44
|
+
Requires Python 3.12+. Python 3.10/3.11 are not supported because
|
|
46
45
|
their tokenizer splits Indic combining marks, so several Hindi keywords would
|
|
47
46
|
not translate. No runtime dependencies.
|
|
48
47
|
|
|
48
|
+
Node.js users can install the thin npm wrapper. It forwards every command to
|
|
49
|
+
the Python CLI, so the Python package must be installed as well.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install -g polyglot-python
|
|
53
|
+
```
|
|
54
|
+
|
|
49
55
|
## Quick start
|
|
50
56
|
|
|
51
57
|
`examples/classify.tr`:
|
|
@@ -149,28 +155,33 @@ python -m venv .venv
|
|
|
149
155
|
.venv/Scripts/python -m pytest -q --cov=polyglot_python --cov-fail-under=100
|
|
150
156
|
```
|
|
151
157
|
|
|
152
|
-
The suite contains
|
|
158
|
+
The suite contains 120 tests with 100% statement coverage, including every
|
|
153
159
|
keyword in both directions for all 9 locales, end-to-end CLI runs of every
|
|
154
|
-
example, version consistency with the changelog
|
|
155
|
-
checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS
|
|
156
|
-
100% coverage gate on Linux 3.12, translates every
|
|
157
|
-
operating systems to compare bytes and line counts,
|
|
158
|
-
installs it into a clean environment, and smoke-tests it
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
example, version consistency with the changelog and the npm wrapper, and
|
|
161
|
+
byte-level determinism checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS
|
|
162
|
+
at 3.12, enforces the 100% coverage gate on Linux 3.12, translates every
|
|
163
|
+
example twice on all three operating systems to compare bytes and line counts,
|
|
164
|
+
builds the wheel, installs it into a clean environment, and smoke-tests it,
|
|
165
|
+
and runs the npm wrapper against the installed Python package. Dependabot keeps
|
|
166
|
+
GitHub Actions and development dependencies current. Separate release workflows
|
|
167
|
+
publish tagged GitHub Releases to PyPI and npm through Trusted Publishing.
|
|
161
168
|
|
|
162
169
|
## Releasing
|
|
163
170
|
|
|
164
|
-
Publishing uses
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
Publishing uses Trusted Publishing for both registries and stores no API token.
|
|
172
|
+
|
|
173
|
+
1. Configure the trusted publishers once:
|
|
174
|
+
- PyPI: publisher for project `polyglot-python`: owner `Furox-Art`,
|
|
175
|
+
repository `polyglot-python`, workflow `release.yml`, environment `pypi`.
|
|
176
|
+
- npm: trusted publisher for package `polyglot-python`: owner `Furox-Art`,
|
|
177
|
+
repository `polyglot-python`, workflow `release-npm.yml`, environment
|
|
178
|
+
`npm`.
|
|
179
|
+
2. Change `version` in `pyproject.toml`,
|
|
180
|
+
`src/polyglot_python/__init__.py` and `npm/package.json` together; the test
|
|
181
|
+
suite rejects drift.
|
|
182
|
+
3. Publish a GitHub Release with tag `v<version>`. `release.yml` verifies the
|
|
183
|
+
tag, builds the sdist and wheel, and uploads them to PyPI; `release-npm.yml`
|
|
184
|
+
verifies the same version and publishes `npm/` to npm with provenance.
|
|
174
185
|
|
|
175
186
|
## License
|
|
176
187
|
|
|
@@ -13,15 +13,21 @@ syntax with your words.
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
pip install polyglot-python
|
|
16
|
+
pip install polyglot-python
|
|
17
17
|
pip install -e . # from source
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
is published. Requires Python 3.12+. Python 3.10/3.11 are not supported because
|
|
20
|
+
Requires Python 3.12+. Python 3.10/3.11 are not supported because
|
|
22
21
|
their tokenizer splits Indic combining marks, so several Hindi keywords would
|
|
23
22
|
not translate. No runtime dependencies.
|
|
24
23
|
|
|
24
|
+
Node.js users can install the thin npm wrapper. It forwards every command to
|
|
25
|
+
the Python CLI, so the Python package must be installed as well.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g polyglot-python
|
|
29
|
+
```
|
|
30
|
+
|
|
25
31
|
## Quick start
|
|
26
32
|
|
|
27
33
|
`examples/classify.tr`:
|
|
@@ -125,28 +131,33 @@ python -m venv .venv
|
|
|
125
131
|
.venv/Scripts/python -m pytest -q --cov=polyglot_python --cov-fail-under=100
|
|
126
132
|
```
|
|
127
133
|
|
|
128
|
-
The suite contains
|
|
134
|
+
The suite contains 120 tests with 100% statement coverage, including every
|
|
129
135
|
keyword in both directions for all 9 locales, end-to-end CLI runs of every
|
|
130
|
-
example, version consistency with the changelog
|
|
131
|
-
checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS
|
|
132
|
-
100% coverage gate on Linux 3.12, translates every
|
|
133
|
-
operating systems to compare bytes and line counts,
|
|
134
|
-
installs it into a clean environment, and smoke-tests it
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
example, version consistency with the changelog and the npm wrapper, and
|
|
137
|
+
byte-level determinism checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS
|
|
138
|
+
at 3.12, enforces the 100% coverage gate on Linux 3.12, translates every
|
|
139
|
+
example twice on all three operating systems to compare bytes and line counts,
|
|
140
|
+
builds the wheel, installs it into a clean environment, and smoke-tests it,
|
|
141
|
+
and runs the npm wrapper against the installed Python package. Dependabot keeps
|
|
142
|
+
GitHub Actions and development dependencies current. Separate release workflows
|
|
143
|
+
publish tagged GitHub Releases to PyPI and npm through Trusted Publishing.
|
|
137
144
|
|
|
138
145
|
## Releasing
|
|
139
146
|
|
|
140
|
-
Publishing uses
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
Publishing uses Trusted Publishing for both registries and stores no API token.
|
|
148
|
+
|
|
149
|
+
1. Configure the trusted publishers once:
|
|
150
|
+
- PyPI: publisher for project `polyglot-python`: owner `Furox-Art`,
|
|
151
|
+
repository `polyglot-python`, workflow `release.yml`, environment `pypi`.
|
|
152
|
+
- npm: trusted publisher for package `polyglot-python`: owner `Furox-Art`,
|
|
153
|
+
repository `polyglot-python`, workflow `release-npm.yml`, environment
|
|
154
|
+
`npm`.
|
|
155
|
+
2. Change `version` in `pyproject.toml`,
|
|
156
|
+
`src/polyglot_python/__init__.py` and `npm/package.json` together; the test
|
|
157
|
+
suite rejects drift.
|
|
158
|
+
3. Publish a GitHub Release with tag `v<version>`. `release.yml` verifies the
|
|
159
|
+
tag, builds the sdist and wheel, and uploads them to PyPI; `release-npm.yml`
|
|
160
|
+
verifies the same version and publishes `npm/` to npm with provenance.
|
|
150
161
|
|
|
151
162
|
## License
|
|
152
163
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "polyglot-python"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.1"
|
|
8
8
|
description = "Deterministic multilingual Python keyword transpiler: write Python in your own language."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyglot-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Deterministic multilingual Python keyword transpiler: write Python in your own language.
|
|
5
5
|
Author: Furox-Art
|
|
6
6
|
License-Expression: MIT
|
|
@@ -37,15 +37,21 @@ syntax with your words.
|
|
|
37
37
|
## Install
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
pip install polyglot-python
|
|
40
|
+
pip install polyglot-python
|
|
41
41
|
pip install -e . # from source
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
is published. Requires Python 3.12+. Python 3.10/3.11 are not supported because
|
|
44
|
+
Requires Python 3.12+. Python 3.10/3.11 are not supported because
|
|
46
45
|
their tokenizer splits Indic combining marks, so several Hindi keywords would
|
|
47
46
|
not translate. No runtime dependencies.
|
|
48
47
|
|
|
48
|
+
Node.js users can install the thin npm wrapper. It forwards every command to
|
|
49
|
+
the Python CLI, so the Python package must be installed as well.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install -g polyglot-python
|
|
53
|
+
```
|
|
54
|
+
|
|
49
55
|
## Quick start
|
|
50
56
|
|
|
51
57
|
`examples/classify.tr`:
|
|
@@ -149,28 +155,33 @@ python -m venv .venv
|
|
|
149
155
|
.venv/Scripts/python -m pytest -q --cov=polyglot_python --cov-fail-under=100
|
|
150
156
|
```
|
|
151
157
|
|
|
152
|
-
The suite contains
|
|
158
|
+
The suite contains 120 tests with 100% statement coverage, including every
|
|
153
159
|
keyword in both directions for all 9 locales, end-to-end CLI runs of every
|
|
154
|
-
example, version consistency with the changelog
|
|
155
|
-
checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS
|
|
156
|
-
100% coverage gate on Linux 3.12, translates every
|
|
157
|
-
operating systems to compare bytes and line counts,
|
|
158
|
-
installs it into a clean environment, and smoke-tests it
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
example, version consistency with the changelog and the npm wrapper, and
|
|
161
|
+
byte-level determinism checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS
|
|
162
|
+
at 3.12, enforces the 100% coverage gate on Linux 3.12, translates every
|
|
163
|
+
example twice on all three operating systems to compare bytes and line counts,
|
|
164
|
+
builds the wheel, installs it into a clean environment, and smoke-tests it,
|
|
165
|
+
and runs the npm wrapper against the installed Python package. Dependabot keeps
|
|
166
|
+
GitHub Actions and development dependencies current. Separate release workflows
|
|
167
|
+
publish tagged GitHub Releases to PyPI and npm through Trusted Publishing.
|
|
161
168
|
|
|
162
169
|
## Releasing
|
|
163
170
|
|
|
164
|
-
Publishing uses
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
Publishing uses Trusted Publishing for both registries and stores no API token.
|
|
172
|
+
|
|
173
|
+
1. Configure the trusted publishers once:
|
|
174
|
+
- PyPI: publisher for project `polyglot-python`: owner `Furox-Art`,
|
|
175
|
+
repository `polyglot-python`, workflow `release.yml`, environment `pypi`.
|
|
176
|
+
- npm: trusted publisher for package `polyglot-python`: owner `Furox-Art`,
|
|
177
|
+
repository `polyglot-python`, workflow `release-npm.yml`, environment
|
|
178
|
+
`npm`.
|
|
179
|
+
2. Change `version` in `pyproject.toml`,
|
|
180
|
+
`src/polyglot_python/__init__.py` and `npm/package.json` together; the test
|
|
181
|
+
suite rejects drift.
|
|
182
|
+
3. Publish a GitHub Release with tag `v<version>`. `release.yml` verifies the
|
|
183
|
+
tag, builds the sdist and wheel, and uploads them to PyPI; `release-npm.yml`
|
|
184
|
+
verifies the same version and publishes `npm/` to npm with provenance.
|
|
174
185
|
|
|
175
186
|
## License
|
|
176
187
|
|
|
@@ -6,6 +6,8 @@ from pathlib import Path
|
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
8
|
|
|
9
|
+
import polyglot_python
|
|
10
|
+
|
|
9
11
|
from polyglot_python.cli import _configure_console, main
|
|
10
12
|
|
|
11
13
|
TR_PROGRAM = (
|
|
@@ -135,7 +137,7 @@ def test_version(capsys):
|
|
|
135
137
|
with pytest.raises(SystemExit) as caught:
|
|
136
138
|
main(["--version"])
|
|
137
139
|
assert caught.value.code == 0
|
|
138
|
-
assert "polyglot-python
|
|
140
|
+
assert f"polyglot-python {polyglot_python.__version__}" in capsys.readouterr().out
|
|
139
141
|
|
|
140
142
|
|
|
141
143
|
def test_run_token_error_is_localized(tmp_path, capsys):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import tomllib
|
|
2
3
|
from pathlib import Path
|
|
3
4
|
|
|
@@ -16,3 +17,12 @@ def test_version_matches_pyproject():
|
|
|
16
17
|
def test_changelog_mentions_current_version():
|
|
17
18
|
changelog = ROOT.joinpath("CHANGELOG.md").read_text(encoding="utf-8")
|
|
18
19
|
assert f"## [{polyglot_python.__version__}]" in changelog
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_npm_wrapper_matches_version():
|
|
23
|
+
package = json.loads(ROOT.joinpath("npm", "package.json").read_text(encoding="utf-8"))
|
|
24
|
+
assert package["name"] == "polyglot-python"
|
|
25
|
+
assert package["version"] == polyglot_python.__version__
|
|
26
|
+
binary = ROOT.joinpath("npm", package["bin"]["polyglot-python"])
|
|
27
|
+
assert binary.is_file()
|
|
28
|
+
assert binary.read_text(encoding="utf-8").startswith("#!/usr/bin/env node\n")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|