Skip to content

Update test_validators.py for Python 3.15a7#1530

Merged
hynek merged 1 commit intopython-attrs:mainfrom
vstinner:py315
Mar 18, 2026
Merged

Update test_validators.py for Python 3.15a7#1530
hynek merged 1 commit intopython-attrs:mainfrom
vstinner:py315

Conversation

@vstinner
Copy link
Contributor

@vstinner vstinner commented Mar 18, 2026

matches_re() error message changed in Python 3.15 alpha 7 with the introduction of re.prefixmatch().

Summary

Pull Request Check List

  • I acknowledge this project's AI policy.
  • This pull requests is not from my main branch.
  • There's tests for all new and changed code.
  • Changes or additions to public APIs are reflected in our type stubs (files ending in .pyi).
    • ...and used in the stub test file typing-examples/baseline.py or, if necessary, typing-examples/mypy.py.
    • If they've been added to attr/__init__.pyi, they've also been re-imported in attrs/__init__.pyi.
  • The documentation has been updated.
    • New functions/classes have to be added to docs/api.rst by hand.
    • Changes to the signatures of @attr.s() and @attrs.define() have to be added by hand too.
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated 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 26.2.0, the next version is gonna be 26.3.0.
      If the next version is the first in the new year, it'll be 27.1.0.
    • Documentation in .rst and .md files is written using semantic newlines.
  • Changes have news fragments in changelog.d.

matches_re() error message changed in Python 3.15 alpha 7 with the
introduction of re.prefixmatch().
@vstinner
Copy link
Contributor Author

"'func' must be one of None, fullmatch, match, search."
== ei.value.args[0]
)
if sys.version_info >= (3, 15):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to keep support for Python 3.15 alpha 6 by checking the whole version:

Suggested change
if sys.version_info >= (3, 15):
if sys.version_info >= (3, 15, 0, 'alpha', 7):

I don't think that it's worth it to support older alpha versions, so I just wrote (3, 15).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for us there's only the next big release, so this is correct

@vstinner vstinner marked this pull request as ready for review March 18, 2026 13:53
@vstinner
Copy link
Contributor Author

Changes have news fragments in changelog.d.

Python 3.15 is not released yet (it's still an alpha version), so I didn't add a changelog fragment.

Copy link
Member

@hynek hynek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@hynek hynek added this pull request to the merge queue Mar 18, 2026
@hynek
Copy link
Member

hynek commented Mar 18, 2026

@vstinner are y'all already testing 3.15 at RH? Can we expect more big things or is it a chiller release than 3.14?

@hroncok
Copy link

hroncok commented Mar 18, 2026

are y'all already testing 3.15 at RH?

As always, since 3.15.0a1 :) https://status.fedoralovespython.org/

Can we expect more big things or is it a chiller release than 3.14?

Usually, it's the first beta where all the changes are rushed in for the last possible moment, that decides this :D

Merged via the queue into python-attrs:main with commit 31e0286 Mar 18, 2026
17 checks passed
@vstinner vstinner deleted the py315 branch March 18, 2026 14:03
@vstinner
Copy link
Contributor Author

Thanks for (very) quickly merging my fix!

@vstinner are y'all already testing 3.15 at RH?

Yes, we are rebuilding all Python packages with the latest Python 3.15 release (so 3.15a7 currently), and most Python Fedora packages are running their test suite as part of the package build process. That's how we discovered the attrs issue on alpha7.

Can we expect more big things or is it a chiller release than 3.14?

That's the funny part: we don't know in advance :-D Things should settle down in May with the feature freeze (Python 3.15 beta1). My own opinion is that 3.15 migration seems to be easier than the 3.14 migration: less breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants