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

Only use a single cache file per Python package #5117

Merged
merged 8 commits into from
Jun 19, 2023
Merged

Conversation

Thomasdezeeuw
Copy link
Contributor

@Thomasdezeeuw Thomasdezeeuw commented Jun 15, 2023

Summary

This changes the caching design from one cache file per source file, to
one cache file per package. This greatly reduces the amount of cache
files that are opened and written, while maintaining roughly the same
(combined) size as bincode is very compact.

Below are some very much not scientific performance tests. It uses
projects/sources to check:

  • small.py: single, 31 bytes Python file with 2 errors.
  • test.py: single, 43k Python file with 8 errors.
  • fastapi: FastAPI repo, 1134 files checked, 0 errors.
Source Before # files After # files Before size After size
small.py 1 1 20 K 20 K
test.py 1 1 60 K 60 K
fastapi 1134 518 4.5 M 2.3 M

One question that might come up is why fastapi still has 518 cache files
and not 1? That is because this is using the existing package
resolution, which sees examples, docs, etc. as separate from the "main"
source code (in the fastapi directory in the repo). In this future it
might be worth consider switching to a one cache file per repo strategy.

This new design is not perfect and does have a number of known issues.
First, like the old design it doesn't remove the cache for a source file
that has been (re)moved until ruff clean is called.

Second, this currently uses a large mutex around the mutation of the
package cache (e.g. inserting result). This could be (or become) a
bottleneck. It's future work to test and improve this (if needed).

Third, currently the packages and opened and stored in a sequential
loop, this could be done parallel. This is also future work.

Test Plan

Run ruff check (with caching enabled) twice on any Python source code and it should produce the same results.

After this general direction is approved I'll add some tests.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 15, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      6.3±0.02ms     6.5 MB/sec    1.00      6.3±0.02ms     6.5 MB/sec
formatter/numpy/ctypeslib.py               1.00   1328.0±6.19µs    12.5 MB/sec    1.00   1329.4±2.50µs    12.5 MB/sec
formatter/numpy/globals.py                 1.00    128.6±0.30µs    23.0 MB/sec    1.00    128.7±0.51µs    22.9 MB/sec
formatter/pydantic/types.py                1.00      2.6±0.01ms     9.9 MB/sec    1.00      2.6±0.01ms     9.9 MB/sec
linter/all-rules/large/dataset.py          1.01     13.6±0.06ms     3.0 MB/sec    1.00     13.5±0.12ms     3.0 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      3.3±0.01ms     5.0 MB/sec    1.00      3.3±0.01ms     5.0 MB/sec
linter/all-rules/numpy/globals.py          1.00    422.0±0.67µs     7.0 MB/sec    1.00    420.4±0.76µs     7.0 MB/sec
linter/all-rules/pydantic/types.py         1.00      5.8±0.01ms     4.4 MB/sec    1.00      5.8±0.02ms     4.4 MB/sec
linter/default-rules/large/dataset.py      1.00      6.7±0.02ms     6.0 MB/sec    1.00      6.7±0.01ms     6.1 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1471.1±1.50µs    11.3 MB/sec    1.00   1464.2±3.88µs    11.4 MB/sec
linter/default-rules/numpy/globals.py      1.00    163.8±0.62µs    18.0 MB/sec    1.00    163.5±0.36µs    18.0 MB/sec
linter/default-rules/pydantic/types.py     1.01      3.1±0.02ms     8.3 MB/sec    1.00      3.1±0.00ms     8.4 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.01     12.2±0.64ms     3.3 MB/sec    1.00     12.1±0.59ms     3.4 MB/sec
formatter/numpy/ctypeslib.py               1.00      2.3±0.18ms     7.3 MB/sec    1.01      2.3±0.15ms     7.2 MB/sec
formatter/numpy/globals.py                 1.00   226.3±27.99µs    13.0 MB/sec    1.00   227.3±17.42µs    13.0 MB/sec
formatter/pydantic/types.py                1.00      4.7±0.24ms     5.5 MB/sec    1.00      4.7±0.24ms     5.5 MB/sec
linter/all-rules/large/dataset.py          1.00     25.1±0.84ms  1657.0 KB/sec    1.00     25.1±0.82ms  1658.6 KB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      6.5±0.32ms     2.6 MB/sec    1.00      6.4±0.28ms     2.6 MB/sec
linter/all-rules/numpy/globals.py          1.02   707.7±52.33µs     4.2 MB/sec    1.00   690.6±40.91µs     4.3 MB/sec
linter/all-rules/pydantic/types.py         1.00     10.7±0.45ms     2.4 MB/sec    1.02     10.8±0.49ms     2.4 MB/sec
linter/default-rules/large/dataset.py      1.00     12.9±0.39ms     3.2 MB/sec    1.00     12.9±0.42ms     3.1 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00      2.5±0.10ms     6.8 MB/sec    1.00      2.4±0.09ms     6.8 MB/sec
linter/default-rules/numpy/globals.py      1.03   298.8±24.69µs     9.9 MB/sec    1.00   291.0±16.26µs    10.1 MB/sec
linter/default-rules/pydantic/types.py     1.05      5.7±0.28ms     4.4 MB/sec    1.00      5.5±0.25ms     4.7 MB/sec

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

Can't judge the overall strategy, but the code looks good.

I know it has been missing before, but could you maybe at some module level docs or a readme explaining what information we cache?

crates/ruff_cli/src/cache.rs Outdated Show resolved Hide resolved
noqa_offset: noqa_row,
} = self.message;
/// [`Path`] that is relative to the package root in [`PackageCache`].
pub(crate) type RelativePath = Path;
Copy link
Member

Choose a reason for hiding this comment

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

That's helpful, i've already been wondering about this when reading the code above

crates/ruff_cli/src/cache.rs Show resolved Hide resolved
crates/ruff_cli/src/diagnostics.rs Outdated Show resolved Hide resolved
@charliermarsh
Copy link
Member

Since he's back on Monday anyway, would love to get @MichaReiser's eyes on the cache changes before we merge, since he's worked on the cache a bit in the past.

@charliermarsh
Copy link
Member

Below are some very much not scientific performance tests.

Interesting! More-so than cache size, I think the metric I'd be most interested in is speed (throughput?). Does using a single cache file per Python package make it faster to read from / write to the cache?


