Metadata-Version: 2.4
Name: tython-lang
Version: 0.1.3
Summary: Python with an erasable structural type system powered by the adapted TypeScript checker
License: Apache-2.0
Project-URL: Homepage, https://github.com/jdrebin/TyThon
Project-URL: Issues, https://github.com/jdrebin/TyThon/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: NOTICE.txt
Dynamic: license-file

# tython CLI

The `tython-lang` distribution provides the `tython` command. It is an independent
adaptation of the TypeScript checker for typed Python, not a Microsoft product.
The wheel contains a prebuilt compiler and its matching library. No Go, Node,
source checkout, or compilation is required when installing it.

This alpha targets Python 3.10+. Linux wheels use the manylinux_2_17 tag because
the compiler is a statically linked Go binary. pip installs them on glibc Linux,
including WSL. Alpine is not covered.

Install it in your project's virtual environment:

```sh
python -m pip install tython-lang
tython check app.ty
tython build app.ty
python dist/app.py
```

`python -m tython_cli` is also
available if your environment's scripts directory is not on PATH.

Create an editable playground covering the language and editor features:

```sh
tython demo my-playground
cd my-playground
python tour.py --check
python tour.py
```

The optional directory defaults to `tython-demo` and must not already exist.
Generation works offline without running code or installing dependencies.
The 17 independent lessons, feature map, and intentional-error folder are the
same examples shipped by the extension's **Open Preview Examples** command.
`tour.py` checks, builds into `dist/`, explicitly copies the local Python
dependencies, and runs the positive lessons. Python 3.10+ and this CLI suffice.

`check` writes no output files. `build` checks first, then preserves the source
layout under `dist/`, including typed imports. Ordinary `.py` files are not
read, checked, or copied; supply those runtime dependencies separately.
**It overwrites generated outputs in
that directory**, never source files. Old outputs are not automatically deleted.
Use `--out-dir PATH` to select a different destination, and `--root-dir PATH`
(also accepted by `check`) to override the inferred common source directory.
Python package directories are kept intact. For example: `tython build --root-dir src --out-dir dist src/app.ty`.
For packages with relative imports, run `python -m package.module` from the
output root. Package initializers are preserved, including `__init__.ty` erasure.
Non-code assets and dynamically loaded modules are not automatically copied;
relative data-file paths retain Python's usual working-directory behavior.
The CLI does not execute your Python code or install project dependencies.

Install **TyThon** (`tython.tython`) from the VS Code Marketplace for
highlighting, completion, diagnostics, hover, and formatting. Formatting runs
the pinned Black shipped in that extension with your Python 3.10+. The VSIX
and CLI are independently usable; both contain the same compiler and library.
Optional Jedi/Ruff editor integrations remain separate.

The CLI exposes `demo`, `check`, `build`, and `--version`. The language
and library coverage are still incomplete. See the
[project guide](https://github.com/jdrebin/TyThon) for syntax and current
limitations. The unrelated PyPI project named `tython` is not this package.

For maintainers: `npm run release` at the repository root tests, then builds
every platform VSIX and wheel. This directory alone is not a source
distribution; packaging stages the verified native payload before invoking
the standard setuptools build backend.
