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<=37 support #1270
Closed
Closed
drop python<=37 support #1270
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 3.7 has been EOSed at 27 Jun 2023 (https://endoflife.date/python) Filter all code over `pyupgrade --py38'. Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
for more information, see https://pre-commit.ci
pytest look Ok with that PR. Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-attrs-23.2.0-5.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-attrs-23.2.0-5.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/attrs-23.2.0
configfile: pyproject.toml
testpaths: tests
plugins: hypothesis-6.99.6
collected 1319 items
tests/test_3rd_party.py . [ 0%]
tests/test_abc.py ssss [ 0%]
tests/test_annotations.py ....ss...............ss........................ [ 3%]
tests/test_cmp.py .............................................................................. [ 9%]
tests/test_compat.py ... [ 10%]
tests/test_config.py .... [ 10%]
tests/test_converters.py ...................... [ 12%]
tests/test_dunders.py ................................................................................................... [ 19%]
tests/test_filters.py ................................. [ 22%]
tests/test_funcs.py ................................................... [ 25%]
tests/test_functional.py ............................................................................................................................................................ [ 37%]
..................................................................................................................................................................................... [ 51%]
................................................................... [ 56%]
tests/test_hooks.py .......... [ 57%]
tests/test_import.py . [ 57%]
tests/test_init_subclass.py .... [ 57%]
tests/test_make.py .................................................................................................................................................................. [ 69%]
........................................................................................sssssss [ 77%]
tests/test_next_gen.py ................................. [ 79%]
tests/test_packaging.py ...................... [ 81%]
tests/test_pyright.py ss [ 81%]
tests/test_setattr.py ..................x................. [ 84%]
tests/test_slots.py .............s...................................... [ 88%]
tests/test_utils.py .. [ 88%]
tests/test_validators.py .................................................................................................................................................... [ 99%]
tests/test_version_info.py ...... [100%]
========================================================================================= XFAILURES =========================================================================================
_____________________________________________________________________________ TestSetAttr.test_slotted_confused _____________________________________________________________________________
self = <tests.test_setattr.TestSetAttr object at 0x7fe47a7914f0>
@pytest.mark.xfail(raises=attr.exceptions.FrozenAttributeError)
def test_slotted_confused(self):
"""
If we have a in-between non-attrs class, setattr reset detection
should still work, but currently doesn't.
It works with dict classes because we can look the finished class and
patch it. With slotted classes we have to deduce it ourselves.
"""
@attr.s(slots=True)
class A:
x = attr.ib(on_setattr=setters.frozen)
class B(A):
pass
@attr.s(slots=True)
class C(B):
x = attr.ib()
> C(1).x = 2
tests/test_setattr.py:312:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<attrs generated init tests.test_setattr.TestSetAttr.test_slotted_confused.<locals>.C>:2: in __init__
self.x = x
../../BUILDROOT/python-attrs-23.2.0-5.fc36.x86_64/usr/lib/python3.9/site-packages/attr/_make.py:1180: in __setattr__
nval = hook(self, a, val)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ = <[AttributeError('x') raised in repr()] C object at 0x7fe479c43100>
__ = Attribute(name='x', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash..., type=None, converter=None, kw_only=False, inherited=False, on_setattr=<function frozen at 0x7fe47b675310>, alias='x')
___ = 1
def frozen(_, __, ___):
"""
Prevent an attribute to be modified.
.. versionadded:: 20.1.0
"""
> raise FrozenAttributeError()
E attr.exceptions.FrozenAttributeError
../../BUILDROOT/python-attrs-23.2.0-5.fc36.x86_64/usr/lib/python3.9/site-packages/attr/setters.py:36: FrozenAttributeError
================================================================================== short test summary info ==================================================================================
SKIPPED [2] tests/test_abc.py:17: abc.update_abstractmethods is 3.10+
SKIPPED [2] tests/test_abc.py:39: abc.update_abstractmethods is 3.10+
SKIPPED [2] tests/test_annotations.py:95: Incompatible behavior on older Pythons
SKIPPED [2] tests/test_annotations.py:386: Incompatible behavior on older Pythons
SKIPPED [1] tests/test_make.py:2495: Structural pattern matching is 3.10+
SKIPPED [1] tests/test_make.py:2506: Structural pattern matching is 3.10+
SKIPPED [2] tests/test_make.py:2520: Structural pattern matching is 3.10+
SKIPPED [1] tests/test_make.py:2535: Structural pattern matching is 3.10+
SKIPPED [1] tests/test_make.py:2555: Structural pattern matching is 3.10+
SKIPPED [1] tests/test_make.py:2590: Structural pattern matching is 3.10+
SKIPPED [1] tests/test_pyright.py:42: Requires pyright.
SKIPPED [1] tests/test_pyright.py:93: Requires pyright.
SKIPPED [1] tests/test_slots.py:497: slots without weakref_slot should only work on PyPy
XFAIL tests/test_setattr.py::TestSetAttr::test_slotted_confused
======================================================================= 1300 passed, 18 skipped, 1 xfailed in 24.72s ======================================================================== |
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
for more information, see https://pre-commit.ci
Looks like pre-commit trashes PR 😋 |
As much as I would like to drop 3.7, they're still more than 25% of our downloads:
So, until we have a good reason (CI dropping it, it prevents a useful new feature, …), I'll try to keep it aboard. Definitely, for the next release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Python 3.7 has been EOSed at 27 Jun 2023 (https://endoflife.date/python)
Filter all code over `pyupgrade --py38'.
Pull Request Check List
main
branch – use a separate branch!Our CI fails if coverage is not 100%.
.pyi
).tests/typing_example.py
.attr/__init__.pyi
, they've also been re-imported inattrs/__init__.pyi
.docs/api.rst
by hand.@attr.s()
have to be added by hand too.versionadded
,versionchanged
, ordeprecated
directives.The next version is the second number in the current release + 1.
The first number represents the current year.
So if the current version on PyPI is 22.2.0, the next version is gonna be 22.3.0.
If the next version is the first in the new year, it'll be 23.1.0.
.rst
and.md
files is written using semantic newlines.changelog.d
.