Skip to content

Commit

Permalink
Remove typing backport (#882)
Browse files Browse the repository at this point in the history
Closes: #877
  • Loading branch information
srittau committed Sep 15, 2021
1 parent 0a9ee8f commit 17fe6c4
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 10,734 deletions.
13 changes: 1 addition & 12 deletions tox.ini → .flake8
@@ -1,14 +1,5 @@
[tox]
envlist = py27, py34

[testenv]
changedir = src
commands = python -m unittest discover

[testenv:py27]
changedir = python2

[flake8]

# fake builtins for python2/*
builtins = basestring, unicode
max-line-length = 90
Expand All @@ -23,7 +14,5 @@ ignore =
exclude =
# tests have more relaxed formatting rules
# and its own specific config in .flake8-tests
python2/test_typing.py,
src/test_typing.py,
typing_extensions/src_py2/test_typing_extensions.py,
typing_extensions/src_py3/test_typing_extensions.py,
7 changes: 1 addition & 6 deletions .flake8-tests
@@ -1,7 +1,7 @@
# This configuration is specific to test_*.py; you need to invoke it
# by specifically naming this config, like this:
#
# $ flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py
# $ flake8 --config=.flake8-tests [SOURCES]
#
# This will be possibly merged in the future.

Expand All @@ -28,8 +28,3 @@ ignore =
DW12,
# consistency with mypy
W504
exclude =
# This config is NOT for the main module.
setup.py,
python2/typing.py,
src/typing.py
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Expand Up @@ -25,9 +25,6 @@ jobs:
python -m pip install --upgrade pip
pip install -r test-requirements.txt
- name: Test typing
run: pytest python2

- name: Test typing_extensions
run: |
pip install typing
Expand Down Expand Up @@ -97,4 +94,4 @@ jobs:
run: flake8

- name: Lint tests
run: flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py
run: flake8 --config=.flake8-tests typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py
35 changes: 3 additions & 32 deletions CONTRIBUTING.md
@@ -1,16 +1,6 @@
This repository contains backports of the CPython `typing` module to earlier versions of
Python. Therefore, code in this repo should follow CPython's style guidelines and
Code in this repository should follow CPython's style guidelines and
contributors need to sign the PSF Contributor Agreement.

# typing

The `typing` module provided by this repository is a backport for Python versions that
do not have `typing` in the standard library: Python 2.7 and 3.4. These versions are no
longer officially supported by CPython, so there is little remaining interest in keeping
the backport up to date. We will accept contributions backporting new features to
`typing`, but we are no longer actively requiring Python 2 support for all
contributions.

# typing_extensions

The `typing_extensions` module provides a way to access new features from the standard
Expand All @@ -36,34 +26,15 @@ because async generators were added to the language in 3.6.

# Versioning scheme

`typing_extensions` and `typing` are usually released together using the same version
numbers. The version number indicates the version of the standard library `typing`
The version number of `typing_extensions` indicates the version of the standard library `typing`
module that is reflected in the backport. For example, `typing_extensions` version
3.10.0.0 includes features from the Python 3.10.0 standard library's `typing` module. A
new release that doesn't include any new standard library features would be called
3.10.0.1.

# Workflow for PyPI releases

- Do this for both `typing` and `typing_extensions`

- Run tests under all supported versions. As of April 2021 this includes 2.7, 3.4, 3.5,
3.6, 3.7, 3.8, 3.9.

- On macOS, you can use `pyenv <https://github.com/pyenv/pyenv>`\_ to manage multiple
Python installations. Long story short:

- `xcode-select --install`
- `brew install pyenv`
- `echo 'eval "$(pyenv init -)"' >> ~/.bash_profile`
- Open a new shell
- `pyenv install 3.5.3`
- `pyenv install 3.4.6`
- (assuming you already have 2.7.13 and 3.6.1 from Homebrew)
- `pyenv global system 3.5.3 3.4.6`
- (or some more recent versions)

- You can use `tox` to automate running tests.
- Ensure that GitHub Actions reports no errors.

- Update the version number in `setup.py`.

Expand Down
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

19 changes: 7 additions & 12 deletions README.md
Expand Up @@ -19,13 +19,7 @@ repository contain some historic discussions.
Repository Content
------------------

This GitHub repo is used for several things:

- A backport of the `typing` module for older Python versions (2.7 and
3.4) is maintained in the [src directory](./src).
Note that the canonical source lives
[upstream](https://github.com/python/cpython/blob/master/Lib/typing.py)
in the CPython repo.
This GitHub repository is used for several things:

- The `typing_extensions` module lives in the
[typing\_extensions](./typing_extensions) directory.
Expand All @@ -36,11 +30,12 @@ This GitHub repo is used for several things:
- A [discussion forum](https://github.com/python/typing/discussions) for typing-related user
help is hosted here.

Historically, this repository hosted a backport of the
[`typing` module](https://docs.python.org/3/library/typing.html) for older
Python versions. The last released version, supporting Python 2.7 and 3.4,
is [available at PyPI](https://pypi.org/project/typing/).

Workflow
--------

* See [CONTRIBUTING.md](/CONTRIBUTING.md) for more.

* The typing.py module and its unittests are edited in the `src`
subdirectory of this repo. The `python2` subdirectory contains the
Python 2 backport.
See [CONTRIBUTING.md](/CONTRIBUTING.md) for more.
14 changes: 0 additions & 14 deletions python2/mod_generics_cache.py

This file was deleted.

0 comments on commit 17fe6c4

Please sign in to comment.