1Code in this repository should follow CPython's style guidelines and
2contributors need to sign the PSF Contributor Agreement.
3
4# typing\_extensions
5
6The `typing_extensions` module provides a way to access new features from the standard
7library `typing` module in older versions of Python. For example, Python 3.10 adds
8`typing.TypeGuard`, but users of older versions of Python can use `typing_extensions` to
9use `TypeGuard` in their code even if they are unable to upgrade to Python 3.10.
10
11If you contribute the runtime implementation of a new `typing` feature to CPython, you
12are encouraged to also implement the feature in `typing_extensions`. Because the runtime
13implementation of much of the infrastructure in the `typing` module has changed over
14time, this may require different code for some older Python versions.
15
16`typing_extensions` may also include experimental features that are not yet part of the
17standard library, so that users can experiment with them before they are added to the
18standard library. Such features should ideally already be specified in a PEP or draft
19PEP.
20
21`typing_extensions` supports Python versions 3.7 and up.
22
23# Versioning scheme
24
25Starting with version 4.0.0, `typing_extensions` uses
26[Semantic Versioning](https://semver.org/). The major version is incremented for all
27backwards-incompatible changes.
28
29# Workflow for PyPI releases
30
31- Ensure that GitHub Actions reports no errors.
32
33- Update the version number in `typing_extensions/pyproject.toml` and in
34  `typing_extensions/CHANGELOG`.
35
36- Make sure your environment is up to date
37
38 - `git checkout master`
39 - `git pull`
40 - `python -m pip install --upgrade build twine`
41
42- Build the source and wheel distributions:
43
44  - `cd typing_extensions`
45  - `rm -rf dist/`
46  - `python -m build .`
47
48- Install the built distributions locally and test (if you were using `tox`, you already
49  tested the source distribution).
50
51- Run `twine upload dist/*`.
52
53- Tag the release. The tag should be just the version number, e.g. `4.1.1`.
54
55- `git push --tags`
56