Skip to content

Commit

Permalink
Update dependencies to v24 (major) (#309)
Browse files Browse the repository at this point in the history
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [black](https://togithub.com/psf/black)
([changelog](https://togithub.com/psf/black/blob/main/CHANGES.md)) |
`23.3.0` -> `24.4.2` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/black/24.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/black/24.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/black/23.3.0/24.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/black/23.3.0/24.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [flake8](https://togithub.com/pycqa/flake8)
([changelog](https://flake8.pycqa.org/en/latest/release-notes/index.html))
| `5.0.4` -> `7.0.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/flake8/7.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/flake8/7.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/flake8/5.0.4/7.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/flake8/5.0.4/7.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [flake8-bugbear](https://togithub.com/PyCQA/flake8-bugbear#change-log)
([changelog](https://togithub.com/PyCQA/flake8-bugbear#change-log)) |
`23.3.12` -> `24.4.26` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/flake8-bugbear/24.4.26?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/flake8-bugbear/24.4.26?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/flake8-bugbear/23.3.12/24.4.26?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/flake8-bugbear/23.3.12/24.4.26?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [flake8-pytest-style](https://pypi.org/project/flake8-pytest-style)
([source](https://togithub.com/m-burst/flake8-pytest-style)) | `1.6.0`
-> `2.0.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/flake8-pytest-style/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/flake8-pytest-style/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/flake8-pytest-style/1.6.0/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/flake8-pytest-style/1.6.0/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [pytest](https://togithub.com/pytest-dev/pytest)
([changelog](https://docs.pytest.org/en/stable/changelog.html)) |
`7.4.4` -> `8.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/pytest/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/pytest/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/pytest/7.4.4/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pytest/7.4.4/8.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [pytest-cov](https://togithub.com/pytest-dev/pytest-cov)
([changelog](https://pytest-cov.readthedocs.io/en/latest/changelog.html))
| `4.1.0` -> `5.0.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/pytest-cov/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/pytest-cov/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/pytest-cov/4.1.0/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pytest-cov/4.1.0/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>psf/black (black)</summary>

###
[`v24.4.2`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2442)

[Compare Source](https://togithub.com/psf/black/compare/24.4.1...24.4.2)

This is a bugfix release to fix two regressions in the new f-string
parser introduced in
24.4.1.

##### Parser

- Fix regression where certain complex f-strings failed to parse
([#&#8203;4332](https://togithub.com/psf/black/issues/4332))

##### Performance

- Fix bad performance on certain complex string literals
([#&#8203;4331](https://togithub.com/psf/black/issues/4331))

###
[`v24.4.1`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2441)

[Compare Source](https://togithub.com/psf/black/compare/24.4.0...24.4.1)

##### Highlights

- Add support for the new Python 3.12 f-string syntax introduced by PEP
701 ([#&#8203;3822](https://togithub.com/psf/black/issues/3822))

##### Stable style

- Fix crash involving indented dummy functions containing newlines
([#&#8203;4318](https://togithub.com/psf/black/issues/4318))

##### Parser

- Add support for type parameter defaults, a new syntactic feature added
to Python 3.13
by PEP 696 ([#&#8203;4327](https://togithub.com/psf/black/issues/4327))

##### Integrations

- Github Action now works even when `git archive` is skipped
([#&#8203;4313](https://togithub.com/psf/black/issues/4313))

###
[`v24.4.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2440)

[Compare Source](https://togithub.com/psf/black/compare/24.3.0...24.4.0)

##### Stable style

- Fix unwanted crashes caused by AST equivalency check
([#&#8203;4290](https://togithub.com/psf/black/issues/4290))

##### Preview style

- `if` guards in `case` blocks are now wrapped in parentheses when the
line is too long.
    ([#&#8203;4269](https://togithub.com/psf/black/issues/4269))
- Stop moving multiline strings to a new line unless inside brackets
([#&#8203;4289](https://togithub.com/psf/black/issues/4289))

##### Integrations

- Add a new option `use_pyproject` to the GitHub Action `psf/black`.
This will read the
Black version from `pyproject.toml`.
([#&#8203;4294](https://togithub.com/psf/black/issues/4294))

###
[`v24.3.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2430)

[Compare Source](https://togithub.com/psf/black/compare/24.2.0...24.3.0)

##### Highlights

This release is a milestone: it fixes Black's first CVE security
vulnerability. If you
run Black on untrusted input, or if you habitually put thousands of
leading tab
characters in your docstrings, you are strongly encouraged to upgrade
immediately to fix

[CVE-2024-21503](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503).

This release also fixes a bug in Black's AST safety check that allowed
Black to make
incorrect changes to certain f-strings that are valid in Python 3.12 and
higher.

##### Stable style

- Don't move comments along with delimiters, which could cause crashes
([#&#8203;4248](https://togithub.com/psf/black/issues/4248))
- Strengthen AST safety check to catch more unsafe changes to strings.
Previous versions
of Black would incorrectly format the contents of certain unusual
f-strings containing
nested strings with the same quote type. Now, Black will crash on such
strings until
support for the new f-string syntax is implemented.
([#&#8203;4270](https://togithub.com/psf/black/issues/4270))
- Fix a bug where line-ranges exceeding the last code line would not
work as expected
    ([#&#8203;4273](https://togithub.com/psf/black/issues/4273))

##### Performance

- Fix catastrophic performance on docstrings that contain large numbers
of leading tab
    characters. This fixes

[CVE-2024-21503](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503).
    ([#&#8203;4278](https://togithub.com/psf/black/issues/4278))

##### Documentation

- Note what happens when `--check` is used with `--quiet`
([#&#8203;4236](https://togithub.com/psf/black/issues/4236))

###
[`v24.2.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2420)

[Compare Source](https://togithub.com/psf/black/compare/24.1.1...24.2.0)

##### Stable style

- Fixed a bug where comments where mistakenly removed along with
redundant parentheses
    ([#&#8203;4218](https://togithub.com/psf/black/issues/4218))

##### Preview style

- Move the `hug_parens_with_braces_and_square_brackets` feature to the
unstable style
due to an outstanding crash and proposed formatting tweaks
([#&#8203;4198](https://togithub.com/psf/black/issues/4198))
- Fixed a bug where base expressions caused inconsistent formatting of
\*\* in tenary
expression ([#&#8203;4154](https://togithub.com/psf/black/issues/4154))
- Checking for newline before adding one on docstring that is almost at
the line limit
    ([#&#8203;4185](https://togithub.com/psf/black/issues/4185))
- Remove redundant parentheses in `case` statement `if` guards
([#&#8203;4214](https://togithub.com/psf/black/issues/4214)).

##### Configuration

- Fix issue where *Black* would ignore input files in the presence of
symlinks ([#&#8203;4222](https://togithub.com/psf/black/issues/4222))
- *Black* now ignores `pyproject.toml` that is missing a `tool.black`
section when
discovering project root and configuration. Since *Black* continues to
use version
control as an indicator of project root, this is expected to primarily
change behavior
for users in a monorepo setup (desirably). If you wish to preserve
previous behavior,
simply add an empty `[tool.black]` to the previously discovered
`pyproject.toml`
    ([#&#8203;4204](https://togithub.com/psf/black/issues/4204))

##### Output

- Black will swallow any `SyntaxWarning`s or `DeprecationWarning`s
produced by the `ast`
module when performing equivalence checks
([#&#8203;4189](https://togithub.com/psf/black/issues/4189))

##### Integrations

- Add a JSONSchema and provide a validate-pyproject entry-point
([#&#8203;4181](https://togithub.com/psf/black/issues/4181))

###
[`v24.1.1`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2411)

[Compare Source](https://togithub.com/psf/black/compare/24.1.0...24.1.1)

Bugfix release to fix a bug that made Black unusable on certain file
systems with strict
limits on path length.

##### Preview style

- Consistently add trailing comma on typed parameters
([#&#8203;4164](https://togithub.com/psf/black/issues/4164))

##### Configuration

- Shorten the length of the name of the cache file to fix crashes on
file systems that
do not support long paths
([#&#8203;4176](https://togithub.com/psf/black/issues/4176))

###
[`v24.1.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2410)

[Compare
Source](https://togithub.com/psf/black/compare/23.12.1...24.1.0)

##### Highlights

This release introduces the new 2024 stable style
([#&#8203;4106](https://togithub.com/psf/black/issues/4106)),
stabilizing the following
changes:

- Add parentheses around `if`-`else` expressions
([#&#8203;2278](https://togithub.com/psf/black/issues/2278))
- Dummy class and function implementations consisting only of `...` are
formatted more
compactly ([#&#8203;3796](https://togithub.com/psf/black/issues/3796))
- If an assignment statement is too long, we now prefer splitting on the
right-hand side
    ([#&#8203;3368](https://togithub.com/psf/black/issues/3368))
- Hex codes in Unicode escape sequences are now standardized to
lowercase ([#&#8203;2916](https://togithub.com/psf/black/issues/2916))
- Allow empty first lines at the beginning of most blocks
([#&#8203;3967](https://togithub.com/psf/black/issues/3967),
[#&#8203;4061](https://togithub.com/psf/black/issues/4061))
- Add parentheses around long type annotations
([#&#8203;3899](https://togithub.com/psf/black/issues/3899))
- Enforce newline after module docstrings
([#&#8203;3932](https://togithub.com/psf/black/issues/3932),
[#&#8203;4028](https://togithub.com/psf/black/issues/4028))
- Fix incorrect magic trailing comma handling in return types
([#&#8203;3916](https://togithub.com/psf/black/issues/3916))
- Remove blank lines before class docstrings
([#&#8203;3692](https://togithub.com/psf/black/issues/3692))
- Wrap multiple context managers in parentheses if combined in a single
`with` statement
    ([#&#8203;3489](https://togithub.com/psf/black/issues/3489))
- Fix bug in line length calculations for power operations
([#&#8203;3942](https://togithub.com/psf/black/issues/3942))
- Add trailing commas to collection literals even if there's a comment
after the last
    entry ([#&#8203;3393](https://togithub.com/psf/black/issues/3393))
- When using `--skip-magic-trailing-comma` or `-C`, trailing commas are
stripped from
subscript expressions with more than 1 element
([#&#8203;3209](https://togithub.com/psf/black/issues/3209))
- Add extra blank lines in stubs in a few cases
([#&#8203;3564](https://togithub.com/psf/black/issues/3564),
[#&#8203;3862](https://togithub.com/psf/black/issues/3862))
- Accept raw strings as docstrings
([#&#8203;3947](https://togithub.com/psf/black/issues/3947))
- Split long lines in case blocks
([#&#8203;4024](https://togithub.com/psf/black/issues/4024))
- Stop removing spaces from walrus operators within subscripts
([#&#8203;3823](https://togithub.com/psf/black/issues/3823))
- Fix incorrect formatting of certain async statements
([#&#8203;3609](https://togithub.com/psf/black/issues/3609))
- Allow combining `# fmt: skip` with other comments
([#&#8203;3959](https://togithub.com/psf/black/issues/3959))

There are already a few improvements in the `--preview` style, which are
slated for the
2025 stable style. Try them out and
[share your feedback](https://togithub.com/psf/black/issues). In the
past, the preview
style has included some features that we were not able to stabilize.
This year, we're
adding a separate `--unstable` style for features with known problems.
Now, the
`--preview` style only includes features that we actually expect to make
it into next
year's stable style.

##### Stable style

Several bug fixes were made in features that are moved to the stable
style in this
release:

- Fix comment handling when parenthesising conditional expressions
([#&#8203;4134](https://togithub.com/psf/black/issues/4134))
- Fix bug where spaces were not added around parenthesized walruses in
subscripts,
unlike other binary operators
([#&#8203;4109](https://togithub.com/psf/black/issues/4109))
- Remove empty lines before docstrings in async functions
([#&#8203;4132](https://togithub.com/psf/black/issues/4132))
- Address a missing case in the change to allow empty lines at the
beginning of all
blocks, except immediately before a docstring
([#&#8203;4130](https://togithub.com/psf/black/issues/4130))
- For stubs, fix logic to enforce empty line after nested classes with
bodies ([#&#8203;4141](https://togithub.com/psf/black/issues/4141))

##### Preview style

- Add `--unstable` style, covering preview features that have known
problems that would
block them from going into the stable style. Also add the
`--enable-unstable-feature`
    flag; for example, use
`--enable-unstable-feature hug_parens_with_braces_and_square_brackets`
to apply this
preview feature throughout 2024, even if a later Black release
downgrades the feature
to unstable ([#&#8203;4096](https://togithub.com/psf/black/issues/4096))
- Format module docstrings the same as class and function docstrings
([#&#8203;4095](https://togithub.com/psf/black/issues/4095))
- Fix crash when using a walrus in a dictionary
([#&#8203;4155](https://togithub.com/psf/black/issues/4155))
- Fix unnecessary parentheses when wrapping long dicts
([#&#8203;4135](https://togithub.com/psf/black/issues/4135))
- Stop normalizing spaces before `# fmt: skip` comments
([#&#8203;4146](https://togithub.com/psf/black/issues/4146))

##### Configuration

- Print warning when configuration in `pyproject.toml` contains an
invalid key ([#&#8203;4165](https://togithub.com/psf/black/issues/4165))
- Fix symlink handling, properly ignoring symlinks that point outside of
root ([#&#8203;4161](https://togithub.com/psf/black/issues/4161))
- Fix cache mtime logic that resulted in false positive cache hits
([#&#8203;4128](https://togithub.com/psf/black/issues/4128))
- Remove the long-deprecated `--experimental-string-processing` flag.
This feature can
currently be enabled with `--preview --enable-unstable-feature
string_processing`.
    ([#&#8203;4096](https://togithub.com/psf/black/issues/4096))

##### Integrations

- Revert the change to run Black's pre-commit integration only on
specific git hooks
([#&#8203;3940](https://togithub.com/psf/black/issues/3940)) for better
compatibility with older versions of pre-commit
([#&#8203;4137](https://togithub.com/psf/black/issues/4137))

###
[`v23.12.1`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#23121)

[Compare
Source](https://togithub.com/psf/black/compare/23.12.0...23.12.1)

##### Packaging

- Fixed a bug that included dependencies from the `d` extra by default
([#&#8203;4108](https://togithub.com/psf/black/issues/4108))

###
[`v23.12.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#23120)

[Compare
Source](https://togithub.com/psf/black/compare/23.11.0...23.12.0)

##### Highlights

It's almost 2024, which means it's time for a new edition of *Black*'s
stable style!
Together with this release, we'll put out an alpha release 24.1a1
showcasing the draft
2024 stable style, which we'll finalize in the January release. Please
try it out and
[share your feedback](https://togithub.com/psf/black/issues/4042).

This release (23.12.0) will still produce the 2023 style. Most but not
all of the
changes in `--preview` mode will be in the 2024 stable style.

##### Stable style

- Fix bug where `# fmt: off` automatically dedents when used with the
`--line-ranges`
option, even when it is not within the specified line range.
([#&#8203;4084](https://togithub.com/psf/black/issues/4084))
- Fix feature detection for parenthesized context managers
([#&#8203;4104](https://togithub.com/psf/black/issues/4104))

##### Preview style

- Prefer more equal signs before a break when splitting chained
assignments ([#&#8203;4010](https://togithub.com/psf/black/issues/4010))
- Standalone form feed characters at the module level are no longer
removed ([#&#8203;4021](https://togithub.com/psf/black/issues/4021))
- Additional cases of immediately nested tuples, lists, and dictionaries
are now
indented less
([#&#8203;4012](https://togithub.com/psf/black/issues/4012))
- Allow empty lines at the beginning of all blocks, except immediately
before a
docstring ([#&#8203;4060](https://togithub.com/psf/black/issues/4060))
- Fix crash in preview mode when using a short `--line-length`
([#&#8203;4086](https://togithub.com/psf/black/issues/4086))
- Keep suites consisting of only an ellipsis on their own lines if they
are not
functions or class definitions
([#&#8203;4066](https://togithub.com/psf/black/issues/4066))
([#&#8203;4103](https://togithub.com/psf/black/issues/4103))

##### Configuration

- `--line-ranges` now skips *Black*'s internal stability check in
`--safe` mode. This
avoids a crash on rare inputs that have many unformatted same-content
lines. ([#&#8203;4034](https://togithub.com/psf/black/issues/4034))

##### Packaging

- Upgrade to mypy 1.7.1
([#&#8203;4049](https://togithub.com/psf/black/issues/4049))
([#&#8203;4069](https://togithub.com/psf/black/issues/4069))
- Faster compiled wheels are now available for CPython 3.12
([#&#8203;4070](https://togithub.com/psf/black/issues/4070))

##### Integrations

- Enable 3.12 CI
([#&#8203;4035](https://togithub.com/psf/black/issues/4035))
- Build docker images in parallel
([#&#8203;4054](https://togithub.com/psf/black/issues/4054))
- Build docker images with 3.12
([#&#8203;4055](https://togithub.com/psf/black/issues/4055))

###
[`v23.11.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#23110)

[Compare
Source](https://togithub.com/psf/black/compare/23.10.1...23.11.0)

##### Highlights

- Support formatting ranges of lines with the new `--line-ranges`
command-line option
    ([#&#8203;4020](https://togithub.com/psf/black/issues/4020))

##### Stable style

- Fix crash on formatting bytes strings that look like docstrings
([#&#8203;4003](https://togithub.com/psf/black/issues/4003))
- Fix crash when whitespace followed a backslash before newline in a
docstring ([#&#8203;4008](https://togithub.com/psf/black/issues/4008))
- Fix standalone comments inside complex blocks crashing Black
([#&#8203;4016](https://togithub.com/psf/black/issues/4016))
- Fix crash on formatting code like `await (a ** b)`
([#&#8203;3994](https://togithub.com/psf/black/issues/3994))
- No longer treat leading f-strings as docstrings. This matches Python's
behaviour and
fixes a crash
([#&#8203;4019](https://togithub.com/psf/black/issues/4019))

##### Preview style

- Multiline dicts and lists that are the sole argument to a function are
now indented
    less ([#&#8203;3964](https://togithub.com/psf/black/issues/3964))
- Multiline unpacked dicts and lists as the sole argument to a function
are now also
indented less
([#&#8203;3992](https://togithub.com/psf/black/issues/3992))
- In f-string debug expressions, quote types that are visible in the
final string are
now preserved
([#&#8203;4005](https://togithub.com/psf/black/issues/4005))
- Fix a bug where long `case` blocks were not split into multiple lines.
Also enable
general trailing comma rules on `case` blocks
([#&#8203;4024](https://togithub.com/psf/black/issues/4024))
- Keep requiring two empty lines between module-level docstring and
first function or
class definition
([#&#8203;4028](https://togithub.com/psf/black/issues/4028))
- Add support for single-line format skip with other comments on the
same line ([#&#8203;3959](https://togithub.com/psf/black/issues/3959))

##### Configuration

- Consistently apply force exclusion logic before resolving symlinks
([#&#8203;4015](https://togithub.com/psf/black/issues/4015))
- Fix a bug in the matching of absolute path names in `--include`
([#&#8203;3976](https://togithub.com/psf/black/issues/3976))

##### Performance

- Fix mypyc builds on arm64 on macOS
([#&#8203;4017](https://togithub.com/psf/black/issues/4017))

##### Integrations

- Black's pre-commit integration will now run only on git hooks
appropriate for a code
formatter ([#&#8203;3940](https://togithub.com/psf/black/issues/3940))

###
[`v23.10.1`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#23101)

[Compare
Source](https://togithub.com/psf/black/compare/23.10.0...23.10.1)

##### Highlights

- Maintenance release to get a fix out for GitHub Action edge case
([#&#8203;3957](https://togithub.com/psf/black/issues/3957))

##### Preview style

- Fix merging implicit multiline strings that have inline comments
([#&#8203;3956](https://togithub.com/psf/black/issues/3956))
- Allow empty first line after block open before a comment or compound
statement ([#&#8203;3967](https://togithub.com/psf/black/issues/3967))

##### Packaging

- Change Dockerfile to hatch + compile black
([#&#8203;3965](https://togithub.com/psf/black/issues/3965))

##### Integrations

- The summary output for GitHub workflows is now suppressible using the
`summary`
parameter. ([#&#8203;3958](https://togithub.com/psf/black/issues/3958))
- Fix the action failing when Black check doesn't pass
([#&#8203;3957](https://togithub.com/psf/black/issues/3957))

##### Documentation

-   It is known Windows documentation CI is broken

[https://github.com/psf/black/issues/3968](https://togithub.com/psf/black/issues/3968)3968

###
[`v23.10.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#23100)

[Compare
Source](https://togithub.com/psf/black/compare/23.9.1...23.10.0)

##### Stable style

- Fix comments getting removed from inside parenthesized strings
([#&#8203;3909](https://togithub.com/psf/black/issues/3909))

##### Preview style

- Fix long lines with power operators getting split before the line
length ([#&#8203;3942](https://togithub.com/psf/black/issues/3942))
- Long type hints are now wrapped in parentheses and properly indented
when split across
multiple lines
([#&#8203;3899](https://togithub.com/psf/black/issues/3899))
- Magic trailing commas are now respected in return types.
([#&#8203;3916](https://togithub.com/psf/black/issues/3916))
- Require one empty line after module-level docstrings.
([#&#8203;3932](https://togithub.com/psf/black/issues/3932))
- Treat raw triple-quoted strings as docstrings
([#&#8203;3947](https://togithub.com/psf/black/issues/3947))

##### Configuration

- Fix cache versioning logic when `BLACK_CACHE_DIR` is set
([#&#8203;3937](https://togithub.com/psf/black/issues/3937))

##### Parser

- Fix bug where attributes named `type` were not acccepted inside
`match` statements
    ([#&#8203;3950](https://togithub.com/psf/black/issues/3950))
- Add support for PEP 695 type aliases containing lambdas and other
unusual expressions
    ([#&#8203;3949](https://togithub.com/psf/black/issues/3949))

##### Output

- Black no longer attempts to provide special errors for attempting to
format Python 2
    code ([#&#8203;3933](https://togithub.com/psf/black/issues/3933))
- Black will more consistently print stacktraces on internal errors in
verbose mode
    ([#&#8203;3938](https://togithub.com/psf/black/issues/3938))

##### Integrations

- The action output displayed in the job summary is now wrapped in
Markdown ([#&#8203;3914](https://togithub.com/psf/black/issues/3914))

###
[`v23.9.1`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2391)

[Compare Source](https://togithub.com/psf/black/compare/23.9.0...23.9.1)

Due to various issues, the previous release (23.9.0) did not include
compiled mypyc
wheels, which make Black significantly faster. These issues have now
been fixed, and
this release should come with compiled wheels once again.

There will be no wheels for Python 3.12 due to a bug in mypyc. We will
provide 3.12
wheels in a future release as soon as the mypyc bug is fixed.

##### Packaging

- Upgrade to mypy 1.5.1
([#&#8203;3864](https://togithub.com/psf/black/issues/3864))

##### Performance

- Store raw tuples instead of NamedTuples in Black's cache, improving
performance and
decreasing the size of the cache
([#&#8203;3877](https://togithub.com/psf/black/issues/3877))

###
[`v23.9.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2390)

[Compare Source](https://togithub.com/psf/black/compare/23.7.0...23.9.0)

##### Preview style

- More concise formatting for dummy implementations
([#&#8203;3796](https://togithub.com/psf/black/issues/3796))
- In stub files, add a blank line between a statement with a body (e.g
an
`if sys.version_info > (3, x):`) and a function definition on the same
level ([#&#8203;3862](https://togithub.com/psf/black/issues/3862))
- Fix a bug whereby spaces were removed from walrus operators within
subscript([#&#8203;3823](https://togithub.com/psf/black/issues/3823))

##### Configuration

- Black now applies exclusion and ignore logic before resolving symlinks
([#&#8203;3846](https://togithub.com/psf/black/issues/3846))

##### Performance

- Avoid importing `IPython` if notebook cells do not contain magics
([#&#8203;3782](https://togithub.com/psf/black/issues/3782))
- Improve caching by comparing file hashes as fallback for mtime and
size ([#&#8203;3821](https://togithub.com/psf/black/issues/3821))

##### *Blackd*

- Fix an issue in `blackd` with single character input
([#&#8203;3558](https://togithub.com/psf/black/issues/3558))

##### Integrations

-   Black now has an
[official pre-commit
mirror](https://togithub.com/psf/black-pre-commit-mirror). Swapping
`https://github.com/psf/black` to
`https://github.com/psf/black-pre-commit-mirror` in
your `.pre-commit-config.yaml` will make Black about 2x faster
([#&#8203;3828](https://togithub.com/psf/black/issues/3828))
- The `.black.env` folder specified by `ENV_PATH` will now be removed on
the completion
of the GitHub Action
([#&#8203;3759](https://togithub.com/psf/black/issues/3759))

###
[`v23.7.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2370)

[Compare Source](https://togithub.com/psf/black/compare/23.3.0...23.7.0)

##### Highlights

- Runtime support for Python 3.7 has been removed. Formatting 3.7 code
will still be
supported until further notice
([#&#8203;3765](https://togithub.com/psf/black/issues/3765))

##### Stable style

- Fix a bug where an illegal trailing comma was added to return type
annotations using
PEP 604 unions
([#&#8203;3735](https://togithub.com/psf/black/issues/3735))
- Fix several bugs and crashes where comments in stub files were removed
or mishandled
under some circumstances
([#&#8203;3745](https://togithub.com/psf/black/issues/3745))
- Fix a crash with multi-line magic comments like `type: ignore` within
parentheses
    ([#&#8203;3740](https://togithub.com/psf/black/issues/3740))
- Fix error in AST validation when *Black* removes trailing whitespace
in a type comment
    ([#&#8203;3773](https://togithub.com/psf/black/issues/3773))

##### Preview style

- Implicitly concatenated strings used as function args are no longer
wrapped inside
parentheses ([#&#8203;3640](https://togithub.com/psf/black/issues/3640))
- Remove blank lines between a class definition and its docstring
([#&#8203;3692](https://togithub.com/psf/black/issues/3692))

##### Configuration

- The `--workers` argument to *Black* can now be specified via the
`BLACK_NUM_WORKERS`
environment variable
([#&#8203;3743](https://togithub.com/psf/black/issues/3743))
- `.pytest_cache`, `.ruff_cache` and `.vscode` are now excluded by
default ([#&#8203;3691](https://togithub.com/psf/black/issues/3691))
- Fix *Black* not honouring `pyproject.toml` settings when running
`--stdin-filename`
and the `pyproject.toml` found isn't in the current working directory
([#&#8203;3719](https://togithub.com/psf/black/issues/3719))
- *Black* will now error if `exclude` and `extend-exclude` have invalid
data types in
`pyproject.toml`, instead of silently doing the wrong thing
([#&#8203;3764](https://togithub.com/psf/black/issues/3764))

##### Packaging

- Upgrade mypyc from 0.991 to 1.3
([#&#8203;3697](https://togithub.com/psf/black/issues/3697))
- Remove patching of Click that mitigated errors on Python 3.6 with
`LANG=C` ([#&#8203;3768](https://togithub.com/psf/black/issues/3768))

##### Parser

- Add support for the new PEP 695 syntax in Python 3.12
([#&#8203;3703](https://togithub.com/psf/black/issues/3703))

##### Performance

- Speed up *Black* significantly when the cache is full
([#&#8203;3751](https://togithub.com/psf/black/issues/3751))
- Avoid importing `IPython` in a case where we wouldn't need it
([#&#8203;3748](https://togithub.com/psf/black/issues/3748))

##### Output

- Use aware UTC datetimes internally, avoids deprecation warning on
Python 3.12 ([#&#8203;3728](https://togithub.com/psf/black/issues/3728))
- Change verbose logging to exactly mirror *Black*'s logic for source
discovery ([#&#8203;3749](https://togithub.com/psf/black/issues/3749))

##### *Blackd*

- The `blackd` argument parser now shows the default values for options
in their help
    text ([#&#8203;3712](https://togithub.com/psf/black/issues/3712))

##### Integrations

-   Black is now tested with
[`PYTHONWARNDEFAULTENCODING =
1`](https://docs.python.org/3/library/io.html#io-encoding-warning)
    ([#&#8203;3763](https://togithub.com/psf/black/issues/3763))
- Update GitHub Action to display black output in the job summary
([#&#8203;3688](https://togithub.com/psf/black/issues/3688))

##### Documentation

- Add a CITATION.cff file to the root of the repository, containing
metadata on how to
cite this software
([#&#8203;3723](https://togithub.com/psf/black/issues/3723))
- Update the *classes* and *exceptions* documentation in Developer
reference to match
the latest code base
([#&#8203;3755](https://togithub.com/psf/black/issues/3755))

</details>

<details>
<summary>pycqa/flake8 (flake8)</summary>

### [`v7.0.0`](https://togithub.com/pycqa/flake8/compare/6.1.0...7.0.0)

[Compare
Source](https://togithub.com/pycqa/flake8/compare/6.1.0...7.0.0)

### [`v6.1.0`](https://togithub.com/pycqa/flake8/compare/6.0.0...6.1.0)

[Compare
Source](https://togithub.com/pycqa/flake8/compare/6.0.0...6.1.0)

### [`v6.0.0`](https://togithub.com/pycqa/flake8/compare/5.0.4...6.0.0)

[Compare
Source](https://togithub.com/pycqa/flake8/compare/5.0.4...6.0.0)

</details>

<details>
<summary>PyCQA/flake8-bugbear (flake8-bugbear)</summary>

###
[`v24.4.26`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/24.4.26):
24.4.6

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/24.4.21...24.4.26)

- B909: Fix false positive affecting containers of mutables
([#&#8203;469](https://togithub.com/PyCQA/flake8-bugbear/issues/469))

###
[`v24.4.21`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/24.4.21)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/24.2.6...24.4.21)

- B950: Add pragma comment to line length ignores
([#&#8203;463](https://togithub.com/PyCQA/flake8-bugbear/issues/463))
- B909: Add more cases to detect + more container mutating functions
([#&#8203;460](https://togithub.com/PyCQA/flake8-bugbear/issues/460))

###
[`v24.2.6`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/24.2.6)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/24.1.17...24.2.6)

- B902: Remove decorators named validator and root_validator from B902
checks
([#&#8203;459](https://togithub.com/PyCQA/flake8-bugbear/issues/459))
- B038: Change B038 to B909 and make it optional
([#&#8203;456](https://togithub.com/PyCQA/flake8-bugbear/issues/456))

###
[`v24.1.17`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/24.1.17)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/24.1.16...24.1.17)

- B038: Restrict rule to mutation functions only
([#&#8203;453](https://togithub.com/PyCQA/flake8-bugbear/issues/453))

###
[`v24.1.16`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/24.1.16)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/24.1.15...24.1.16)

-   B036: Fix crash on `raise` statements raising something other than

###
[`v24.1.15`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/24.1.15)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.12.2...24.1.15)

- B038: Add check for mutations of loop iterator
([#&#8203;446](https://togithub.com/PyCQA/flake8-bugbear/issues/446))
- B037: Add check for yielding or returning values in **init**()
([#&#8203;442](https://togithub.com/PyCQA/flake8-bugbear/issues/442))
- B017: make B017 also apply to BaseException
([#&#8203;439](https://togithub.com/PyCQA/flake8-bugbear/issues/439))
- B036: Add check for except BaseException without re-raising
([#&#8203;438](https://togithub.com/PyCQA/flake8-bugbear/issues/438))

###
[`v23.12.2`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.12.2)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.11.28...23.12.2)

- B018: to detect useless-statements at all levels
([#&#8203;434](https://togithub.com/PyCQA/flake8-bugbear/issues/434))
- B018: Add classname to b018 useless-expression output
([#&#8203;433](https://togithub.com/PyCQA/flake8-bugbear/issues/433))
- B018: Include tuples in b018 useless-statement check
([#&#8203;432](https://togithub.com/PyCQA/flake8-bugbear/issues/432))

###
[`v23.11.28`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.11.28)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.11.26...23.11.28)

- B035: Fix false positive when named expressions are used
([#&#8203;430](https://togithub.com/PyCQA/flake8-bugbear/issues/430))

###
[`v23.11.26`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.11.26)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.9.16...23.11.26)

- B035: add check for static keys in dict-comprehension
([#&#8203;426](https://togithub.com/PyCQA/flake8-bugbear/issues/426))
- B902: Add exceptions for standard library metaclasses
([#&#8203;415](https://togithub.com/PyCQA/flake8-bugbear/issues/415))
- B017: Modify to no longer have a false negative when raises() is
imported
directly from pytest
([#&#8203;424](https://togithub.com/PyCQA/flake8-bugbear/issues/424))
- B026: Fix bug where the check was not triggered for calls where the
caller
is an attribute
([#&#8203;420](https://togithub.com/PyCQA/flake8-bugbear/issues/420))

###
[`v23.9.16`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.9.16)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.7.10...23.9.16)

- add --classmethod-decorators
([#&#8203;405](https://togithub.com/PyCQA/flake8-bugbear/issues/405))
- fix name collision for node_stack on python 3.12
([#&#8203;406](https://togithub.com/PyCQA/flake8-bugbear/issues/406))
- Use pypa/build to build the package
([#&#8203;404](https://togithub.com/PyCQA/flake8-bugbear/issues/404))

###
[`v23.7.10`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.7.10)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.6.5...23.7.10)

- Add B034: re.sub/subn/split must pass flags/count/maxsplit as keyword
arguments.
- Fix a crash and several test failures on Python 3.12, all relating to
the B907
    check.
-   Declare support for Python 3.12.

###
[`v23.6.5`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.6.5)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.5.9...23.6.5)

- Include tox.ini in MANIFEST.in for sdist.
([#&#8203;389](https://togithub.com/PyCQA/flake8-bugbear/issues/389))
- Improve B033 (duplicate set items)
([#&#8203;385](https://togithub.com/PyCQA/flake8-bugbear/issues/385))

###
[`v23.5.9`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.5.9)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.3.23...23.5.9)

-   Add B033: Detect duplicate items in sets
- Add B908: Detect assertRauses like contexts only has top level
statements that could throw
- Add B028: Allow stacklevel to be explicitly assigned as a positional
argument
-   Remove more < 3.8 checks / assertions

###
[`v23.3.23`](https://togithub.com/PyCQA/flake8-bugbear/releases/tag/23.3.23)

[Compare
Source](https://togithub.com/PyCQA/flake8-bugbear/compare/23.3.12...23.3.23)

-   flake8-bugbear is now >= 3.8.1 project like flake8>=6.0.0
- This has allowed some more modern AST usage cleanup and less CI
running etc.
- B030: Fix crash on certain unusual except handlers (e.g. `except
a[0].b:`)

</details>

<details>
<summary>m-burst/flake8-pytest-style (flake8-pytest-style)</summary>

###
[`v2.0.0`](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.7.2...v2.0.0)

[Compare
Source](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.7.2...v2.0.0)

###
[`v1.7.2`](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.7.1...v1.7.2)

[Compare
Source](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.7.1...v1.7.2)

###
[`v1.7.1`](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.7.0...v1.7.1)

[Compare
Source](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.7.0...v1.7.1)

###
[`v1.7.0`](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.6.0...v1.7.0)

[Compare
Source](https://togithub.com/m-burst/flake8-pytest-style/compare/v1.6.0...v1.7.0)

</details>

<details>
<summary>pytest-dev/pytest (pytest)</summary>

###
[`v8.2.0`](https://togithub.com/pytest-dev/pytest/releases/tag/8.2.0)

[Compare
Source](https://togithub.com/pytest-dev/pytest/compare/8.1.2...8.2.0)

# pytest 8.2.0 (2024-04-27)

## Deprecations

- [#&#8203;12069](https://togithub.com/pytest-dev/pytest/issues/12069):
A deprecation warning is now raised when implementations of one of the
following hooks request a deprecated `py.path.local` parameter instead
of the `pathlib.Path` parameter which replaced it:

- `pytest_ignore_collect`{.interpreted-text role="hook"} - the `path`
parameter - use `collection_path` instead.
- `pytest_collect_file`{.interpreted-text role="hook"} - the `path`
parameter - use `file_path` instead.
- `pytest_pycollect_makemodule`{.interpreted-text role="hook"} - the
`path` parameter - use `module_path` instead.
- `pytest_report_header`{.interpreted-text role="hook"} - the `startdir`
parameter - use `start_path` instead.
- `pytest_report_collectionfinish`{.interpreted-text role="hook"} - the
`startdir` parameter - use `start_path` instead.

    The replacement parameters are available since pytest 7.0.0.
    The old parameters will be removed in pytest 9.0.0.

See `legacy-path-hooks-deprecated`{.interpreted-text role="ref"} for
more details.

## Features

- [#&#8203;11871](https://togithub.com/pytest-dev/pytest/issues/11871):
Added support for reading command line arguments from a file using the
prefix character `@`, like e.g.: `pytest @&#8203;tests.txt`. The file
must have one argument per line.

See `Read arguments from file <args-from-file>`{.interpreted-text
role="ref"} for details.

## Improvements

- [#&#8203;11523](https://togithub.com/pytest-dev/pytest/issues/11523):
`pytest.importorskip`{.interpreted-text role="func"} will now issue a
warning if the module could be found, but raised
`ImportError`{.interpreted-text role="class"} instead of
`ModuleNotFoundError`{.interpreted-text role="class"}.

The warning can be suppressed by passing `exc_type=ImportError` to
`pytest.importorskip`{.interpreted-text role="func"}.

See `import-or-skip-import-error`{.interpreted-text role="ref"} for
details.

- [#&#8203;11728](https://togithub.com/pytest-dev/pytest/issues/11728):
For `unittest`-based tests, exceptions during class cleanup (as raised
by functions registered with `TestCase.addClassCleanup
<unittest.TestCase.addClassCleanup>`{.interpreted-text role="meth"}) are
now reported instead of silently failing.

- [#&#8203;11777](https://togithub.com/pytest-dev/pytest/issues/11777):
Text is no longer truncated in the `short test summary info` section
when `-vv` is given.

- [#&#8203;12112](https://togithub.com/pytest-dev/pytest/issues/12112):
Improved namespace packages detection when
`consider_namespace_packages`{.interpreted-text role="confval"} is
enabled, covering more situations (like editable installs).

- [#&#8203;9502](https://togithub.com/pytest-dev/pytest/issues/9502):
Added `PYTEST_VERSION`{.interpreted-text role="envvar"} environment
variable which is defined at the start of the pytest session and
undefined afterwards. It contains the value of `pytest.__version__`, and
among other things can be used to easily check if code is running from
within a pytest run.

## Bug Fixes

- [#&#8203;12065](https://togithub.com/pytest-dev/pytest/issues/12065):
Fixed a regression in pytest 8.0.0 where test classes containing
`setup_method` and tests using `@staticmethod` or `@classmethod` would
crash with `AttributeError: 'NoneType' object has no attribute
'setup_method'`.

Now the `request.instance
<pytest.FixtureRequest.instance>`{.interpreted-text role="attr"}
attribute of tests using `@staticmethod` and `@classmethod` is no longer
`None`, but a fresh instance of the class, like in non-static methods.
Previously it was `None`, and all fixtures of such tests would share a
single `self`.

- [#&#8203;12135](https://togithub.com/pytest-dev/pytest/issues/12135):
Fixed issue where fixtures adding their finalizer multiple times to
fixtures they request would cause unreliable and non-intuitive teardown
ordering in some instances.

- [#&#8203;12194](https://togithub.com/pytest-dev/pytest/issues/12194):
Fixed a bug with `--importmode=importlib` and `--doctest-modules` where
child modules did not appear as attributes in parent modules.

- [#&#8203;1489](https://togithub.com/pytest-dev/pytest/issues/1489):
Fixed some instances where teardown of higher-scoped fixtures was not
happening in the reverse order they were initialized in.

## Trivial/Internal Changes

- [#&#8203;12069](https://togithub.com/pytest-dev/pytest/issues/12069):
`pluggy>=1.5.0` is now required.
- [#&#8203;12167](https://togithub.com/pytest-dev/pytest/issues/12167):
`cache <cache>`{.interpreted-text role="ref"}: create supporting files
(`CACHEDIR.TAG`, `.gitignore`, etc.) in a temporary directory to provide
atomic semantics.

###
[`v8.1.2`](https://togithub.com/pytest-dev/pytest/releases/tag/8.1.2)

[Compare
Source](https://togithub.com/pytest-dev/pytest/compare/8.1.1...8.1.2)

# pytest 8.1.2 (2024-04-26)

## Bug Fixes

- [#&#8203;12114](https://togithub.com/pytest-dev/pytest/issues/12114):
Fixed error in `pytest.approx`{.interpreted-text role="func"} when used
with \[numpy]{.title-ref} arrays and comparing with other types.

###
[`v8.1.1`](https://togithub.com/pytest-dev/pytest/releases/tag/8.1.1)

[Compare
Source](https://togithub.com/pytest-dev/pytest/compare/8.1.0...8.1.1)

# pytest 8.1.1 (2024-03-08)

::: {.note}
::: {.title}
Note
:::

This release is not a usual bug fix release -- it contains features and
improvements, being a follow up
to `8.1.0`, which has been yanked from PyPI.
:::

## Features

- [#&#8203;11475](https://togithub.com/pytest-dev/pytest/issues/11475):
Added the new `consider_namespace_packages`{.interpreted-text
role="confval"} configuration option, defaulting to `False`.

If set to `True`, pytest will attempt to identify modules that are part
of [namespace
packages](https://packaging.python.org/en/latest/guides/packaging-namespace-packages)
when importing modules.

- [#&#8203;11653](https://togithub.com/pytest-dev/pytest/issues/11653):
Added the new `verbosity_test_cases`{.interpreted-text role="confval"}
configuration option for fine-grained control of test execution
verbosity.
See `Fine-grained verbosity
<pytest.fine_grained_verbosity>`{.interpreted-text role="ref"} for more
details.

## Improvements

- [#&#8203;10865](https://togithub.com/pytest-dev/pytest/issues/10865):
`pytest.warns`{.interpreted-text role="func"} now validates that
`warnings.warn`{.interpreted-text role="func"} was called with a
\[str]{.title-ref} or a \[Warning]{.title-ref}.
Currently in Python it is possible to use other types, however this
causes an exception when `warnings.filterwarnings`{.interpreted-text
role="func"} is used to filter those warnings (see [CPython
#&#8203;103577](https://togithub.com/python/cpython/issues/103577) for a
discussion).
While this can be considered a bug in CPython, we decided to put guards
in pytest as the error message produced without this check in place is
confusing.

- [#&#8203;11311](https://togithub.com/pytest-dev/pytest/issues/11311):
When using `--override-ini` for paths in invocations without a
configuration file defined, the current working directory is used
    as the relative directory.

Previoulsy this would raise an `AssertionError`{.interpreted-text
role="class"}.

- [#&#8203;11475](https://togithub.com/pytest-dev/pytest/issues/11475):
`--import-mode=importlib <import-mode-importlib>`{.interpreted-text
role="ref"} now tries to import modules using the standard import
mechanism (but still without changing :py`sys.path`{.interpreted-text
role="data"}), falling back to importing modules directly only if that
fails.

This means that installed packages will be imported under their
canonical name if possible first, for example `app.core.models`, instead
of having the module name always be derived from their path (for example
`.env310.lib.site_packages.app.core.models`).

- [#&#8203;11801](https://togithub.com/pytest-dev/pytest/issues/11801):
Added the `iter_parents()
<_pytest.nodes.Node.iter_parents>`{.interpreted-text role="func"} helper
method on nodes.
It is similar to `listchain
<_pytest.nodes.Node.listchain>`{.interpreted-text role="func"}, but goes
from bottom to top, and returns an iterator, not a list.

- [#&#8203;11850](https://togithub.com/pytest-dev/pytest/issues/11850):
Added support for `sys.last_exc`{.interpreted-text role="data"} for
post-mortem debugging on Python>=3.12.

- [#&#8203;11962](https://togithub.com/pytest-dev/pytest/issues/11962):
In case no other suitable candidates for configuration file are found, a
`pyproject.toml` (even without a `[tool.pytest.ini_options]` table) will
be considered as the configuration file and define the `rootdir`.

- [#&#8203;11978](https://togithub.com/pytest-dev/pytest/issues/11978):
Add `--log-file-mode` option to the logging plugin, enabling appending
to log-files. This option accepts either `"w"` or `"a"` and defaults to
`"w"`.

Previously, the mode was hard-coded to be `"w"` which truncates the file
before logging.

- [#&#8203;12047](https://togithub.com/pytest-dev/pytest/issues/12047):
When multiple finalizers of a fixture raise an exception, now all
exceptions are reported as an exception group.
    Previously, only the first exception was reported.

## Bug Fixes

- [#&#8203;11475](https://togithub.com/pytest-dev/pytest/issues/11475):
Fixed regression where `--importmode=importlib` would import non-test
modules more than once.

- [#&#8203;11904](https://togithub.com/pytest-dev/pytest/issues/11904):
Fixed a regression in pytest 8.0.0 that would cause test collection to
fail due to permission errors when using `--pyargs`.

This change improves the collection tree for tests specified using
`--pyargs`, see `12043`{.interpreted-text role="pull"} for a comparison
with pytest 8.0 and <8.

- [#&#8203;12011](https://togithub.com/pytest-dev/pytest/issues/12011):
Fixed a regression in 8.0.1 whereby `setup_module` xunit-style fixtures
are not executed when `--doctest-modules` is passed.

- [#&#8203;12014](https://togithub.com/pytest-dev/pytest/issues/12014):
Fix the `stacklevel` used when warning about marks used on fixtures.

- [#&#8203;12039](https://togithub.com/pytest-dev/pytest/issues/12039):
Fixed a regression in `8.0.2` where tests created using
`tmp_path`{.interpreted-text role="fixture"} have been collected
multiple times in CI under Windows.

## Improved Documentation

- [#&#8203;11790](https://togithub.com/pytest-dev/pytest/issues/11790):
Documented the retention of temporary directories created using the
`tmp_path` fixture in more detail.

## Trivial/Internal Changes

- [#&#8203;11785](https://togithub.com/pytest-dev/pytest/issues/11785):
Some changes were made to private functions which may affect plugins
which access them:

- `FixtureManager._getautousenames()` now takes a `Node` itself instead
of the nodeid.
- `FixtureManager.getfixturedefs()` now takes the `Node` itself instead
of the nodeid.
- The `_pytest.nodes.iterparentnodeids()` function is removed without
replacement.
        Prefer to traverse the node hierarchy itself instead.
If you really need to, copy the function from the previous pytest
release.

- [#&#8203;12069](https://togithub.com/pytest-dev/pytest/issues/12069):
Delayed the deprecation of the following features to `9.0.0`:

    -   `node-ctor-fspath-deprecation`{.interpreted-text role="ref"}.
    -   `legacy-path-hooks-deprecated`{.interpreted-text role="ref"}.

It was discovered after `8.1.0` was released that the warnings about the
impeding removal were not being displayed, so the team decided to revert
the removal.

    This is the reason for `8.1.0` being yanked.

# pytest 8.1.0 (YANKED)

::: {.note}
::: {.title}
Note
:::

This release has been **yanked**: it broke some plugins without the
proper warning period, due to
some warnings not showing up as expected.

See
[#&#8203;12069](https://togithub.com/pytest-dev/pytest/issues/12069).
:::

###
[`v8.1.0`](https://togithub.com/pytest-dev/pytest/releases/tag/8.1.0)

[Compare
Source](https://togithub.com/pytest-dev/pytest/compare/8.0.2...8.1.0)

# pytest 8.1.0 (YANKED)

> \[!IMPORTANT]\
> This release has been **yanked**: it broke some plugins without the
proper warning period, due to some warnings not showing up as expected.
See
[#&#8203;12069](https://togithub.com/pytest-dev/pytest/issues/12069).

## Features

- [#&#8203;11475](https://togithub.com/pytest-dev/pytest/issues/11475):
Added the new `consider_namespace_packages`{.interpreted-text
role="confval"} configuration option, defaulting to `False`.

If set to `True`, pytest will attempt to identify modules that are part
of [namespace
packages](https://packaging.python.org/en/latest/guides/packaging-namespace-packages)
when importing modules.

- [#&#8203;11653](https://togithub.com/pytest-dev/pytest/issues/11653):
Added the new `verbosity_test_cases`{.interpreted-text role="confval"}
configuration option for fine-grained control of test execution
verbosity.
See `Fine-grained verbosity
<pytest.fine_grained_verbosity>`{.interpreted-text role="ref"} for more
details.

## Improvements

- [#&#8203;10865](https://togithub.com/pytest-dev/pytest/issues/10865):
`pytest.warns`{.interpreted-text role="func"} now validates that
`warnings.warn`{.interpreted-text role="func"} was called with a
\[str]{.title-ref} or a \[Warning]{.title-ref}.
Currently in Python it is possible to use other types, however this
causes an exception when `warnings.filterwarnings`{.interpreted-text
role="func"} is used to filter those warnings (see [CPython
#&#8203;103577](https://togithub.com/python/cpython/issues/103577) for a
discussion).
While this can be considered a bug in CPython, we decided to put guards
in pytest as the error message produced without this check in place is
confusing.

- [#&#8203;11311](https://togithub.com/pytest-dev/pytest/issues/11311):
When using `--override-ini` for paths in invocations without a
configuration file defined, the current working directory is used
    as the relative directory.

Previoulsy this would raise an `AssertionError`{.interpreted-text
role="class"}.

- [#&#8203;11475](https://togithub.com/pytest-dev/pytest/issues/11475):
`--import-mode=importlib <import-mode-importlib>`{.interpreted-text
role="ref"} now tries to import modules using the standard import
mechanism (but still without changing :py`sys.path`{.interpreted-text
role="data"}), falling back to importing modules directly only if that
fails.

This means that installed packages will be imported under their
canonical name if possible first, for example `app.core.models`, instead
of having the module name always be derived from their path (for example
`.env310.lib.site_packages.app.core.models`).

- [#&#8203;11801](https://togithub.com/pytest-dev/pytest/issues/11801):
Added the `iter_parents()
<_pytest.nodes.Node.iter_parents>`{.interpreted-text role="func"} helper
method on nodes.
It is similar to `listchain
<_pytest.nodes.Node.listchain>`{.interpreted-text role="func"}, but goes
from bottom to top, and returns an iterator, not a list.

- [#&#8203;11850](https://togithub.com/pytest-dev/pytest/issues/11850):
Added support for `sys.last_exc`{.interpreted-text role="data"} for
post-mortem debugging on Python>=3.12.

- [#&#8203;11962](https://togithub.com/pytest-dev/pytest/issues/11962):
In case no other suitable candidates for configuration file are found, a
`pyproject.toml` (even without a `[tool.pytest.ini_options]` table) will
be considered as the configuration file and define the `rootdir`.

- [#&#8203;11978](https://togithub.com/pytest-dev/pytest/issues/11978):
Add `--log-file-mode` option to the logging plugin, enabling appending
to log-files. This option accepts either `"w"` or `"a"` and defaults to
`"w"`.

Previously, the mode was hard-coded to be `"w"` which truncates the file
before logging.

- [#&#8203;12047](https://togithub.com/pytest-dev/pytest/issues/12047):
When multiple finalizers of a fixture raise an exception, now all
exceptions are reported as an exception group.
    Previously, only the first exception was reported.

## Bug Fixes

- [#&#8203;11904](https://togithub.com/pytest-dev/pytest/issues/11904):
Fixed a regression in pytest 8.0.0 that would cause test collection to
fail due to permission errors when using `--pyargs`.

This change improves the collection tree for tests specified using
`--pyargs`, see `12043`{.interpreted-text role="pull"} for a comparison
with pytest 8.0 and <8.

- [#&#8203;12011](https://togithub.com/pytest-dev/pytest/issues/12011):
Fixed a regression in 8.0.1 whereby `setup_module` xunit-style fixtures
are not executed when `--doctest-modules` is passed.

- [#&#8203;12014](https://togithub.com/pytest-dev/pytest/issues/12014):
Fix the `stacklevel` used when warning about marks used on fixtures.

- [#&#8203;12039](https://togithub.com/pytest-dev/pytest/issues/12039):
Fixed a regression in `8.0.2` where tests created using
`tmp_path`{.interpreted-text role="fixture"} have been collected
multiple times in CI under Windows.

## Improved Documentation

- [#&#8203;11790](https://togithub.com/pytest-dev/pytest/issues/11790):
Documented the retention of temporary directories created using the
`tmp_path` fixture in more detail.

## Trivial/Internal Changes

- [#&#8203;11785](https://togithub.com/pytest-dev/pytest/issues/11785):
Some changes were made to private functions which may affect plugins
which access them:
- `FixtureManager._getautousenames()` now takes a `Node` itself instead
of the nodeid.
- `FixtureManager.getfixturedefs()` now takes the `Node` itself instead
of the nodeid.
- The `_pytest.nodes.iterparentnodeids()` function is removed without
replacement.
        Prefer to traverse the node hierarchy itself instead.
If you really need to, copy the function from the previous pytest
release.

###
[`v8.0.2`](https://togithub.com/pytest-dev/pytest/releases/tag/8.0.2)

[Compare
Source](https://togithub.com/pytest-dev/pytest/compare/8.0.1...8.0.2)

# pytest 8.0.2 (2024-02-24)

## Bug Fixes

- [#&#8203;11895](https://togithub.com/pytest-dev/pytest/issues/11895):
Fix collection on Windows where initial paths contain the short version
of a path (for exampl

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/rpdelaney/downforeveryone).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
  • Loading branch information
rpdelaney committed May 8, 2024
2 parents f4a1007 + 7acb87d commit 22f66e6
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 22f66e6

Please sign in to comment.