Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 2.7 #936

Merged
merged 12 commits into from
Mar 21, 2022
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ The official tag is `python-attrs` and helping out in support frees us up to imp

- To run the test suite, all you need is a recent [*tox*].
It will ensure the test suite runs with all dependencies against all Python versions just as it will in our [CI].
If you lack some Python versions, you can can always limit the environments like `tox -e py27,py38`, or make it a non-failure using `tox --skip-missing-interpreters`.
If you lack some Python versions, you can can always limit the environments like `tox -e py38,py39`, or make it a non-failure using `tox --skip-missing-interpreters`.

In that case you should look into [*asdf*](https://asdf-vm.com) or [*pyenv*](https://github.com/pyenv/pyenv), which make it very easy to install many different Python versions in parallel.
- Write [good test docstrings](https://jml.io/pages/test-docstrings.html).
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "pypy-2.7", "pypy-3.7", "pypy-3.8"]
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"]

steps:
- uses: actions/checkout@v3
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -8,12 +8,20 @@ repos:
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py3-plus, --keep-percent-format]
exclude: "tests/test_slots.py"

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
additional_dependencies: [toml]
files: \.py$
language_version: python3.10 # needed for match

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -117,7 +117,8 @@ Project Information
its documentation lives at `Read the Docs <https://www.attrs.org/>`_,
the code on `GitHub <https://github.com/python-attrs/attrs>`_,
and the latest release on `PyPI <https://pypi.org/project/attrs/>`_.
It’s rigorously tested on Python 2.7, 3.5+, and PyPy.
It’s rigorously tested on Python 3.5+ and PyPy.
The last version with Python 2.7 support is `21.4.0 <https://pypi.org/project/attrs/21.4.0/>`_.

We collect information on **third-party extensions** in our `wiki <https://github.com/python-attrs/attrs/wiki/Extensions-to-attrs>`_.
Feel free to browse and add your own!
6 changes: 6 additions & 0 deletions changelog.d/936.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Python 2.7 is not supported anymore.

The tooling around Python 2.7 has become too tedious for a volunteer-run project.

We have supported Python 2 more than 2 years after it was officially discontinued and feel that we have paid our dues.
All version up to 21.4.0 from December 2021 remain fully functional, of course.
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: MIT

from __future__ import absolute_import, division, print_function

from hypothesis import HealthCheck, settings

1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -89,7 +89,6 @@ Full Table of Contents
:maxdepth: 1

license
python-2
changelog


25 changes: 0 additions & 25 deletions docs/python-2.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/why.rst
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ Whether they're relevant to *you* depends on your circumstances:
There is a long list of features that were sacrificed for the sake of simplicity and while the most obvious ones are validators, converters, :ref:`equality customization <custom-comparison>`, or :doc:`extensibility <extending>` in general, it permeates throughout all APIs.

On the other hand, Data Classes currently do not offer any significant feature that ``attrs`` doesn't already have.
- ``attrs`` supports all mainstream Python versions, including CPython 2.7 and PyPy.
- ``attrs`` supports all mainstream Python versions including PyPy.
- ``attrs`` doesn't force type annotations on you if you don't like them.
- But since it **also** supports typing, it's the best way to embrace type hints *gradually*, too.
- While Data Classes are implementing features from ``attrs`` every now and then, their presence is dependent on the Python version, not the package version.
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -32,8 +32,6 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
@@ -56,7 +54,6 @@
"hypothesis",
"pympler",
"pytest>=4.3.0", # 4.3.0 dropped last use of `convert`
"six",
],
}
if (
@@ -143,7 +140,7 @@ def find_meta(meta):
long_description_content_type="text/x-rst",
packages=PACKAGES,
package_dir={"": "src"},
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
python_requires=">=3.5",
zip_safe=False,
classifiers=CLASSIFIERS,
install_requires=INSTALL_REQUIRES,
1 change: 0 additions & 1 deletion src/attr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: MIT

from __future__ import absolute_import, division, print_function

import sys

1 change: 0 additions & 1 deletion src/attr/_cmp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: MIT

from __future__ import absolute_import, division, print_function

import functools

Loading