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.
Files changed (22) hide show
  1. {polyglot_python-0.2.0/src/polyglot_python.egg-info → polyglot_python-0.2.1}/PKG-INFO +33 -22
  2. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/README.md +32 -21
  3. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/pyproject.toml +1 -1
  4. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/__init__.py +1 -1
  5. {polyglot_python-0.2.0 → polyglot_python-0.2.1/src/polyglot_python.egg-info}/PKG-INFO +33 -22
  6. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_cli.py +3 -1
  7. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_metadata.py +10 -0
  8. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/LICENSE +0 -0
  9. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/setup.cfg +0 -0
  10. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/__main__.py +0 -0
  11. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/cli.py +0 -0
  12. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/locales.json +0 -0
  13. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python/translator.py +0 -0
  14. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/SOURCES.txt +0 -0
  15. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/dependency_links.txt +0 -0
  16. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/entry_points.txt +0 -0
  17. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/requires.txt +0 -0
  18. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/src/polyglot_python.egg-info/top_level.txt +0 -0
  19. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_examples.py +0 -0
  20. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_locales.py +0 -0
  21. {polyglot_python-0.2.0 → polyglot_python-0.2.1}/tests/test_translate.py +0 -0
  22. {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.0
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 # after the first release
40
+ pip install polyglot-python
41
41
  pip install -e . # from source
42
42
  ```
43
43
 
44
- The first release is prepared but not yet on PyPI; install from source until it
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 119 tests with 100% statement coverage, including every
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, and byte-level determinism
155
- checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS at 3.12, enforces the
156
- 100% coverage gate on Linux 3.12, translates every example twice on all three
157
- operating systems to compare bytes and line counts, and builds the wheel,
158
- installs it into a clean environment, and smoke-tests it. Dependabot keeps
159
- GitHub Actions and development dependencies current. A separate release
160
- workflow publishes tagged GitHub Releases to PyPI through Trusted Publishing.
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 [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/)
165
- and stores no API token.
166
-
167
- 1. On PyPI, add a pending publisher for project `polyglot-python`: owner
168
- `Furox-Art`, repository `polyglot-python`, workflow `release.yml`,
169
- environment `pypi`.
170
- 2. Change `version` in `pyproject.toml` and
171
- `src/polyglot_python/__init__.py` together; the test suite rejects drift.
172
- 3. Publish a GitHub Release with tag `v<version>`. The release workflow verifies
173
- the tag, builds the sdist and wheel, and uploads them to PyPI.
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 # after the first release
16
+ pip install polyglot-python
17
17
  pip install -e . # from source
18
18
  ```
19
19
 
20
- The first release is prepared but not yet on PyPI; install from source until it
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 119 tests with 100% statement coverage, including every
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, and byte-level determinism
131
- checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS at 3.12, enforces the
132
- 100% coverage gate on Linux 3.12, translates every example twice on all three
133
- operating systems to compare bytes and line counts, and builds the wheel,
134
- installs it into a clean environment, and smoke-tests it. Dependabot keeps
135
- GitHub Actions and development dependencies current. A separate release
136
- workflow publishes tagged GitHub Releases to PyPI through Trusted Publishing.
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 [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/)
141
- and stores no API token.
142
-
143
- 1. On PyPI, add a pending publisher for project `polyglot-python`: owner
144
- `Furox-Art`, repository `polyglot-python`, workflow `release.yml`,
145
- environment `pypi`.
146
- 2. Change `version` in `pyproject.toml` and
147
- `src/polyglot_python/__init__.py` together; the test suite rejects drift.
148
- 3. Publish a GitHub Release with tag `v<version>`. The release workflow verifies
149
- the tag, builds the sdist and wheel, and uploads them to PyPI.
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.0"
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"
@@ -10,7 +10,7 @@ from .translator import (
10
10
  translate,
11
11
  )
12
12
 
13
- __version__ = "0.2.0"
13
+ __version__ = "0.2.1"
14
14
 
15
15
  __all__ = [
16
16
  "Locale",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyglot-python
3
- Version: 0.2.0
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 # after the first release
40
+ pip install polyglot-python
41
41
  pip install -e . # from source
42
42
  ```
43
43
 
44
- The first release is prepared but not yet on PyPI; install from source until it
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 119 tests with 100% statement coverage, including every
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, and byte-level determinism
155
- checks. CI runs Ubuntu 3.12-3.14 plus Windows and macOS at 3.12, enforces the
156
- 100% coverage gate on Linux 3.12, translates every example twice on all three
157
- operating systems to compare bytes and line counts, and builds the wheel,
158
- installs it into a clean environment, and smoke-tests it. Dependabot keeps
159
- GitHub Actions and development dependencies current. A separate release
160
- workflow publishes tagged GitHub Releases to PyPI through Trusted Publishing.
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 [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/)
165
- and stores no API token.
166
-
167
- 1. On PyPI, add a pending publisher for project `polyglot-python`: owner
168
- `Furox-Art`, repository `polyglot-python`, workflow `release.yml`,
169
- environment `pypi`.
170
- 2. Change `version` in `pyproject.toml` and
171
- `src/polyglot_python/__init__.py` together; the test suite rejects drift.
172
- 3. Publish a GitHub Release with tag `v<version>`. The release workflow verifies
173
- the tag, builds the sdist and wheel, and uploads them to PyPI.
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 0.2.0" in capsys.readouterr().out
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