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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -8,12 +8,19 @@ repos:
hooks:
- id: black

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

- 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
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Expand Up @@ -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!
Expand Down
1 change: 0 additions & 1 deletion conftest.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: MIT

from __future__ import absolute_import, division, print_function

from hypothesis import HealthCheck, settings

Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Expand Up @@ -89,7 +89,6 @@ Full Table of Contents
:maxdepth: 1

license
python-2
changelog


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

This file was deleted.

2 changes: 1 addition & 1 deletion docs/why.rst
Expand Up @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions setup.py
Expand Up @@ -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",
Expand All @@ -56,7 +54,6 @@
"hypothesis",
"pympler",
"pytest>=4.3.0", # 4.3.0 dropped last use of `convert`
hynek marked this conversation as resolved.
Show resolved Hide resolved
"six",
],
}
if (
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/attr/__init__.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: MIT

from __future__ import absolute_import, division, print_function

import sys

Expand Down
1 change: 0 additions & 1 deletion src/attr/_cmp.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: MIT

from __future__ import absolute_import, division, print_function

import functools

Expand Down