pytokens0.4.1
pytokens0.4.1
Published
A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons.
pip install pytokens
Package Downloads
Authors
Project URLs
Requires Python
>=3.8
pytokens
A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons.
Installation
pip install pytokens
Usage
python -m pytokens path/to/file.py
Local Development / Testing
- Create and activate a virtual environment
- Run
PYTOKENS_USE_MYPYC=0 pip install -e '.[dev]'to do an editable install - Run
pytestto run tests
Type Checking
Run mypy .
Compilation with mypyc
By default, we compile with mypyc.
Use the PYTOKENS_USE_MYPYC environment variable to control this.
To check if you are using a compiled version, see whether the output of this is .py or .so:
python -c "import pytokens; print(pytokens.__file__)"
Create and upload a package to PyPI
- Make sure to bump the version in
pyproject.toml. - Push to Github so CI can build the wheels and sdist.
- Download the artifacts from the CI run.
- Find the "Build wheels" job, click "Summary", scroll down to the bottom to see "Artifacts"
and download the
cibw-wheelsartifact.
- Unzip the artifact.
- Upload the contents of the artifact to PyPI
- e.g. via
twine upload cibw-wheels/*