impl PackageCache {
/// Open or create a new package cache.
pub(crate) fn open(
Copy link
Member

Choose a reason for hiding this comment

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

I think this approach solves a problem that exists with the cache today, but I'd like to confirm...

Today, we use the cache key as the filename. When file contents are invalidated, we write a new file to the cache (since the cache key has changed), but leave the old file around. So the cache, as it exists today, grows monotonically, and gets bigger and bigger over time.

As far as I can tell, this new approach will replace the cache entirely when contents change, so we're effectively bounding the size of the cache by the size of the package itself. Is that right? If so, it should completed solve the problem of the cache growing eternally as seen in #5132.

Copy link
Member

Choose a reason for hiding this comment

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

(The benefit of the current approach is that if you change a setting, then revert that change, we still have the cached results from the previous settings. But that's so rare as to be not at all worthwhile.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell, this new approach will replace the cache entirely when contents change, so we're effectively bounding the size of the cache by the size of the package itself. Is that right? If so, it should completed solve the problem of the cache growing eternally as seen in #5132.

It almost solves it, but there are some limitations. This design doesn't remove the files hashmap entry for a source file that has been (re)moved. We could solve this my not reusing the read cache and instead recreate the files hashmap before storing it.

The second limitation is the hashkey generation. Because it uses various settings to ensure the cache is valid it doesn't actually remove old cache files if, e.g., a project changes the settings. I think this can be solved by splitting the file name into $project_hash.$every_thing_else_hash this way we can do a rm $project_hash.* periodically or something. But as discussed yesterday for now we can use ruff clean to "solve" both problems (by removing all cache files for the project, or after #5122 all cache files for all projects).

@charliermarsh
Copy link
Member

The code here looks good! My main outstanding questions are just around runtime performance, i.e., does this perform better or worse than before for projects with various size and diagnostic characteristics?

@Thomasdezeeuw
Copy link
Contributor Author

Thomasdezeeuw commented Jun 16, 2023

Setup

Using an nvme drive (~25GiB/s read).

Binary versions:

ruff_old: 89a8c31
ruff_new: 749f0ed
ruff_parallel: 83d4475 (#5120)

Run Time (No Cache)

This tests the runs without a prepared cache.

Test script

#!/bin/env bash

set -eu

cache_dir="./cache"
path="$1"

hyperfine \
	--warmup 3 \
	--prepare "rm -rf '$cache_dir'" \
	--parameter-list bin ruff_old,ruff_new,ruff_parallel \
	--ignore-failure \
	-N \
	"./bin/{bin} check --cache-dir $cache_dir $path"

Results

Airflow:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/airflow/
  Time (mean ± σ):     123.0 ms ±   2.9 ms    [User: 2275.8 ms, System: 236.8 ms]
  Range (min … max):   118.8 ms … 128.4 ms    21 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/airflow/
  Time (mean ± σ):     123.9 ms ±   4.3 ms    [User: 2209.9 ms, System: 118.2 ms]
  Range (min … max):   118.7 ms … 136.2 ms    23 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/airflow/
  Time (mean ± σ):     121.5 ms ±   2.7 ms    [User: 2275.6 ms, System: 130.9 ms]
  Range (min … max):   115.9 ms … 126.5 ms    24 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_parallel check --cache-dir ./cache repos/airflow/ ran
    1.01 ± 0.03 times faster than ./bin/ruff_old check --cache-dir ./cache repos/airflow/
    1.02 ± 0.04 times faster than ./bin/ruff_new check --cache-dir ./cache repos/airflow/

Bokeh:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/bokeh/
  Time (mean ± σ):      42.6 ms ±   1.7 ms    [User: 493.6 ms, System: 125.2 ms]
  Range (min … max):    40.3 ms …  52.8 ms    63 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/bokeh/
  Time (mean ± σ):      46.7 ms ±   0.9 ms    [User: 484.9 ms, System: 69.1 ms]
  Range (min … max):    44.5 ms …  48.7 ms    59 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/bokeh/
  Time (mean ± σ):      41.0 ms ±   1.4 ms    [User: 507.5 ms, System: 78.6 ms]
  Range (min … max):    38.9 ms …  49.3 ms    72 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_parallel check --cache-dir ./cache repos/bokeh/ ran
    1.04 ± 0.05 times faster than ./bin/ruff_old check --cache-dir ./cache repos/bokeh/
    1.14 ± 0.04 times faster than ./bin/ruff_new check --cache-dir ./cache repos/bokeh/

CPython:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/cpython/
  Time (mean ± σ):     142.1 ms ±   2.5 ms    [User: 2686.7 ms, System: 161.0 ms]
  Range (min … max):   138.6 ms … 146.2 ms    20 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/cpython/
  Time (mean ± σ):     154.6 ms ±   3.0 ms    [User: 2668.3 ms, System: 101.4 ms]
  Range (min … max):   151.6 ms … 160.8 ms    18 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/cpython/
  Time (mean ± σ):     152.6 ms ±   4.6 ms    [User: 2731.2 ms, System: 121.3 ms]
  Range (min … max):   145.6 ms … 163.1 ms    19 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_old check --cache-dir ./cache repos/cpython/ ran
    1.07 ± 0.04 times faster than ./bin/ruff_parallel check --cache-dir ./cache repos/cpython/
    1.09 ± 0.03 times faster than ./bin/ruff_new check --cache-dir ./cache repos/cpython/

FastAPI:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/fastapi/
  Time (mean ± σ):      41.6 ms ±   2.6 ms    [User: 252.0 ms, System: 178.3 ms]
  Range (min … max):    33.4 ms …  51.2 ms    69 runs

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/fastapi/
  Time (mean ± σ):      42.5 ms ±   1.2 ms    [User: 248.4 ms, System: 41.7 ms]
  Range (min … max):    40.0 ms …  46.7 ms    60 runs

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/fastapi/
  Time (mean ± σ):      38.0 ms ±   1.4 ms    [User: 253.2 ms, System: 60.4 ms]
  Range (min … max):    35.1 ms …  44.8 ms    75 runs

Summary
  ./bin/ruff_parallel check --cache-dir ./cache repos/fastapi/ ran
    1.10 ± 0.08 times faster than ./bin/ruff_old check --cache-dir ./cache repos/fastapi/
    1.12 ± 0.05 times faster than ./bin/ruff_new check --cache-dir ./cache repos/fastapi/

Jupyter server:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/jupyter_server/
  Time (mean ± σ):      25.0 ms ±   1.0 ms    [User: 134.1 ms, System: 38.3 ms]
  Range (min … max):    22.9 ms …  27.8 ms    117 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/jupyter_server/
  Time (mean ± σ):      25.3 ms ±   1.1 ms    [User: 127.2 ms, System: 35.6 ms]
  Range (min … max):    23.1 ms …  34.3 ms    120 runs

  Warning: Ignoring non-zero exit code.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/jupyter_server/
  Time (mean ± σ):      25.5 ms ±   1.3 ms    [User: 135.4 ms, System: 35.0 ms]
  Range (min … max):    23.0 ms …  33.3 ms    112 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_old check --cache-dir ./cache repos/jupyter_server/ ran
    1.01 ± 0.06 times faster than ./bin/ruff_new check --cache-dir ./cache repos/jupyter_server/
    1.02 ± 0.06 times faster than ./bin/ruff_parallel check --cache-dir ./cache repos/jupyter_server/

Run Time (Cached)

This tests the runs with a prepared cache.

Test Scripts

#!/bin/env bash

set -eu

cache_dir="./cache"
path="$1"

rm -rf "$cache_dir"

hyperfine \
	--warmup 3 \
	--parameter-list bin ruff_old,ruff_new,ruff_parallel \
	--ignore-failure \
	-N \
	"./bin/{bin} check --cache-dir $cache_dir $path"

Results

Airflow:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/airflow/
  Time (mean ± σ):      34.6 ms ±   0.7 ms    [User: 63.3 ms, System: 57.3 ms]
  Range (min … max):    32.3 ms …  36.4 ms    88 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/airflow/
  Time (mean ± σ):      44.8 ms ±   0.7 ms    [User: 48.8 ms, System: 43.5 ms]
  Range (min … max):    41.9 ms …  46.3 ms    64 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/airflow/
  Time (mean ± σ):      36.8 ms ±   0.7 ms    [User: 62.8 ms, System: 67.1 ms]
  Range (min … max):    35.4 ms …  38.4 ms    81 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_old check --cache-dir ./cache repos/airflow/ ran
    1.06 ± 0.03 times faster than ./bin/ruff_parallel check --cache-dir ./cache repos/airflow/
    1.29 ± 0.03 times faster than ./bin/ruff_new check --cache-dir ./cache repos/airflow/

Bokeh:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/bokeh/
  Time (mean ± σ):      20.2 ms ±   0.7 ms    [User: 23.3 ms, System: 34.7 ms]
  Range (min … max):    17.9 ms …  21.8 ms    151 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/bokeh/
  Time (mean ± σ):      31.3 ms ±   0.9 ms    [User: 22.0 ms, System: 33.5 ms]
  Range (min … max):    28.2 ms …  33.0 ms    92 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/bokeh/
  Time (mean ± σ):      20.8 ms ±   0.6 ms    [User: 25.9 ms, System: 36.5 ms]
  Range (min … max):    19.0 ms …  22.6 ms    141 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_old check --cache-dir ./cache repos/bokeh/ ran
    1.03 ± 0.05 times faster than ./bin/ruff_parallel check --cache-dir ./cache repos/bokeh/
    1.55 ± 0.07 times faster than ./bin/ruff_new check --cache-dir ./cache repos/bokeh/

CPython:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/cpython/
  Time (mean ± σ):      58.0 ms ±   1.1 ms    [User: 88.5 ms, System: 75.1 ms]
  Range (min … max):    55.8 ms …  60.9 ms    51 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/cpython/
  Time (mean ± σ):      86.3 ms ±   2.6 ms    [User: 89.1 ms, System: 56.1 ms]
  Range (min … max):    80.5 ms …  95.1 ms    35 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/cpython/
  Time (mean ± σ):      64.5 ms ±   1.2 ms    [User: 105.2 ms, System: 58.8 ms]
  Range (min … max):    62.7 ms …  67.2 ms    47 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_old check --cache-dir ./cache repos/cpython/ ran
    1.11 ± 0.03 times faster than ./bin/ruff_parallel check --cache-dir ./cache repos/cpython/
    1.49 ± 0.05 times faster than ./bin/ruff_new check --cache-dir ./cache repos/cpython/

FastAPI:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/fastapi/
  Time (mean ± σ):      17.2 ms ±   0.6 ms    [User: 18.6 ms, System: 32.6 ms]
  Range (min … max):    15.3 ms …  19.5 ms    169 runs

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/fastapi/
  Time (mean ± σ):      26.6 ms ±   0.7 ms    [User: 16.6 ms, System: 30.0 ms]
  Range (min … max):    24.4 ms …  28.1 ms    113 runs

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/fastapi/
  Time (mean ± σ):      17.6 ms ±   0.6 ms    [User: 19.5 ms, System: 35.5 ms]
  Range (min … max):    16.1 ms …  18.9 ms    173 runs

Summary
  ./bin/ruff_old check --cache-dir ./cache repos/fastapi/ ran
    1.03 ± 0.05 times faster than ./bin/ruff_parallel check --cache-dir ./cache repos/fastapi/
    1.55 ± 0.07 times faster than ./bin/ruff_new check --cache-dir ./cache repos/fastapi/

Jupyter server:

Benchmark 1: ./bin/ruff_old check --cache-dir ./cache repos/jupyter_server/
  Time (mean ± σ):      17.5 ms ±   0.5 ms    [User: 12.2 ms, System: 23.5 ms]
  Range (min … max):    16.1 ms …  18.9 ms    179 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./bin/ruff_new check --cache-dir ./cache repos/jupyter_server/
  Time (mean ± σ):      18.9 ms ±   0.5 ms    [User: 11.8 ms, System: 21.0 ms]
  Range (min … max):    17.4 ms …  20.4 ms    160 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: ./bin/ruff_parallel check --cache-dir ./cache repos/jupyter_server/
  Time (mean ± σ):      18.1 ms ±   0.5 ms    [User: 14.3 ms, System: 25.9 ms]
  Range (min … max):    16.8 ms …  19.3 ms    163 runs

  Warning: Ignoring non-zero exit code.

Summary
  ./bin/ruff_old check --cache-dir ./cache repos/jupyter_server/ ran
    1.03 ± 0.04 times faster than ./bin/ruff_parallel check --cache-dir ./cache repos/jupyter_server/
    1.08 ± 0.04 times faster than ./bin/ruff_new check --cache-dir ./cache repos/jupyter_server/

Cache Size

Test script

#!/bin/env bash

set -eu

cache_dir="./cache"
path="$1"

echo "$path"
for cmd in ruff_old ruff_new ruff_parallel; do
	rm -rf "$cache_dir"
	./bin/$cmd check --cache-dir "$cache_dir" "$path" > /dev/null 2> /dev/null || true
	echo -n "$cmd "
	du -ch "$cache_dir" | tail -n 1
done

Results

Bokeh:

ruff_old 5.3M   total
ruff_new 3.3M   total
ruff_parallel 3.3M      total

CPython:

ruff_old 32M    total
ruff_new 28M    total
ruff_parallel 28M       total

FastAPI:

ruff_old 4.5M   total
ruff_new 2.3M   total
ruff_parallel 2.3M      total

Jupyter server:

ruff_old 1.1M   total
ruff_new 476K   total
ruff_parallel 476K      total

Conclusion

The runtime results without a prepared are very close, all within 10% of each other which is 1-15ms. Giving the amount files being read and written this is within the noise level. The same is true for the tests with a fully prepared cache. I'm really interested in running these tests on a slower drive, maybe SATA SSD or even an HHD, there the reduce writing of the cache might have a larger impact.

As for the cache size it's clear that the new design is smaller. Saving as much as 4MB for the CPython case.

package_root: PathBuf,
/// Mapping of source file path to it's cached data.
// TODO: look into concurrent hashmap or similar instead of a mutex.
files: Mutex<HashMap<RelativePathBuf, FileCache>>,
Copy link
Member

Choose a reason for hiding this comment

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

One other consideration here: is it actually a requirement that we store the file contents in the cache? We're making the assumption that the file hasn't changed, so couldn't we just read these back from disk to report the diagnostics?

Copy link
Member

@MichaReiser MichaReiser Jun 19, 2023

Choose a reason for hiding this comment

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

I considered that during my row/column refactor. One challenge I ran into (and why I deferred it) is that we perform transformations for jupyter notebooks. We would need to replicate that behavior.

@charliermarsh
Copy link
Member

As for the cache size it's clear that the new design is smaller. Saving as much as 4MB for the CPython case.

As I mentioned in our weekly goal setting: apart from the cache size itself decreasing, it'd also be great to find a way to solve the "ever-increasing cache size" problem. How can we avoid the cache size increasingly monotonically over time?

crates/ruff_cli/src/cache.rs Show resolved Hide resolved
crates/ruff_cli/src/cache.rs Outdated Show resolved Hide resolved
Comment on lines +51 to +52
let mut buf = itoa::Buffer::new();
let key = Path::new(buf.format(cache_key(&package_root, settings)));
Copy link
Member

Choose a reason for hiding this comment

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

What's your reasoning to depend on itoa for formatting a single u64? I assume that the performance overhead should be neglectable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. itoa is already a dependency (via serde-json) so I figured why not avoid the allocation.

/// # Notes
///
/// This will be empty if `messages` is empty.
source: String,
Copy link
Member

Choose a reason for hiding this comment

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

My long-term goal for Message's is that they can include code frames pointing to other files.

For example: You import a private symbol from another file. Ideally, we would create two to three code frames:

  1. Code frame showing the import
  2. Code frame in the imported file that defines the symbol
  3. (optional) Code frame setting the __all__ symbol, showing that it does not include your import

The challenge with this is that a Message now needs access to more than one file. That's why the old implementation used a Vec to store the source files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can still support that I think. We can include a new code_frames vector field in CacheMessage, which holds a reference to the file and byte range. Maybe that would replace range, maybe not, not sure at this time.

Comment on lines 177 to 183
.map(|msg| CacheMessage {
kind: msg.kind.clone(),
range: msg.range,
fix: msg.fix.clone(),
noqa_offset: msg.noqa_offset,
})
.collect();
Copy link
Member

Choose a reason for hiding this comment

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

I used custom serializers because cloning kind can be expensive (it contains up to three Strings). But it seems that this isn't impacting performance much?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the cache is now shared between threads (also see #5120) we really need ownership of the values, dealing with the lifetime is quite painful. We could try using Arc or similar, but indeed cloning doesn't seem to impact performance that much.

Copy link
Member

Choose a reason for hiding this comment

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

I guess one way to solve this would be to store a serialized message internally (so that it is only necessary to truncate all the file cache entries when serializing the overall cache) and deserialize the file cache when retrieving the content for a file. This would have the benefit that the cache remains lazy for most parts. But I can see how this complicates things and may not be worth the effort.

@Thomasdezeeuw
Copy link
Contributor Author

I've updated the benchmarks in #5117 (comment) and they now all with 10% of the old implementation (15ms max), while still saving quite a bit of disk space.

@Thomasdezeeuw
Copy link
Contributor Author

Resolved problems mentioned in the reviews:

Thomas de Zeeuw added 6 commits June 19, 2023 16:25
The function doesn't consider RUFF_CACHE_DIR, that is handled elsewhere.
format! creates a new String, which use to append to an existing String.
This changes it to append the cause to the initial String avoiding some
unneeded allocation(s).
No longer returns an option.
This changes the caching design from one cache file per source file, to
one cache file per package. This greatly reduces the amount of cache
files that are opened and written, while maintaining roughly the same
(combined) size as bincode is very compact.

Below are some very much not scientific performance tests. It uses
projects/sources to check:

 * small.py: single, 31 bytes Python file with 2 errors.
 * test.py: single, 43k Python file with 8 errors.
 * fastapi: FastAPI repo, 1134 files checked, 0 errors.

Source   | Before # files | After # files | Before size | After size
small.py | 1              | 1             | 20 K        | 20 K
test.py  | 1              | 1             | 60 K        | 60 K
fastapi  | 1134           | 518           | 4.5 M       | 2.3 M

One question that might come up is why fastapi still has 518 cache files
and not 1? That is because this is using the existing package
resolution, which sees examples, docs, etc. as separate from the "main"
source code (in the fastapi directory in the repo). In this future it
might be worth consider switching to a one cache file per repo strategy.

This new design is not perfect and does have a number of known issues.
First, like the old design it doesn't remove the cache for a source file
that has been (re)moved until `ruff clean` is called.

Second, this currently uses a large mutex around the mutation of the
package cache (e.g. inserting result). This could be (or become) a
bottleneck. It's future work to test and improve this (if needed).

Third, currently the packages and opened and stored in a sequential
loop, this could be done parallel. This is also future work.
Comment on lines +169 to +173
let source = if let Some(msg) = messages.first() {
msg.file.source_text().to_owned()
} else {
String::new() // No messages, no need to keep the source!
};
Copy link
Member

@MichaReiser MichaReiser Jun 19, 2023

Choose a reason for hiding this comment

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

We should add at least an assertion (release build) that asserts that the source files of all messages are identical. I don't know if there are any diagnostics today that make use of the multi-file diagnostic source frames (I assume not) @charliermarsh ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should add at least an assertion (release build) that asserts that the source files of all messages are identical.

Can add 👍

I don't know if there are any diagnostics today that make use of the multi-file diagnostic source frames (I assume not) @charliermarsh ?

Last week @charliermarsh said not yet

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Would it be possible to add some tests for the caching or is this challenging because of the file system dependency?

@Thomasdezeeuw
Copy link
Contributor Author

Would it be possible to add some tests for the caching or is this challenging because of the file system dependency?

I have tests, but they are based on #5120, see https://github.com/astral-sh/ruff/tree/thomas/cache_testing.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge once you added the assertion and I see you added tests in another PR.

@Thomasdezeeuw Thomasdezeeuw merged commit e3c1276 into main Jun 19, 2023
16 checks passed
@Thomasdezeeuw Thomasdezeeuw deleted the thomas/cache branch June 19, 2023 15:46
renovate bot added a commit to ixm-one/pytest-cmake-presets that referenced this pull request Jun 21, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `^0.0.272`
-> `^0.0.273` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.273/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.273/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.273/compatibility-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.273/confidence-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>astral-sh/ruff</summary>

###
[`v0.0.273`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.273)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.272...v0.0.273)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

##### What's Changed

Highlights include:

- Autofix capabilities for rules like `flake8-import-conventions`, which
require symbol renames across a file.
- Significant decrease in Ruff's cache size (e.g., a ~50% decrease for
FastAPI).
-   Dozens and dozens of bug fixes + performance improvements.

##### Rules

- \[`copyright`] Implement copyright notice detection by
[@&#8203;Ryang20718](https://togithub.com/Ryang20718) in
[astral-sh/ruff#4701
- \[`flake8-datetimez`] Enable UTC-import for `datetime-utc-alias` fix
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5100
- \[`flake8-implicit-str-concat`] Add autofix for `ISC001` by
[@&#8203;tkukushkin](https://togithub.com/tkukushkin) in
[astral-sh/ruff#4853
- \[`flake8-import-conventions`] Enable autofix for unconventional
imports rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5152
- \[`flake8-pyi`] Add autofix for `Set`-to-`AbstractSet` rewrite using
reference tracking by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5074
- \[`flake8-pyi`] Implement PYI044 by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5021
- \[`flake8-return`] Extend revised `RET504` implementation to `with`
statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4998
- \[`flake8-return`] Implement autofix for revised `RET504` rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4999
- \[`flake8-return`] Refactor `RET504` to only enforce
assignment-then-return pattern by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4997
- \[`flake8-slots`] Add plugin, add `SLOT000`, `SLOT001` and `SLOT002`
by [@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4909
- \[`perflint`] Add `perflint` plugin, add first rule `PERF102` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4821
- \[`pylint`] Add Pylint rule `comparison-with-itself` (`R0124`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#4957
- \[`pyupgrade`] Add a rule to remove unnecessary parentheses in class
definitions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5032
- \[`ruff`] Add a rule for static keys in dict comprehensions by
[@&#8203;rodjunger](https://togithub.com/rodjunger) in
[astral-sh/ruff#4929
- \[`ruff`] Add rule to disallow implicit optional with autofix by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4831
- \[`ruff`] Expand RUF008 to all classes, but to a new code (RUF012) by
[@&#8203;adampauls](https://togithub.com/adampauls) in
[astral-sh/ruff#4390
- \[`ruff`] Remove unannotated attributes from RUF008 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5049
- \[`ruff`] Upgrade explicit-type-conversion rule (`RUF010`) to remove
unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4971

##### Settings

- Option (`-o`/`--output-file`) to write output to a file by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4950
- Add JSON Lines (NDJSON) message serialization by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#5048
- Add rule documentation URL to JSON output by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5187

##### Caching

- Only use a single cache file per Python package by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5117
- Open cache files in parallel by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5120

##### Jupyter

- Add support for auto-fix in Jupyter notebooks by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4665
- Add roundtrip support for Jupyter notebook by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5028

##### Bug Fixes

- Handle decorators in class-parenthesis-modifying rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5034
- Allow re-assignments to `__all__` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4967
- Handled dict and set inside f-string
([#&#8203;4249](https://togithub.com/astral-sh/ruff/issues/4249)) by
[@&#8203;DavideCanton](https://togithub.com/DavideCanton) in
[astral-sh/ruff#4563
- Support concatenated string key removals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4976
- Respect 'is not' operators split across newlines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4977
- Parenthesize expressions prior to lexing in F632 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5001
- Ignore pyproject.toml for adding noqa directives by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5013
- Support 'reason' argument to `pytest.fail` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5040
- Allow `async with` in `redefined-loop-name` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5125
- Skip `DJ008` enforcement in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5139
- Detect continuations at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5173
- Fix allowed-ellipsis detection by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5174
- Remove continuations before trailing semicolons by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5199
- Support parenthesized expressions when splitting compound assertions
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5219
- Use phf for confusables to reduce llvm lines by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#4926
- Allow private accesses within special dunder methods by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4968
- Support concatenated literals in format-literals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4974
- Fix line numbers in source frames by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[astral-sh/ruff#4984
- Suggest combining async with statements by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5022
- Improve `TypedDict` conversion logic for shadowed builtins and dunder
methods by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[astral-sh/ruff#5038
- Support glob patterns in pep8\_naming ignore-names by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5024
- Respect all `__all__` definitions for docstring visibility by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5052
- Don't treat annotations as resolved in forward references by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5060
- Consider ignore-names in all pep8 naming rules by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5079
- Ignore `reimplemented-builtin` if using `await` by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5101
- Allow space in filename for powershell + windows + python module by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5115
- Don't treat straight imports of **future** as `__future__` imports by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5128
- Remove continuations when deleting statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5198
- Fix corner case involving terminal backslash after fixing `W293` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5172
- Fix subprocess.run on Windows Python 3.7 by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5220

##### New Contributors

- [@&#8203;rodjunger](https://togithub.com/rodjunger) made their first
contribution in
[astral-sh/ruff#4929
- [@&#8203;DavideCanton](https://togithub.com/DavideCanton) made their
first contribution in
[astral-sh/ruff#4563
- [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) made their
first contribution in
[astral-sh/ruff#5021
- [@&#8203;adampauls](https://togithub.com/adampauls) made their first
contribution in
[astral-sh/ruff#4390
- [@&#8203;tkukushkin](https://togithub.com/tkukushkin) made their first
contribution in
[astral-sh/ruff#4853
- [@&#8203;Taybou](https://togithub.com/Taybou) made their first
contribution in
[astral-sh/ruff#5088
- [@&#8203;davidszotten](https://togithub.com/davidszotten) made their
first contribution in
[astral-sh/ruff#5158
- [@&#8203;dosisod](https://togithub.com/dosisod) made their first
contribution in
[astral-sh/ruff#5203

**Full Changelog**:
astral-sh/ruff@v0.0.272...v0.0.273

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
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/ixm-one/pytest-cmake-presets).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jankatins added a commit to jankatins/pr-workflow-example that referenced this pull request Jun 21, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `0.0.272`
-> `0.0.274` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/compatibility-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/confidence-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>astral-sh/ruff</summary>

###
[`v0.0.274`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.274)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.273...v0.0.274)

<!-- Release notes generated using configuration in .github/release.yml
at v0.0.274 -->

#### What's Changed

Follow-up release to `v0.0.273` to fix a panic in cache accesses.

##### Bug Fixes

- Use package roots rather than package members for cache initialization
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5233
- Avoid `.unwrap()` on cache access by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5229
- Revert change to `RUF010` to remove unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5232
- Avoid erroneous RUF013 violations for quoted annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5234

**Full Changelog**:
astral-sh/ruff@v0.0.273...v0.0.274

###
[`v0.0.273`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.273)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.272...v0.0.273)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

Highlights include:

- Autofix capabilities for rules like `flake8-import-conventions`, which
require symbol renames across a file.
- Significant decrease in Ruff's cache size (e.g., a ~50% decrease for
FastAPI).
-   Dozens and dozens of bug fixes + performance improvements.

##### Rules

- \[`copyright`] Implement copyright notice detection by
[@&#8203;Ryang20718](https://togithub.com/Ryang20718) in
[astral-sh/ruff#4701
- \[`flake8-datetimez`] Enable UTC-import for `datetime-utc-alias` fix
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5100
- \[`flake8-implicit-str-concat`] Add autofix for `ISC001` by
[@&#8203;tkukushkin](https://togithub.com/tkukushkin) in
[astral-sh/ruff#4853
- \[`flake8-import-conventions`] Enable autofix for unconventional
imports rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5152
- \[`flake8-pyi`] Add autofix for `Set`-to-`AbstractSet` rewrite using
reference tracking by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5074
- \[`flake8-pyi`] Implement PYI044 by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5021
- \[`flake8-return`] Extend revised `RET504` implementation to `with`
statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4998
- \[`flake8-return`] Implement autofix for revised `RET504` rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4999
- \[`flake8-return`] Refactor `RET504` to only enforce
assignment-then-return pattern by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4997
- \[`flake8-slots`] Add plugin, add `SLOT000`, `SLOT001` and `SLOT002`
by [@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4909
- \[`perflint`] Add `perflint` plugin, add first rule `PERF102` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4821
- \[`pylint`] Add Pylint rule `comparison-with-itself` (`R0124`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#4957
- \[`pyupgrade`] Add a rule to remove unnecessary parentheses in class
definitions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5032
- \[`ruff`] Add a rule for static keys in dict comprehensions by
[@&#8203;rodjunger](https://togithub.com/rodjunger) in
[astral-sh/ruff#4929
- \[`ruff`] Add rule to disallow implicit optional with autofix by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4831
- \[`ruff`] Expand RUF008 to all classes, but to a new code (RUF012) by
[@&#8203;adampauls](https://togithub.com/adampauls) in
[astral-sh/ruff#4390
- \[`ruff`] Remove unannotated attributes from RUF008 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5049
- \[`ruff`] Upgrade explicit-type-conversion rule (`RUF010`) to remove
unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4971

##### Settings

- Option (`-o`/`--output-file`) to write output to a file by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4950
- Add JSON Lines (NDJSON) message serialization by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#5048
- Add rule documentation URL to JSON output by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5187

##### Caching

- Only use a single cache file per Python package by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5117
- Open cache files in parallel by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5120

##### Jupyter

- Add support for auto-fix in Jupyter notebooks by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4665
- Add roundtrip support for Jupyter notebook by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5028

##### Bug Fixes

- Handle decorators in class-parenthesis-modifying rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5034
- Allow re-assignments to `__all__` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4967
- Handled dict and set inside f-string
([#&#8203;4249](https://togithub.com/astral-sh/ruff/issues/4249)) by
[@&#8203;DavideCanton](https://togithub.com/DavideCanton) in
[astral-sh/ruff#4563
- Support concatenated string key removals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4976
- Respect 'is not' operators split across newlines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4977
- Parenthesize expressions prior to lexing in F632 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5001
- Ignore pyproject.toml for adding noqa directives by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5013
- Support 'reason' argument to `pytest.fail` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5040
- Allow `async with` in `redefined-loop-name` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5125
- Skip `DJ008` enforcement in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5139
- Detect continuations at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5173
- Fix allowed-ellipsis detection by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5174
- Remove continuations before trailing semicolons by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5199
- Support parenthesized expressions when splitting compound assertions
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5219
- Use phf for confusables to reduce llvm lines by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#4926
- Allow private accesses within special dunder methods by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4968
- Support concatenated literals in format-literals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4974
- Fix line numbers in source frames by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[astral-sh/ruff#4984
- Suggest combining async with statements by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5022
- Improve `TypedDict` conversion logic for shadowed builtins and dunder
methods by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[astral-sh/ruff#5038
- Support glob patterns in pep8\_naming ignore-names by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5024
- Respect all `__all__` definitions for docstring visibility by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5052
- Don't treat annotations as resolved in forward references by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5060
- Consider ignore-names in all pep8 naming rules by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5079
- Ignore `reimplemented-builtin` if using `await` by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5101
- Allow space in filename for powershell + windows + python module by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5115
- Don't treat straight imports of **future** as `__future__` imports by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5128
- Remove continuations when deleting statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5198
- Fix corner case involving terminal backslash after fixing `W293` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5172
- Fix subprocess.run on Windows Python 3.7 by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5220

#### New Contributors

- [@&#8203;rodjunger](https://togithub.com/rodjunger) made their first
contribution in
[astral-sh/ruff#4929
- [@&#8203;DavideCanton](https://togithub.com/DavideCanton) made their
first contribution in
[astral-sh/ruff#4563
- [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) made their
first contribution in
[astral-sh/ruff#5021
- [@&#8203;adampauls](https://togithub.com/adampauls) made their first
contribution in
[astral-sh/ruff#4390
- [@&#8203;tkukushkin](https://togithub.com/tkukushkin) made their first
contribution in
[astral-sh/ruff#4853
- [@&#8203;Taybou](https://togithub.com/Taybou) made their first
contribution in
[astral-sh/ruff#5088
- [@&#8203;davidszotten](https://togithub.com/davidszotten) made their
first contribution in
[astral-sh/ruff#5158
- [@&#8203;dosisod](https://togithub.com/dosisod) made their first
contribution in
[astral-sh/ruff#5203

**Full Changelog**:
astral-sh/ruff@v0.0.272...v0.0.273

</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 this update
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/jankatins/pr-workflow-example).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
renovate bot added a commit to allenporter/pyrainbird that referenced this pull request Jun 22, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `==0.0.272`
-> `==0.0.274` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/compatibility-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.274/confidence-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>astral-sh/ruff</summary>

###
[`v0.0.274`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.274)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.273...v0.0.274)

<!-- Release notes generated using configuration in .github/release.yml
at v0.0.274 -->

#### What's Changed

Follow-up release to `v0.0.273` to fix a panic in cache accesses.

##### Bug Fixes

- Use package roots rather than package members for cache initialization
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5233
- Avoid `.unwrap()` on cache access by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5229
- Revert change to `RUF010` to remove unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5232
- Avoid erroneous RUF013 violations for quoted annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5234

**Full Changelog**:
astral-sh/ruff@v0.0.273...v0.0.274

###
[`v0.0.273`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.273)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.272...v0.0.273)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

Highlights include:

- Autofix capabilities for rules like `flake8-import-conventions`, which
require symbol renames across a file.
- Significant decrease in Ruff's cache size (e.g., a ~50% decrease for
FastAPI).
-   Dozens and dozens of bug fixes + performance improvements.

##### Rules

- \[`copyright`] Implement copyright notice detection by
[@&#8203;Ryang20718](https://togithub.com/Ryang20718) in
[astral-sh/ruff#4701
- \[`flake8-datetimez`] Enable UTC-import for `datetime-utc-alias` fix
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5100
- \[`flake8-implicit-str-concat`] Add autofix for `ISC001` by
[@&#8203;tkukushkin](https://togithub.com/tkukushkin) in
[astral-sh/ruff#4853
- \[`flake8-import-conventions`] Enable autofix for unconventional
imports rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5152
- \[`flake8-pyi`] Add autofix for `Set`-to-`AbstractSet` rewrite using
reference tracking by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5074
- \[`flake8-pyi`] Implement PYI044 by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5021
- \[`flake8-return`] Extend revised `RET504` implementation to `with`
statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4998
- \[`flake8-return`] Implement autofix for revised `RET504` rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4999
- \[`flake8-return`] Refactor `RET504` to only enforce
assignment-then-return pattern by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4997
- \[`flake8-slots`] Add plugin, add `SLOT000`, `SLOT001` and `SLOT002`
by [@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4909
- \[`perflint`] Add `perflint` plugin, add first rule `PERF102` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4821
- \[`pylint`] Add Pylint rule `comparison-with-itself` (`R0124`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#4957
- \[`pyupgrade`] Add a rule to remove unnecessary parentheses in class
definitions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5032
- \[`ruff`] Add a rule for static keys in dict comprehensions by
[@&#8203;rodjunger](https://togithub.com/rodjunger) in
[astral-sh/ruff#4929
- \[`ruff`] Add rule to disallow implicit optional with autofix by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4831
- \[`ruff`] Expand RUF008 to all classes, but to a new code (RUF012) by
[@&#8203;adampauls](https://togithub.com/adampauls) in
[astral-sh/ruff#4390
- \[`ruff`] Remove unannotated attributes from RUF008 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5049
- \[`ruff`] Upgrade explicit-type-conversion rule (`RUF010`) to remove
unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4971

##### Settings

- Option (`-o`/`--output-file`) to write output to a file by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4950
- Add JSON Lines (NDJSON) message serialization by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#5048
- Add rule documentation URL to JSON output by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5187

##### Caching

- Only use a single cache file per Python package by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5117
- Open cache files in parallel by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5120

##### Jupyter

- Add support for auto-fix in Jupyter notebooks by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4665
- Add roundtrip support for Jupyter notebook by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5028

##### Bug Fixes

- Handle decorators in class-parenthesis-modifying rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5034
- Allow re-assignments to `__all__` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4967
- Handled dict and set inside f-string
([#&#8203;4249](https://togithub.com/astral-sh/ruff/issues/4249)) by
[@&#8203;DavideCanton](https://togithub.com/DavideCanton) in
[astral-sh/ruff#4563
- Support concatenated string key removals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4976
- Respect 'is not' operators split across newlines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4977
- Parenthesize expressions prior to lexing in F632 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5001
- Ignore pyproject.toml for adding noqa directives by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5013
- Support 'reason' argument to `pytest.fail` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5040
- Allow `async with` in `redefined-loop-name` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5125
- Skip `DJ008` enforcement in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5139
- Detect continuations at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5173
- Fix allowed-ellipsis detection by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5174
- Remove continuations before trailing semicolons by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5199
- Support parenthesized expressions when splitting compound assertions
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5219
- Use phf for confusables to reduce llvm lines by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#4926
- Allow private accesses within special dunder methods by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4968
- Support concatenated literals in format-literals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4974
- Fix line numbers in source frames by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[astral-sh/ruff#4984
- Suggest combining async with statements by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5022
- Improve `TypedDict` conversion logic for shadowed builtins and dunder
methods by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[astral-sh/ruff#5038
- Support glob patterns in pep8\_naming ignore-names by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5024
- Respect all `__all__` definitions for docstring visibility by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5052
- Don't treat annotations as resolved in forward references by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5060
- Consider ignore-names in all pep8 naming rules by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5079
- Ignore `reimplemented-builtin` if using `await` by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5101
- Allow space in filename for powershell + windows + python module by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5115
- Don't treat straight imports of **future** as `__future__` imports by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5128
- Remove continuations when deleting statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5198
- Fix corner case involving terminal backslash after fixing `W293` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5172
- Fix subprocess.run on Windows Python 3.7 by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5220

#### New Contributors

- [@&#8203;rodjunger](https://togithub.com/rodjunger) made their first
contribution in
[astral-sh/ruff#4929
- [@&#8203;DavideCanton](https://togithub.com/DavideCanton) made their
first contribution in
[astral-sh/ruff#4563
- [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) made their
first contribution in
[astral-sh/ruff#5021
- [@&#8203;adampauls](https://togithub.com/adampauls) made their first
contribution in
[astral-sh/ruff#4390
- [@&#8203;tkukushkin](https://togithub.com/tkukushkin) made their first
contribution in
[astral-sh/ruff#4853
- [@&#8203;Taybou](https://togithub.com/Taybou) made their first
contribution in
[astral-sh/ruff#5088
- [@&#8203;davidszotten](https://togithub.com/davidszotten) made their
first contribution in
[astral-sh/ruff#5158
- [@&#8203;dosisod](https://togithub.com/dosisod) made their first
contribution in
[astral-sh/ruff#5203

**Full Changelog**:
astral-sh/ruff@v0.0.272...v0.0.273

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

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

🔕 **Ignore**: Close this PR and you won't be reminded about this update
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/allenporter/pyrainbird).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot added a commit to allenporter/flux-local that referenced this pull request Jun 23, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `==0.0.272`
-> `==0.0.275` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.275/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.275/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.275/compatibility-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.275/confidence-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>astral-sh/ruff</summary>

###
[`v0.0.275`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.275)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.274...v0.0.275)

<!-- Release notes generated using configuration in .github/release.yml
at v0.0.275 -->

#### What's Changed

Highlights include a 7-10x decrease in Ruff's cache size.

##### Rules

- Add support for top-level quoted annotations in RUF013 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5235
- Add support for nested quoted annotations in RUF013 by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5254
- Move `compare-to-empty-string` (`PLC1901`) to nursery by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5264
- Ignore Pydantic classes when evaluating `mutable-class-default`
(`RUF012`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5273
- Allow `typing.Final` for `mutable-class-default annotations`
(`RUF012`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5274
- Modify `deprecated-import` (`UP035`) to prefer `typing_extensions` in
some versions by [@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5291

##### Bug Fixes

- Restore existing bindings when unbinding caught exceptions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5256
- Avoid including nursery rules in linter-level selectors by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5268

#### New Contributors

- [@&#8203;jgberry](https://togithub.com/jgberry) made their first
contribution in
[astral-sh/ruff#5221

**Full Changelog**:
astral-sh/ruff@v0.0.274...v0.0.275

###
[`v0.0.274`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.274)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.273...v0.0.274)

<!-- Release notes generated using configuration in .github/release.yml
at v0.0.274 -->

#### What's Changed

Follow-up release to `v0.0.273` to fix a panic in cache accesses.

##### Bug Fixes

- Use package roots rather than package members for cache initialization
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5233
- Avoid `.unwrap()` on cache access by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5229
- Revert change to `RUF010` to remove unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5232
- Avoid erroneous RUF013 violations for quoted annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5234

**Full Changelog**:
astral-sh/ruff@v0.0.273...v0.0.274

###
[`v0.0.273`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.273)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.272...v0.0.273)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

Highlights include:

- Autofix capabilities for rules like `flake8-import-conventions`, which
require symbol renames across a file.
- Significant decrease in Ruff's cache size (e.g., a ~50% decrease for
FastAPI).
-   Dozens and dozens of bug fixes + performance improvements.

##### Rules

- \[`copyright`] Implement copyright notice detection by
[@&#8203;Ryang20718](https://togithub.com/Ryang20718) in
[astral-sh/ruff#4701
- \[`flake8-datetimez`] Enable UTC-import for `datetime-utc-alias` fix
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5100
- \[`flake8-implicit-str-concat`] Add autofix for `ISC001` by
[@&#8203;tkukushkin](https://togithub.com/tkukushkin) in
[astral-sh/ruff#4853
- \[`flake8-import-conventions`] Enable autofix for unconventional
imports rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5152
- \[`flake8-pyi`] Add autofix for `Set`-to-`AbstractSet` rewrite using
reference tracking by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5074
- \[`flake8-pyi`] Implement PYI044 by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5021
- \[`flake8-return`] Extend revised `RET504` implementation to `with`
statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4998
- \[`flake8-return`] Implement autofix for revised `RET504` rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4999
- \[`flake8-return`] Refactor `RET504` to only enforce
assignment-then-return pattern by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4997
- \[`flake8-slots`] Add plugin, add `SLOT000`, `SLOT001` and `SLOT002`
by [@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4909
- \[`perflint`] Add `perflint` plugin, add first rule `PERF102` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4821
- \[`pylint`] Add Pylint rule `comparison-with-itself` (`R0124`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#4957
- \[`pyupgrade`] Add a rule to remove unnecessary parentheses in class
definitions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5032
- \[`ruff`] Add a rule for static keys in dict comprehensions by
[@&#8203;rodjunger](https://togithub.com/rodjunger) in
[astral-sh/ruff#4929
- \[`ruff`] Add rule to disallow implicit optional with autofix by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4831
- \[`ruff`] Expand RUF008 to all classes, but to a new code (RUF012) by
[@&#8203;adampauls](https://togithub.com/adampauls) in
[astral-sh/ruff#4390
- \[`ruff`] Remove unannotated attributes from RUF008 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5049
- \[`ruff`] Upgrade explicit-type-conversion rule (`RUF010`) to remove
unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4971

##### Settings

- Option (`-o`/`--output-file`) to write output to a file by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4950
- Add JSON Lines (NDJSON) message serialization by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#5048
- Add rule documentation URL to JSON output by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5187

##### Caching

- Only use a single cache file per Python package by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5117
- Open cache files in parallel by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5120

##### Jupyter

- Add support for auto-fix in Jupyter notebooks by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4665
- Add roundtrip support for Jupyter notebook by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5028

##### Bug Fixes

- Handle decorators in class-parenthesis-modifying rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5034
- Allow re-assignments to `__all__` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4967
- Handled dict and set inside f-string
([#&#8203;4249](https://togithub.com/astral-sh/ruff/issues/4249)) by
[@&#8203;DavideCanton](https://togithub.com/DavideCanton) in
[astral-sh/ruff#4563
- Support concatenated string key removals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4976
- Respect 'is not' operators split across newlines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4977
- Parenthesize expressions prior to lexing in F632 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5001
- Ignore pyproject.toml for adding noqa directives by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5013
- Support 'reason' argument to `pytest.fail` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5040
- Allow `async with` in `redefined-loop-name` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5125
- Skip `DJ008` enforcement in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5139
- Detect continuations at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5173
- Fix allowed-ellipsis detection by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5174
- Remove continuations before trailing semicolons by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5199
- Support parenthesized expressions when splitting compound assertions
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5219
- Use phf for confusables to reduce llvm lines by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#4926
- Allow private accesses within special dunder methods by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4968
- Support concatenated literals in format-literals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4974
- Fix line numbers in source frames by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[astral-sh/ruff#4984
- Suggest combining async with statements by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5022
- Improve `TypedDict` conversion logic for shadowed builtins and dunder
methods by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[astral-sh/ruff#5038
- Support glob patterns in pep8\_naming ignore-names by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5024
- Respect all `__all__` definitions for docstring visibility by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5052
- Don't treat annotations as resolved in forward references by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5060
- Consider ignore-names in all pep8 naming rules by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5079
- Ignore `reimplemented-builtin` if using `await` by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5101
- Allow space in filename for powershell + windows + python module by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5115
- Don't treat straight imports of **future** as `__future__` imports by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5128
- Remove continuations when deleting statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5198
- Fix corner case involving terminal backslash after fixing `W293` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5172
- Fix subprocess.run on Windows Python 3.7 by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5220

#### New Contributors

- [@&#8203;rodjunger](https://togithub.com/rodjunger) made their first
contribution in
[astral-sh/ruff#4929
- [@&#8203;DavideCanton](https://togithub.com/DavideCanton) made their
first contribution in
[astral-sh/ruff#4563
- [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) made their
first contribution in
[astral-sh/ruff#5021
- [@&#8203;adampauls](https://togithub.com/adampauls) made their first
contribution in
[astral-sh/ruff#4390
- [@&#8203;tkukushkin](https://togithub.com/tkukushkin) made their first
contribution in
[astral-sh/ruff#4853
- [@&#8203;Taybou](https://togithub.com/Taybou) made their first
contribution in
[astral-sh/ruff#5088
- [@&#8203;davidszotten](https://togithub.com/davidszotten) made their
first contribution in
[astral-sh/ruff#5158
- [@&#8203;dosisod](https://togithub.com/dosisod) made their first
contribution in
[astral-sh/ruff#5203

**Full Changelog**:
astral-sh/ruff@v0.0.272...v0.0.273

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

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

🔕 **Ignore**: Close this PR and you won't be reminded about this update
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/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
AlexWaygood added a commit to AlexWaygood/typeshed-stats that referenced this pull request Jul 1, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [docs/MarkDown](https://togithub.com/Python-Markdown/markdown)
([changelog](https://togithub.com/Python-Markdown/markdown/blob/master/docs/change_log/index.md))
| `==3.3.7` -> `==3.4.3` |
[![age](https://badges.renovateapi.com/packages/pypi/docs%2fMarkDown/3.4.3/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/docs%2fMarkDown/3.4.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/docs%2fMarkDown/3.4.3/compatibility-slim/3.3.7)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/docs%2fMarkDown/3.4.3/confidence-slim/3.3.7)](https://docs.renovatebot.com/merge-confidence/)
|
| [docs/mkdocs-material](https://togithub.com/squidfunk/mkdocs-material)
| `==9.1.14` -> `==9.1.17` |
[![age](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocs-material/9.1.17/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocs-material/9.1.17/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocs-material/9.1.17/compatibility-slim/9.1.14)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocs-material/9.1.17/confidence-slim/9.1.14)](https://docs.renovatebot.com/merge-confidence/)
|
| [docs/mkdocstrings](https://togithub.com/mkdocstrings/mkdocstrings)
([changelog](https://mkdocstrings.github.io/changelog)) | `==0.21.2` ->
`==0.22.0` |
[![age](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocstrings/0.22.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocstrings/0.22.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocstrings/0.22.0/compatibility-slim/0.21.2)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/docs%2fmkdocstrings/0.22.0/confidence-slim/0.21.2)](https://docs.renovatebot.com/merge-confidence/)
|
| [misc-lint/blacken-docs](https://togithub.com/asottile/blacken-docs)
([changelog](https://togithub.com/adamchainz/blacken-docs/blob/main/CHANGELOG.rst))
| `==1.13.0` -> `==1.14.0` |
[![age](https://badges.renovateapi.com/packages/pypi/misc-lint%2fblacken-docs/1.14.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/misc-lint%2fblacken-docs/1.14.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/misc-lint%2fblacken-docs/1.14.0/compatibility-slim/1.13.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/misc-lint%2fblacken-docs/1.14.0/confidence-slim/1.13.0)](https://docs.renovatebot.com/merge-confidence/)
|
| [misc-lint/pycln](https://hadialqattan.github.io/pycln)
([source](https://togithub.com/hadialqattan/pycln)) | `==2.1.3` ->
`==2.1.5` |
[![age](https://badges.renovateapi.com/packages/pypi/misc-lint%2fpycln/2.1.5/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/misc-lint%2fpycln/2.1.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/misc-lint%2fpycln/2.1.5/compatibility-slim/2.1.3)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/misc-lint%2fpycln/2.1.5/confidence-slim/2.1.3)](https://docs.renovatebot.com/merge-confidence/)
|
| [misc-lint/ruff](https://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `==0.0.272`
-> `==0.0.275` |
[![age](https://badges.renovateapi.com/packages/pypi/misc-lint%2fruff/0.0.275/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/misc-lint%2fruff/0.0.275/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/misc-lint%2fruff/0.0.275/compatibility-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/misc-lint%2fruff/0.0.275/confidence-slim/0.0.272)](https://docs.renovatebot.com/merge-confidence/)
|
| [pytest/pytest](https://docs.pytest.org/en/latest/)
([source](https://togithub.com/pytest-dev/pytest),
[changelog](https://docs.pytest.org/en/stable/changelog.html)) |
`==7.3.1` -> `==7.4.0` |
[![age](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest/7.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest/7.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest/7.4.0/compatibility-slim/7.3.1)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest/7.4.0/confidence-slim/7.3.1)](https://docs.renovatebot.com/merge-confidence/)
|
| [pytest/pytest-mock](https://togithub.com/pytest-dev/pytest-mock)
([changelog](https://pytest-mock.readthedocs.io/en/latest/changelog.html))
| `==3.10.0` -> `==3.11.1` |
[![age](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest-mock/3.11.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest-mock/3.11.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest-mock/3.11.1/compatibility-slim/3.10.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/pytest%2fpytest-mock/3.11.1/confidence-slim/3.10.0)](https://docs.renovatebot.com/merge-confidence/)
|
| [typecheck/mypy](https://www.mypy-lang.org/)
([source](https://togithub.com/python/mypy),
[changelog](https://mypy-lang.blogspot.com/)) | `==1.3.0` -> `==1.4.0` |
[![age](https://badges.renovateapi.com/packages/pypi/typecheck%2fmypy/1.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/typecheck%2fmypy/1.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/typecheck%2fmypy/1.4.0/compatibility-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/typecheck%2fmypy/1.4.0/confidence-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>Python-Markdown/markdown (docs/MarkDown)</summary>

###
[`v3.4.3`](https://togithub.com/Python-Markdown/markdown/compare/3.4.2...3.4.3)

[Compare
Source](https://togithub.com/Python-Markdown/markdown/compare/3.4.2...3.4.3)

###
[`v3.4.2`](https://togithub.com/Python-Markdown/markdown/compare/3.4.1...3.4.2)

[Compare
Source](https://togithub.com/Python-Markdown/markdown/compare/3.4.1...3.4.2)

###
[`v3.4.1`](https://togithub.com/Python-Markdown/markdown/compare/3.4...3.4.1)

[Compare
Source](https://togithub.com/Python-Markdown/markdown/compare/3.4...3.4.1)

###
[`v3.4`](https://togithub.com/Python-Markdown/markdown/compare/3.3.7...3.4)

[Compare
Source](https://togithub.com/Python-Markdown/markdown/compare/3.3.7...3.4)

</details>

<details>
<summary>squidfunk/mkdocs-material (docs/mkdocs-material)</summary>

###
[`v9.1.17`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.1.17):
mkdocs-material-9.1.17

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.1.16...9.1.17)

- Fixed
[#&#8203;5633](https://togithub.com/squidfunk/mkdocs-material/issues/5633):
Code annotations with nested lists incorrectly mounted
- Fixed
[#&#8203;5628](https://togithub.com/squidfunk/mkdocs-material/issues/5628):
Regression in new social plugin configuration scheme

###
[`v9.1.16`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.1.16):
mkdocs-material-9.1.16

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.1.15...9.1.16)

-   Updated Indonesian translations
-   Ensure scroll bar follows color scheme of operating system

###
[`v9.1.15`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.1.15):
mkdocs-material-9.1.15

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.1.14...9.1.15)

- Fixed
[#&#8203;5566](https://togithub.com/squidfunk/mkdocs-material/issues/5566):
Indicate color scheme to operating system
- Fixed
[#&#8203;5565](https://togithub.com/squidfunk/mkdocs-material/issues/5565):
Update `Dockerfile` to latest version of base image
- Fixed
[#&#8203;5554](https://togithub.com/squidfunk/mkdocs-material/issues/5554):
Add additional version tags (`9`, `9.1`) to Docker image
- Fixed
[#&#8203;5536](https://togithub.com/squidfunk/mkdocs-material/issues/5536):
Strip tags of ARIA labels in table of contents

</details>

<details>
<summary>mkdocstrings/mkdocstrings (docs/mkdocstrings)</summary>

###
[`v0.22.0`](https://togithub.com/mkdocstrings/mkdocstrings/blob/HEAD/CHANGELOG.md#&#8203;0220-httpsgithubcommkdocstringsmkdocstringsreleasestag0220---2023-05-25)

[Compare
Source](https://togithub.com/mkdocstrings/mkdocstrings/compare/0.21.2...0.22.0)

<small>[Compare with
0.21.2](https://togithub.com/mkdocstrings/mkdocstrings/compare/0.21.2...0.22.0)</small>

##### Features

- Allow extensions to add templates
([cf0af05](https://togithub.com/mkdocstrings/mkdocstrings/commit/cf0af059eb89240eba0437de417c124389e2f20e)
by Timothée Mazzucotelli). [PR
#&#8203;569](https://togithub.com/mkdocstrings/mkdocstrings/pull/569)

##### Code Refactoring

- Report inventory loading errors
([2c05d78](https://togithub.com/mkdocstrings/mkdocstrings/commit/2c05d7854b87251e26c1a2e1810b85702ff110f3)
by Timothée Mazzucotelli). Co-authored-by: Oleh Prypin <oleh@pryp.in>

</details>

<details>
<summary>asottile/blacken-docs (misc-lint/blacken-docs)</summary>

###
[`v1.14.0`](https://togithub.com/asottile/blacken-docs/blob/HEAD/CHANGELOG.rst#&#8203;1140-2023-06-13)

[Compare
Source](https://togithub.com/asottile/blacken-docs/compare/1.13.0...1.14.0)

-   Support Python 3.12.

</details>

<details>
<summary>hadialqattan/pycln (misc-lint/pycln)</summary>

###
[`v2.1.5`](https://togithub.com/hadialqattan/pycln/releases/tag/v2.1.5)

[Compare
Source](https://togithub.com/hadialqattan/pycln/compare/v2.1.4...v2.1.5)

##### Changed

- [Widen `pathspec` version artificial lock by
@&#8203;hadialqattan](https://togithub.com/hadialqattan/pycln/pull/203)

###
[`v2.1.4`](https://togithub.com/hadialqattan/pycln/releases/tag/v2.1.4)

[Compare
Source](https://togithub.com/hadialqattan/pycln/compare/v2.1.3...v2.1.4)

##### Fixed

- [Detect third-party libs installed in editable mode by
@&#8203;hadialqattan](https://togithub.com/hadialqattan/pycln/pull/200)
- [Preserve the original line break format by @&#8203;maxbachmann &
@&#8203;hadialqattan](https://togithub.com/hadialqattan/pycln/pull/197)

##### Changed

- [Bump JRubics/poetry-publish from 1.16 to 1.17 by
@&#8203;dependabot\[bot\]](https://togithub.com/hadialqattan/pycln/pull/201)
- [Remove `pathspec` version artificial lock by
@&#8203;hadialqattan](https://togithub.com/hadialqattan/pycln/pull/199)
- [Bump codecov/codecov-action from 3.1.1 to 3.1.4 by
@&#8203;dependabot\[bot\]](https://togithub.com/hadialqattan/pycln/pull/198)
- [Bump typer from 0.7.0 to 0.9.0 by
@&#8203;dependabot\[bot\]](https://togithub.com/hadialqattan/pycln/pull/195)

</details>

<details>
<summary>astral-sh/ruff (misc-lint/ruff)</summary>

###
[`v0.0.275`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.275)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.274...v0.0.275)

<!-- Release notes generated using configuration in .github/release.yml
at v0.0.275 -->

#### What's Changed

Highlights include a 7-10x decrease in Ruff's cache size.

##### Rules

- Add support for top-level quoted annotations in RUF013 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5235
- Add support for nested quoted annotations in RUF013 by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5254
- Move `compare-to-empty-string` (`PLC1901`) to nursery by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5264
- Ignore Pydantic classes when evaluating `mutable-class-default`
(`RUF012`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5273
- Allow `typing.Final` for `mutable-class-default annotations`
(`RUF012`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5274
- Modify `deprecated-import` (`UP035`) to prefer `typing_extensions` in
some versions by [@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5291

##### Bug Fixes

- Restore existing bindings when unbinding caught exceptions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5256
- Avoid including nursery rules in linter-level selectors by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5268

#### New Contributors

- [@&#8203;jgberry](https://togithub.com/jgberry) made their first
contribution in
[astral-sh/ruff#5221

**Full Changelog**:
astral-sh/ruff@v0.0.274...v0.0.275

###
[`v0.0.274`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.274)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.273...v0.0.274)

<!-- Release notes generated using configuration in .github/release.yml
at v0.0.274 -->

#### What's Changed

Follow-up release to `v0.0.273` to fix a panic in cache accesses.

##### Bug Fixes

- Use package roots rather than package members for cache initialization
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5233
- Avoid `.unwrap()` on cache access by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5229
- Revert change to `RUF010` to remove unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5232
- Avoid erroneous RUF013 violations for quoted annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5234

**Full Changelog**:
astral-sh/ruff@v0.0.273...v0.0.274

###
[`v0.0.273`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.273)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.272...v0.0.273)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

Highlights include:

- Autofix capabilities for rules like `flake8-import-conventions`, which
require symbol renames across a file.
- Significant decrease in Ruff's cache size (e.g., a ~50% decrease for
FastAPI).
-   Dozens and dozens of bug fixes + performance improvements.

##### Rules

- \[`copyright`] Implement copyright notice detection by
[@&#8203;Ryang20718](https://togithub.com/Ryang20718) in
[astral-sh/ruff#4701
- \[`flake8-datetimez`] Enable UTC-import for `datetime-utc-alias` fix
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5100
- \[`flake8-implicit-str-concat`] Add autofix for `ISC001` by
[@&#8203;tkukushkin](https://togithub.com/tkukushkin) in
[astral-sh/ruff#4853
- \[`flake8-import-conventions`] Enable autofix for unconventional
imports rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5152
- \[`flake8-pyi`] Add autofix for `Set`-to-`AbstractSet` rewrite using
reference tracking by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5074
- \[`flake8-pyi`] Implement PYI044 by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5021
- \[`flake8-return`] Extend revised `RET504` implementation to `with`
statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4998
- \[`flake8-return`] Implement autofix for revised `RET504` rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4999
- \[`flake8-return`] Refactor `RET504` to only enforce
assignment-then-return pattern by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4997
- \[`flake8-slots`] Add plugin, add `SLOT000`, `SLOT001` and `SLOT002`
by [@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4909
- \[`perflint`] Add `perflint` plugin, add first rule `PERF102` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#4821
- \[`pylint`] Add Pylint rule `comparison-with-itself` (`R0124`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#4957
- \[`pyupgrade`] Add a rule to remove unnecessary parentheses in class
definitions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5032
- \[`ruff`] Add a rule for static keys in dict comprehensions by
[@&#8203;rodjunger](https://togithub.com/rodjunger) in
[astral-sh/ruff#4929
- \[`ruff`] Add rule to disallow implicit optional with autofix by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4831
- \[`ruff`] Expand RUF008 to all classes, but to a new code (RUF012) by
[@&#8203;adampauls](https://togithub.com/adampauls) in
[astral-sh/ruff#4390
- \[`ruff`] Remove unannotated attributes from RUF008 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5049
- \[`ruff`] Upgrade explicit-type-conversion rule (`RUF010`) to remove
unnecessary `str` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4971

##### Settings

- Option (`-o`/`--output-file`) to write output to a file by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4950
- Add JSON Lines (NDJSON) message serialization by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#5048
- Add rule documentation URL to JSON output by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5187

##### Caching

- Only use a single cache file per Python package by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5117
- Open cache files in parallel by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5120

##### Jupyter

- Add support for auto-fix in Jupyter notebooks by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#4665
- Add roundtrip support for Jupyter notebook by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5028

##### Bug Fixes

- Handle decorators in class-parenthesis-modifying rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5034
- Allow re-assignments to `__all__` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4967
- Handled dict and set inside f-string
([#&#8203;4249](https://togithub.com/astral-sh/ruff/issues/4249)) by
[@&#8203;DavideCanton](https://togithub.com/DavideCanton) in
[astral-sh/ruff#4563
- Support concatenated string key removals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4976
- Respect 'is not' operators split across newlines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4977
- Parenthesize expressions prior to lexing in F632 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5001
- Ignore pyproject.toml for adding noqa directives by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5013
- Support 'reason' argument to `pytest.fail` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5040
- Allow `async with` in `redefined-loop-name` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5125
- Skip `DJ008` enforcement in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5139
- Detect continuations at start-of-file by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5173
- Fix allowed-ellipsis detection by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5174
- Remove continuations before trailing semicolons by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5199
- Support parenthesized expressions when splitting compound assertions
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5219
- Use phf for confusables to reduce llvm lines by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#4926
- Allow private accesses within special dunder methods by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4968
- Support concatenated literals in format-literals by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#4974
- Fix line numbers in source frames by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[astral-sh/ruff#4984
- Suggest combining async with statements by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5022
- Improve `TypedDict` conversion logic for shadowed builtins and dunder
methods by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[astral-sh/ruff#5038
- Support glob patterns in pep8\_naming ignore-names by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5024
- Respect all `__all__` definitions for docstring visibility by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5052
- Don't treat annotations as resolved in forward references by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5060
- Consider ignore-names in all pep8 naming rules by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[astral-sh/ruff#5079
- Ignore `reimplemented-builtin` if using `await` by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5101
- Allow space in filename for powershell + windows + python module by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5115
- Don't treat straight imports of **future** as `__future__` imports by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5128
- Remove continuations when deleting statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5198
- Fix corner case involving terminal backslash after fixing `W293` by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5172
- Fix subprocess.run on Windows Python 3.7 by
[@&#8203;konstin](https://togithub.com/konstin) in
[astral-sh/ruff#5220

#### New Contributors

- [@&#8203;rodjunger](https://togithub.com/rodjunger) made their first
contribution in
[astral-sh/ruff#4929
- [@&#8203;DavideCanton](https://togithub.com/DavideCanton) made their
first contribution in
[astral-sh/ruff#4563
- [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) made their
first contribution in
[astral-sh/ruff#5021
- [@&#8203;adampauls](https://togithub.com/adampauls) made their first
contribution in
[astral-sh/ruff#4390
- [@&#8203;tkukushkin](https://togithub.com/tkukushkin) made their first
contribution in
[astral-sh/ruff#4853
- [@&#8203;Taybou](https://togithub.com/Taybou) made their first
contribution in
[astral-sh/ruff#5088
- [@&#8203;davidszotten](https://togithub.com/davidszotten) made their
first contribution in
[astral-sh/ruff#5158
- [@&#8203;dosisod](https://togithub.com/dosisod) made their first
contribution in
[astral-sh/ruff#5203

**Full Changelog**:
astral-sh/ruff@v0.0.272...v0.0.273

</details>

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

###
[`v7.4.0`](https://togithub.com/pytest-dev/pytest/releases/tag/7.4.0)

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

# pytest 7.4.0 (2023-06-23)

## Features

- [#&#8203;10901](https://togithub.com/pytest-dev/pytest/issues/10901):
Added `ExceptionInfo.from_exception()
<pytest.ExceptionInfo.from_exception>`{.interpreted-text role="func"}, a
simpler way to create an `~pytest.ExceptionInfo`{.interpreted-text
role="class"} from an exception.
This can replace `ExceptionInfo.from_exc_info()
<pytest.ExceptionInfo.from_exc_info()>`{.interpreted-text role="func"}
for most uses.

## Improvements

- [#&#8203;10872](https://togithub.com/pytest-dev/pytest/issues/10872):
Update test log report annotation to named tuple and fixed inconsistency
in docs for `pytest_report_teststatus`{.interpreted-text role="hook"}
hook.

- [#&#8203;10907](https://togithub.com/pytest-dev/pytest/issues/10907):
When an exception traceback to be displayed is completely filtered out
(by mechanisms such as `__tracebackhide__`, internal frames, and
similar), now only the exception string and the following message are
shown:

"All traceback entries are hidden. Pass \[--full-trace]{.title-ref} to
see hidden and internal frames.".

Previously, the last frame of the traceback was shown, even though it
was hidden.

- [#&#8203;10940](https://togithub.com/pytest-dev/pytest/issues/10940):
Improved verbose output (`-vv`) of `skip` and `xfail` reasons by
performing text wrapping while leaving a clear margin for progress
output.

    Added `TerminalReporter.wrap_write()` as a helper for that.

- [#&#8203;10991](https://togithub.com/pytest-dev/pytest/issues/10991):
Added handling of `%f` directive to print microseconds in log format
options, such as `log-date-format`.

- [#&#8203;11005](https://togithub.com/pytest-dev/pytest/issues/11005):
Added the underlying exception to the cache provider's path creation and
write warning messages.

- [#&#8203;11013](https://togithub.com/pytest-dev/pytest/issues/11013):
Added warning when `testpaths`{.interpreted-text role="confval"} is set,
but paths are not found by glob. In this case, pytest will fall back to
searching from the current directory.

- [#&#8203;11043](https://togithub.com/pytest-dev/pytest/issues/11043):
When \[--confcutdir]{.title-ref} is not specified, and there is no
config file present, the conftest cutoff directory
(\[--confcutdir]{.title-ref}) is now set to the `rootdir
<rootdir>`{.interpreted-text role="ref"}.
Previously in such cases, \[conftest.py]{.title-ref} files would be
probed all the way to the root directory of the filesystem.
If you are badly affected by this change, consider adding an empty
config file to your desired cutoff directory, or explicitly set
\[--confcutdir]{.title-ref}.

- [#&#8203;11081](https://togithub.com/pytest-dev/pytest/issues/11081):
The `norecursedirs`{.interpreted-text role="confval"} check is now
performed in a `pytest_ignore_collect`{.interpreted-text role="hook"}
implementation, so plugins can affect it.

If after updating to this version you see that your
\[norecursedirs]{.title-ref} setting is not being respected,
it means that a conftest or a plugin you use has a bad
\[pytest_ignore_collect]{.title-ref} implementation.
Most likely, your hook returns \[False]{.title-ref} for paths it does
not want to ignore,
which ends the processing and doesn't allow other plugins, including
pytest itself, to ignore the path.
The fix is to return \[None]{.title-ref} instead of \[False]{.title-ref}
for paths your hook doesn't want to ignore.

- [#&#8203;8711](https://togithub.com/pytest-dev/pytest/issues/8711):
`caplog.set_level()
<pytest.LogCaptureFixture.set_level>`{.interpreted-text role="func"} and
`caplog.at_level()
<pytest.LogCaptureFixture.at_level>`{.interpreted-text role="func"}
will temporarily enable the requested `level` if `level` was disabled
globally via
    `logging.disable(LEVEL)`.

## Bug Fixes

- [#&#8203;10831](https://togithub.com/pytest-dev/pytest/issues/10831):
Terminal Reporting: Fixed bug when running in `--tb=line` mode where
`pytest.fail(pytrace=False)` tests report `None`.
- [#&#8203;11068](https://togithub.com/pytest-dev/pytest/issues/11068):
Fixed the `--last-failed` whole-file skipping functionality ("skipped N
files") for `non-python test files <non-python tests>`{.interpreted-text
role="ref"}.
- [#&#8203;11104](https://togithub.com/pytest-dev/pytest/issues/11104):
Fixed a regression in pytest 7.3.2 which caused to
`testpaths`{.interpreted-text role="confval"} to be considered for
loading initial conftests,
even when it was not utilized (e.g. when explicit paths were given on
the command line).
    Now the `testpaths` are only considered when they are in use.
- [#&#8203;1904](https://togithub.com/pytest-dev/pytest/issues/1904):
Fixed traceback entries hidden with `__tracebackhide__ = True` still
being shown for chained exceptions (parts after "... the above exception
..." message).
- [#&#8203;7781](https://togithub.com/pytest-dev/pytest/issues/7781):
Fix writing non-encodable text to log file when using `--debug`.

## Improved Documentation

- [#&#8203;9146](https://togithub.com/pytest-dev/pytest/issues/9146):
Improved documentation for `caplog.set_level()
<pytest.LogCaptureFixture.set_level>`{.interpreted-text role="func"}.

## Trivial/Internal Changes

- [#&#8203;11031](https://togithub.com/pytest-dev/pytest/issues/11031):
Enhanced the CLI flag for `-c` to now include `--config-file` to make it
clear that this flag applies to the usage of a custom config file.

###
[`v7.3.2`](https://togithub.com/pytest-dev/pytest/releases/tag/7.3.2)

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

# pytest 7.3.2 (2023-06-10)

## Bug Fixes

- [#&#8203;10169](https://togithub.com/pytest-dev/pytest/issues/10169):
Fix bug where very long option names could cause pytest to break with
`OSError: [Errno 36] File name too long` on some systems.
- [#&#8203;10894](https://togithub.com/pytest-dev/pytest/issues/10894):
Support for Python 3.12 (beta at the time of writing).
- [#&#8203;10987](https://togithub.com/pytest-dev/pytest/issues/10987):
`testpaths`{.interpreted-text role="confval"} is now honored to load
root `conftests`.
- [#&#8203;10999](https://togithub.com/pytest-dev/pytest/issues/10999):
The \[monkeypatch]{.title-ref}
\[setitem]{.title-ref}/\[delitem]{.title-ref} type annotations now allow
\[TypedDict]{.title-ref} arguments.
- [#&#8203;11028](https://togithub.com/pytest-dev/pytest/issues/11028):
Fixed bug in assertion rewriting where a variable assigned with the
walrus operator could not be used later in a function call.
- [#&#8203;11054](https://togithub.com/pytest-dev/pytest/issues/11054):
Fixed `--last-failed`'s "(skipped N files)" functionality for files
inside of packages (directories with \[\__init\_\_.py]{.title-ref}
files).

</details>

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

###
[`v3.11.1`](https://togithub.com/pytest-dev/pytest-mock/blob/HEAD/CHANGELOG.rst#&#8203;3111-2023-06-15)

[Compare
Source](https://togithub.com/pytest-dev/pytest-mock/compare/v3.11.0...v3.11.1)

(This release source code is identical to `3.11.0` except a small
internal fix to deployment/CI)

-   Fixed introspection for failed `assert_has_calls` (`#365`\_).

- Updated type annotations for `mocker.patch` and `mocker.spy`
(`#364`\_).

..
\_#&#820[pytest-dev/pytest-mock#365
..
\[pytest-dev/pytest-mock#364

###
[`v3.11.0`](https://togithub.com/pytest-dev/pytest-mock/blob/HEAD/CHANGELOG.rst#&#8203;3110-2023-06-15)

[Compare
Source](https://togithub.com/pytest-dev/pytest-mock/compare/v3.10.0...v3.11.0)

-   Fixed introspection for failed `assert_has_calls` (`#365`\_).

- Updated type annotations for `mocker.patch` and `mocker.spy`
(`#364`\_).

..
\_#&#820[pytest-dev/pytest-mock#365
..
\[pytest-dev/pytest-mock#364

</details>

<details>
<summary>python/mypy (typecheck/mypy)</summary>

### [`v1.4.0`](https://togithub.com/python/mypy/compare/v1.3.0...v1.4.0)

[Compare
Source](https://togithub.com/python/mypy/compare/v1.3.0...v1.4.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every 3 months on the first day of
the month" (UTC), 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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- 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/AlexWaygood/typeshed-stats).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
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.

4 participants