A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons.
pip install pytokenspython -m pytokens path/to/file.py- Create and activate a virtual environment
- Run
PYTOKENS_USE_MYPYC=0 pip install -e '.[dev]'to do an editable install - Run
pytestto run tests
Run mypy .
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__)"- 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/*