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

Scheduled weekly dependency update for week 04 #206

Closed
wants to merge 48 commits into from

Conversation

pyup-bot
Copy link
Collaborator

Update asgiref from 3.6.0 to 3.7.2.

Changelog

3.7.2

------------------

* The type annotations for SyncToAsync and AsyncToSync have been changed to
more accurately reflect the kind of callables they return.

3.7.1

------------------

* On Python 3.10 and below, the version of the "typing_extensions" package
is now constrained to be at least version 4 (as we depend on functionality
in that version and above)

3.7.0

------------------

* Contextvars are now required for the implementation of Local as Python 3.6
is now no longer a supported version.

* sync_to_async and async_to_sync now pass-through

* Debug and Lifespan State extensions have resulted in a typing change for some
request and response types. This change should be backwards-compatible.

* ``asgiref`` frames will now be hidden in Django tracebacks by default.

* Raw performance and garbage collection improvements in Local, SyncToAsync,
and AsyncToSync.
Links

Update asttokens from 2.2.1 to 2.4.1.

The bot wasn't able to find a changelog for this release. Got an idea?

Links

Update black from 22.12.0 to 24.1.1.

Changelog

24.1.1

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

Preview style

- Consistently add trailing comma on typed parameters (4164)

Configuration

- Shorten the length of the name of the cache file to fix crashes on file systems that
do not support long paths (4176)

24.1.0

Highlights

This release introduces the new 2024 stable style (4106), stabilizing the following
changes:

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

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

Stable style

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

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

Preview style

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

Configuration

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

Integrations

- Revert the change to run Black's pre-commit integration only on specific git hooks
(3940) for better compatibility with older versions of pre-commit (4137)

Thank you

Thank you to everyone who provided feedback to help make Black's 2024 style even better. Thank you also to everyone who contributed code to Black.

24.1a1

This is a preview of the 2024 stable style, showing the formatting that Black will use in 2024. Please test it out and [share your feedback](https://github.com/psf/black/issues/4042).

This applies the following changes:

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

The following two changes may be included, but have outstanding issues that will need to
be resolved:

- Long values in dict literals are now wrapped in parentheses; correspondingly
unnecessary parentheses around short values in dict literals are now removed; long
string lambda values are now wrapped in parentheses (3440)
- Add parentheses around `if`-`else` expressions (2278)

23.12.1

Fixed a bug that included dependencies from the d extra by default (4108)

23.12.0

Highlights

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

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

Stable style

- Fix bug where ` fmt: off` automatically dedents when used with the `--line-ranges`
option, even when it is not within the specified line range. (4084)
- Fix feature detection for parenthesized context managers (4104)

Preview style

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

Configuration

- `--line-ranges` now skips _Black_'s internal stability check in `--safe` mode. This
avoids a crash on rare inputs that have many unformatted same-content lines. (4034)

Packaging

- Upgrade to mypy 1.7.1 (4049) (4069)
- Faster compiled wheels are now available for CPython 3.12 (4070)

Integrations

- Enable 3.12 CI (4035)
- Build docker images in parallel (4054)
- Build docker images with 3.12 (4055)

23.11.0

Highlights

- Support formatting ranges of lines with the new `--line-ranges` command-line option
(4020)

Stable style

- Fix crash on formatting bytes strings that look like docstrings (4003)
- Fix crash when whitespace followed a backslash before newline in a docstring (4008)
- Fix standalone comments inside complex blocks crashing Black (4016)
- Fix crash on formatting code like `await (a ** b)` (3994)
- No longer treat leading f-strings as docstrings. This matches Python's behaviour and
fixes a crash (4019)

Preview style

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

Configuration

- Consistently apply force exclusion logic before resolving symlinks (4015)
- Fix a bug in the matching of absolute path names in `--include` (3976)

Performance

- Fix mypyc builds on arm64 on macOS (4017)

Integrations

- Black's pre-commit integration will now run only on git hooks appropriate for a code
formatter (3940)

23.10.1

Highlights

- Maintanence release to get a fix out for GitHub Action edge case (3957)

Preview style

- Fix merging implicit multiline strings that have inline comments (3956)
- Allow empty first line after block open before a comment or compound statement (3967)

Packaging

- Change Dockerfile to hatch + compile black (3965)

Integrations

- The summary output for GitHub workflows is now suppressible using the `summary`
parameter. (3958)
- Fix the action failing when Black check doesn't pass (3957)

Documentation

- It is known Windows documentation CI is broken
https://github.com/psf/black/issues/3968

23.10.0

Stable style

- Fix comments getting removed from inside parenthesized strings (3909)

Preview style

- Fix long lines with power operators getting split before the line length (3942)
- Long type hints are now wrapped in parentheses and properly indented when split across
multiple lines (3899)
- Magic trailing commas are now respected in return types. (3916)
- Require one empty line after module-level docstrings. (3932)
- Treat raw triple-quoted strings as docstrings (3947)

Configuration

- Fix cache versioning logic when `BLACK_CACHE_DIR` is set (3937)

Parser

- Fix bug where attributes named `type` were not acccepted inside `match` statements
(3950)
- Add support for PEP 695 type aliases containing lambdas and other unusual expressions
(3949)

Output

- Black no longer attempts to provide special errors for attempting to format Python 2
code (3933)
- Black will more consistently print stacktraces on internal errors in verbose mode
(3938)

Integrations

- The action output displayed in the job summary is now wrapped in Markdown (3914)

23.9.1

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

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

Packaging

- Upgrade to mypy 1.5.1 (3864)

Performance

- Store raw tuples instead of NamedTuples in Black's cache, improving performance and
decreasing the size of the cache (3877)

23.9.0

Preview style

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

Configuration

- Black now applies exclusion and ignore logic before resolving symlinks (3846)

Performance

- Avoid importing `IPython` if notebook cells do not contain magics (3782)
- Improve caching by comparing file hashes as fallback for mtime and size (3821)

_Blackd_

- Fix an issue in `blackd` with single character input (3558)

Integrations

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

23.7.0

Highlights

- Runtime support for Python 3.7 has been removed. Formatting 3.7 code will still be
supported until further notice (3765)

Stable style

- Fix a bug where an illegal trailing comma was added to return type annotations using
PEP 604 unions (3735)
- Fix several bugs and crashes where comments in stub files were removed or mishandled
under some circumstances (3745)
- Fix a crash with multi-line magic comments like `type: ignore` within parentheses
(3740)
- Fix error in AST validation when _Black_ removes trailing whitespace in a type comment
(3773)

Preview style

- Implicitly concatenated strings used as function args are no longer wrapped inside
parentheses (3640)
- Remove blank lines between a class definition and its docstring (3692)

Configuration

- The `--workers` argument to _Black_ can now be specified via the `BLACK_NUM_WORKERS`
environment variable (3743)
- `.pytest_cache`, `.ruff_cache` and `.vscode` are now excluded by default (3691)
- Fix _Black_ not honouring `pyproject.toml` settings when running `--stdin-filename`
and the `pyproject.toml` found isn't in the current working directory (3719)
- _Black_ will now error if `exclude` and `extend-exclude` have invalid data types in
`pyproject.toml`, instead of silently doing the wrong thing (3764)

Packaging

- Upgrade mypyc from 0.991 to 1.3 (3697)
- Remove patching of Click that mitigated errors on Python 3.6 with `LANG=C` (3768)

Parser

- Add support for the new PEP 695 syntax in Python 3.12 (3703)

Performance

- Speed up _Black_ significantly when the cache is full (3751)
- Avoid importing `IPython` in a case where we wouldn't need it (3748)

Output

- Use aware UTC datetimes internally, avoids deprecation warning on Python 3.12 (3728)
- Change verbose logging to exactly mirror _Black_'s logic for source discovery (3749)

_Blackd_

- The `blackd` argument parser now shows the default values for options in their help
text (3712)

Integrations

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

Documentation

- Add a CITATION.cff file to the root of the repository, containing metadata on how to
cite this software (3723)
- Update the _classes_ and _exceptions_ documentation in Developer reference to match
the latest code base (3755)

23.3.0

Highlights

This release fixes a longstanding confusing behavior in Black's GitHub action, where the
version of the action did not determine the version of Black being run (issue 3382). In
addition, there is a small bug fix around imports and a number of improvements to the
preview style.

Please try out the
[preview style](https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html#preview-style)
with `black --preview` and tell us your feedback. All changes in the preview style are
expected to become part of Black's stable style in January 2024.

Stable style

- Import lines with ` fmt: skip` and ` fmt: off` no longer have an extra blank line
added when they are right after another import line (3610)

Preview style

- Add trailing commas to collection literals even if there's a comment after the last
entry (3393)
- `async def`, `async for`, and `async with` statements are now formatted consistently
compared to their non-async version. (3609)
- `with` statements that contain two context managers will be consistently wrapped in
parentheses (3589)
- Let string splitters respect [East Asian Width](https://www.unicode.org/reports/tr11/)
(3445)
- Now long string literals can be split after East Asian commas and periods (`、` U+3001
IDEOGRAPHIC COMMA, `。` U+3002 IDEOGRAPHIC FULL STOP, & `,` U+FF0C FULLWIDTH COMMA)
besides before spaces (3445)
- For stubs, enforce one blank line after a nested class with a body other than just
`...` (3564)
- Improve handling of multiline strings by changing line split behavior (1879)

Parser

- Added support for formatting files with invalid type comments (3594)

Integrations

- Update GitHub Action to use the version of Black equivalent to action's version if
version input is not specified (3543)
- Fix missing Python binary path in autoload script for vim (3508)

Documentation

- Document that only the most recent release is supported for security issues;
vulnerabilities should be reported through Tidelift (3612)

23.1.0

Highlights

This is the first release of 2023, and following our [stability policy](https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy), it comes with a number of improvements to our stable style, notably improvements to empty line handling and the removal of redundant parentheses in several contexts.

There are also many changes to the preview style; try out `black --preview` and give us feedback to help us set the stable style for next year.

In addition to style changes, Black now automatically infers the supported Python versions from your `pyproject.toml` file, removing the need to set Black's target versions separately.

Stable style

<!-- Changes that affect Black's stable style -->

- Introduce the 2023 stable style, which incorporates most aspects of last year's preview style (3418). Specific changes:
- Enforce empty lines before classes and functions with sticky leading comments (3302) (22.12.0)
- Reformat empty and whitespace-only files as either an empty file (if no newline is present) or as a single newline character (if a newline is present) (3348) (22.12.0)
- Correctly handle trailing commas that are inside a line's leading non-nested parens (3370) (22.12.0)
- `--skip-string-normalization` / `-S` now prevents docstring prefixes from being normalized as expected (3168) (since 22.8.0)
- When using `--skip-magic-trailing-comma` or `-C`, trailing commas are stripped from subscript expressions with more than 1 element (3209) (22.8.0)
- Fix a string merging/split issue when a comment is present in the middle of implicitly concatenated strings on its own line (3227) (22.8.0)
- Docstring quotes are no longer moved if it would violate the line length limit (3044, 3430) (22.6.0)
- Parentheses around return annotations are now managed (2990) (22.6.0)
- Remove unnecessary parentheses around awaited objects (2991) (22.6.0)
- Remove unnecessary parentheses in `with` statements (2926) (22.6.0)
- Remove trailing newlines after code block open (3035) (22.6.0)
- Code cell separators `%%` are now standardised to ` %%` (2919) (22.3.0)
- Remove unnecessary parentheses from `except` statements (2939) (22.3.0)
- Remove unnecessary parentheses from tuple unpacking in `for` loops (2945) (22.3.0)
- Avoid magic-trailing-comma in single-element subscripts (2942) (22.3.0)
- Fix a crash when a colon line is marked between ` fmt: off` and ` fmt: on` (3439)

Preview style

<!-- Changes that affect Black's preview style -->

- Format hex codes in unicode escape sequences in string literals (2916)
- Add parentheses around `if`-`else` expressions (2278)
- Improve performance on large expressions that contain many strings (3467)
- Fix a crash in preview style with assert + parenthesized string (3415)
- Fix crashes in preview style with walrus operators used in function return annotations and except clauses (3423)
- Fix a crash in preview advanced string processing where mixed implicitly concatenated regular and f-strings start with an empty span (3463)
- Fix a crash in preview advanced string processing where a standalone comment is placed before a dict's value (3469)
- Fix an issue where extra empty lines are added when a decorator has ` fmt: skip` applied or there is a standalone comment between decorators (3470)
- Do not put the closing quotes in a docstring on a separate line, even if the line is too long (3430)
- Long values in dict literals are now wrapped in parentheses; correspondingly unnecessary parentheses around short values in dict literals are now removed; long string lambda values are now wrapped in parentheses (3440)
- Fix two crashes in preview style involving edge cases with docstrings (3451)
- Exclude string type annotations from improved string processing; fix crash when the return type annotation is stringified and spans across multiple lines (3462)
- Wrap multiple context managers in parentheses when targeting Python 3.9+ (3489)
- Fix several crashes in preview style with walrus operators used in `with` statements or tuples (3473)
- Fix an invalid quote escaping bug in f-string expressions where it produced invalid code. Implicitly concatenated f-strings with different quotes can now be merged or quote-normalized by changing the quotes used in expressions. (3509)
- Fix crash on `await (yield)` when Black is compiled with mypyc (3533)

Configuration

<!-- Changes to how Black can be configured -->

- Black now tries to infer its `--target-version` from the project metadata specified in `pyproject.toml` (3219)

Packaging

<!-- Changes to how Black is packaged, such as dependency requirements -->

- Upgrade mypyc from `0.971` to `0.991` so mypycified _Black_ can be built on armv7 (3380)
- This also fixes some crashes while using compiled Black with a debug build of CPython
- Drop specific support for the `tomli` requirement on 3.11 alpha releases, working around a bug that would cause the requirement not to be installed on any non-final Python releases (3448)
- Black now depends on `packaging` version `22.0` or later. This is required for new functionality that needs to parse part of the project metadata (3219)

Output

<!-- Changes to Black's terminal output and error messages -->

- Calling `black --help` multiple times will return the same help contents each time (3516)
- Verbose logging now shows the values of `pyproject.toml` configuration variables (3392)
- Fix false symlink detection messages in verbose output due to using an incorrect relative path to the project root (3385)

Integrations

<!-- For example, Docker, GitHub Actions, pre-commit, editors -->

- Move 3.11 CI to normal flow now that all dependencies support 3.11 (3446)
- Docker: Add new `latest_prerelease` tag automation to follow latest black alpha release on docker images (3465)

Documentation

<!-- Major changes to documentation and policies. Small docs changes
  don't need a changelog entry. -->

- Expand `vim-plug` installation instructions to offer more explicit options (3468)

23.1a1

This release provides a preview of Black's 2023 stable style. Black's default formatting style includes the following changes:

- Enforce empty lines before classes and functions with sticky leading comments
(3302) (22.12.0)
- Reformat empty and whitespace-only files as either an empty file (if no newline is
present) or as a single newline character (if a newline is present) (3348)
(22.12.0)
- Implicitly concatenated strings used as function args are now wrapped inside
parentheses (3307) (22.12.0)
- Correctly handle trailing commas that are inside a line's leading non-nested parens
(3370) (22.12.0)
- `--skip-string-normalization` / `-S` now prevents docstring prefixes from being
normalized as expected (3168) (since 22.8.0)
- When using `--skip-magic-trailing-comma` or `-C`, trailing commas are stripped from
subscript expressions with more than 1 element (3209) (22.8.0)
- Implicitly concatenated strings inside a list, set, or tuple are now wrapped inside
parentheses (3162) (22.8.0)
- Fix a string merging/split issue when a comment is present in the middle of
implicitly concatenated strings on its own line (3227) (22.8.0)
- Docstring quotes are no longer moved if it would violate the line length limit
(3044, 3430) (22.6.0)
- Parentheses around return annotations are now managed (2990) (22.6.0)
- Remove unnecessary parentheses around awaited objects (2991) (22.6.0)
- Remove unnecessary parentheses in `with` statements (2926) (22.6.0)
- Remove trailing newlines after code block open (3035) (22.6.0)
- Code cell separators `%%` are now standardised to ` %%` (2919) (22.3.0)
- Remove unnecessary parentheses from `except` statements (2939) (22.3.0)
- Remove unnecessary parentheses from tuple unpacking in `for` loops (2945) (22.3.0)
- Avoid magic-trailing-comma in single-element subscripts (2942) (22.3.0)

Please try it out and give feedback here: https://github.com/psf/black/issues/3407

A stable 23.1.0 release will follow in January 2023.
Links

Update click from 8.1.3 to 8.1.7.

Changelog

8.1.7

-------------

Released 2023-08-17

-   Fix issue with regex flags in shell completion. :issue:`2581`
-   Bash version detection issues a warning instead of an error. :issue:`2574`
-   Fix issue with completion script for Fish shell. :issue:`2567`

8.1.6

-------------

Released 2023-07-18

-   Fix an issue with type hints for ``click.group()``. :issue:`2558`

8.1.5

-------------

Released 2023-07-13

-   Fix an issue with type hints for ``click.command()``, ``click.option()``, and
 other decorators. Introduce typing tests. :issue:`2558`

8.1.4

-------------

Released 2023-07-06

-   Replace all ``typing.Dict`` occurrences to ``typing.MutableMapping`` for
 parameter hints. :issue:`2255`
-   Improve type hinting for decorators and give all generic types parameters.
 :issue:`2398`
-   Fix return value and type signature of `shell_completion.add_completion_class`
 function. :pr:`2421`
-   Bash version detection doesn't fail on Windows. :issue:`2461`
-   Completion works if there is a dot (``.``) in the program name. :issue:`2166`
-   Improve type annotations for pyright type checker. :issue:`2268`
-   Improve responsiveness of ``click.clear()``. :issue:`2284`
-   Improve command name detection when using Shiv or PEX. :issue:`2332`
-   Avoid showing empty lines if command help text is empty. :issue:`2368`
-   ZSH completion script works when loaded from ``fpath``. :issue:`2344`.
-   ``EOFError`` and ``KeyboardInterrupt`` tracebacks are not suppressed when
 ``standalone_mode`` is disabled. :issue:`2380`
-   ``group.command`` does not fail if the group was created with a custom
 ``command_class``. :issue:`2416`
-   ``multiple=True`` is allowed for flag options again and does not require
 setting ``default=()``. :issue:`2246, 2292, 2295`
-   Make the decorators returned by ``argument()`` and ``option()`` reusable when the
 ``cls`` parameter is used. :issue:`2294`
-   Don't fail when writing filenames to streams with strict errors. Replace invalid
 bytes with the replacement character (``�``). :issue:`2395`
-   Remove unnecessary attempt to detect MSYS2 environment. :issue:`2355`
-   Remove outdated and unnecessary detection of App Engine environment. :pr:`2554`
-   ``echo()`` does not fail when no streams are attached, such as with ``pythonw`` on
 Windows. :issue:`2415`
-   Argument with ``expose_value=False`` do not cause completion to fail. :issue:`2336`
Links

Update configobj from 5.0.6 to 5.0.8.

Changelog

5.0.8

"""""""""""""

* fixing/test for a regression introduced in 5.0.7 that prevented ``import validate`` from working

5.0.7

"""""""""""""

* update testing to validate against python version 2.7 and 3.5-3.11
* update broken links / non-existent services and references

Older Releases
""""""""""""""
Links

Update coverage from 7.0.1 to 7.4.1.

Changelog

7.4.1

-   Python 3.13.0a3 is supported.
-   Fix: the JSON report now includes an explicit format version number, closing [issue 1732](https://github.com/nedbat/coveragepy/issues/1732).


:arrow_right:  PyPI page: [coverage 7.4.1](https://pypi.org/project/coverage/7.4.1).
:arrow_right:  To install: `python3 -m pip install coverage==7.4.1`

7.4.0

-   In Python 3.12 and above, you can try an experimental core based on the new `sys.monitoring <python:sys.monitoring>` module by defining a `COVERAGE_CORE=sysmon` environment variable. This should be faster for line coverage, but not for branch coverage, and plugins and dynamic contexts are not yet supported with it. I am very interested to hear how it works (or doesn't!) for you.


:arrow_right:  PyPI page: [coverage 7.4.0](https://pypi.org/project/coverage/7.4.0).
:arrow_right:  To install: `python3 -m pip install coverage==7.4.0`

7.3.4

-   Fix: the change for multi-line signature exclusions in 7.3.3 broke other forms of nested clauses being excluded properly. This is now fixed, closing [issue 1713](https://github.com/nedbat/coveragepy/issues/1713).
-   Fix: in the HTML report, selecting code for copying won't select the line numbers also. Thanks, [Robert Harris](https://github.com/nedbat/coveragepy/pull/1717).


:arrow_right:  PyPI page: [coverage 7.3.4](https://pypi.org/project/coverage/7.3.4).
:arrow_right:  To install: `python3 -m pip install coverage==7.3.4`

7.3.3

-   Fix: function definitions with multi-line signatures can now be excluded by matching any of the lines, closing [issue 684](https://github.com/nedbat/coveragepy/issues/684). Thanks, [Jan Rusak, Maciej Kowalczyk and Joanna Ejzel](https://github.com/nedbat/coveragepy/pull/1705).
-   Fix: XML reports could fail with a TypeError if files had numeric components that were duplicates except for leading zeroes, like `file1.py` and `file001.py`. Fixes [issue 1709](https://github.com/nedbat/coveragepy/issues/1709).
-   The `coverage annotate` command used to announce that it would be removed in a future version. Enough people got in touch to say that they use it, so it will stay. Don't expect it to keep up with other new features though.
-   Added new `debug options <cmd_run_debug>`:
 -   `pytest` writes the pytest test name into the debug output.
 -   `dataop2` writes the full data being added to CoverageData objects.


:arrow_right:  PyPI page: [coverage 7.3.3](https://pypi.org/project/coverage/7.3.3).
:arrow_right:  To install: `python3 -m pip install coverage==7.3.3`

7.3.2

-   The `coverage lcov` command ignored the `[report] exclude_lines` and `[report] exclude_also` settings ([issue 1684](https://github.com/nedbat/coveragepy/issues/1684)). This is now fixed, thanks [Jacqueline Lee](https://github.com/nedbat/coveragepy/pull/1685).
-   Sometimes SQLite will create journal files alongside the coverage.py database files. These are ephemeral, but could be mistakenly included when combining data files. Now they are always ignored, fixing [issue 1605](https://github.com/nedbat/coveragepy/issues/1605). Thanks to Brad Smith for suggesting fixes and providing detailed debugging.
-   On Python 3.12+, we now disable SQLite writing journal files, which should be a little faster.
-   The new 3.12 soft keyword `type` is properly bolded in HTML reports.
-   Removed the "fullcoverage" feature used by CPython to measure the coverage of early-imported standard library modules. CPython [stopped using it](https://github.com/python/cpython/issues/88054) in 2021, and it stopped working completely in Python 3.13.


:arrow_right:  PyPI page: [coverage 7.3.2](https://pypi.org/project/coverage/7.3.2).
:arrow_right:  To install: `python3 -m pip install coverage==7.3.2`

7.3.1

-   The semantics of stars in file patterns has been clarified in the docs. A leading or trailing star matches any number of path components, like a double star would. This is different than the behavior of a star in the middle of a pattern. This discrepancy was [identified by Sviatoslav Sydorenko](https://github.com/nedbat/coveragepy/issues/1407#issuecomment-1631085209), who [provided patient detailed diagnosis](https://github.com/nedbat/coveragepy/pull/1650) and graciously agreed to a pragmatic resolution.
-   The API docs were missing from the last version. They are now [restored](https://coverage.readthedocs.io/en/latest/api_coverage.html).


:arrow_right:  PyPI page: [coverage 7.3.1](https://pypi.org/project/coverage/7.3.1).
:arrow_right:  To install: `python3 -m pip install coverage==7.3.1`

7.3.0

-   Added a `.Coverage.collect` context manager to start and stop coverage data collection.
-   Dropped support for Python 3.7.
-   Fix: in unusual circumstances, SQLite cannot be set to asynchronous mode. Coverage.py would fail with the error `Safety level may not be changed inside a transaction.` This is now avoided, closing [issue 1646](https://github.com/nedbat/coveragepy/issues/1646). Thanks to Michael Bell for the detailed bug report.
-   Docs: examples of configuration files now include separate examples for the different syntaxes: .coveragerc, pyproject.toml, setup.cfg, and tox.ini.
-   Fix: added `nosemgrep` comments to our JavaScript code so that semgrep-based SAST security checks won't raise false alarms about security problems that aren't problems.
-   Added a CITATION.cff file, thanks to [Ken Schackart](https://github.com/nedbat/coveragepy/pull/1641).


:arrow_right:  PyPI page: [coverage 7.3.0](https://pypi.org/project/coverage/7.3.0).
:arrow_right:  To install: `python3 -m pip install coverage==7.3.0`

7.2.7

-   Fix: reverted a [change from 6.4.3](https://github.com/nedbat/coveragepy/pull/1347) that helped Cython, but also increased the size of data files when using dynamic contexts, as described in the now-fixed [issue 1586](https://github.com/nedbat/coveragepy/issues/1586). The problem is now avoided due to a recent change ([issue 1538](https://github.com/nedbat/coveragepy/issues/1538)). Thanks to [Anders Kaseorg](https://github.com/nedbat/coveragepy/pull/1629) and David Szotten for persisting with problem reports and detailed diagnoses.
-   Wheels are now provided for CPython 3.12.


:arrow_right:  PyPI page: [coverage 7.2.7](https://pypi.org/project/coverage/7.2.7).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.7`

7.2.6

-   Fix: the `lcov` command could raise an IndexError exception if a file is translated to Python but then executed under its own name. Jinja2 does this when rendering templates. Fixes [issue 1553](https://github.com/nedbat/coveragepy/issues/1553).
-   Python 3.12 beta 1 now inlines comprehensions. Previously they were compiled as invisible functions and coverage.py would warn you if they weren't completely executed. This no longer happens under Python 3.12.
-   Fix: the `coverage debug sys` command includes some environment variables in its output. This could have included sensitive data. Those values are now hidden with asterisks, closing [issue 1628](https://github.com/nedbat/coveragepy/issues/1628).


:arrow_right:  PyPI page: [coverage 7.2.6](https://pypi.org/project/coverage/7.2.6).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.6`

7.2.5

-   Fix: `html_report()` could fail with an AttributeError on `isatty` if run in an unusual environment where sys.stdout had been replaced. This is now fixed.


:arrow_right:  PyPI page: [coverage 7.2.5](https://pypi.org/project/coverage/7.2.5).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.5`

7.2.4

PyCon 2023 sprint fixes!

-   Fix: with `relative_files = true`, specifying a specific file to include or omit wouldn't work correctly ([issue 1604](https://github.com/nedbat/coveragepy/issues/1604)). This is now fixed, with testing help by [Marc Gibbons](https://github.com/nedbat/coveragepy/pull/1608).
-   Fix: the XML report would have an incorrect `<source>` element when using relative files and the source option ended with a slash ([issue 1541](https://github.com/nedbat/coveragepy/issues/1541)). This is now fixed, thanks to [Kevin Brown-Silva](https://github.com/nedbat/coveragepy/pull/1608).
-   When the HTML report location is printed to the terminal, it's now a terminal-compatible URL, so that you can click the location to open the HTML file in your browser. Finishes [issue 1523](https://github.com/nedbat/coveragepy/issues/1523) thanks to [Ricardo Newbery](https://github.com/nedbat/coveragepy/pull/1613).
-   Docs: a new `Migrating page <migrating>` with details about how to migrate between major versions of coverage.py. It currently covers the wildcard changes in 7.x. Thanks, [Brian Grohe](https://github.com/nedbat/coveragepy/pull/1610).


:arrow_right:  PyPI page: [coverage 7.2.4](https://pypi.org/project/coverage/7.2.4).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.4`

7.2.3

-   Fix: the `config_run_sigterm` setting was meant to capture data if a process was terminated with a SIGTERM signal, but it didn't always. This was fixed thanks to [Lewis Gaul](https://github.com/nedbat/coveragepy/pull/1600), closing [issue 1599](https://github.com/nedbat/coveragepy/issues/1599).
-   Performance: HTML reports with context information are now much more compact. File sizes are typically as small as one-third the previous size, but can be dramatically smaller. This closes [issue 1584](https://github.com/nedbat/coveragepy/issues/1584) thanks to [Oleh Krehel](https://github.com/nedbat/coveragepy/pull/1587).
-   Development dependencies no longer use hashed pins, closing [issue 1592](https://github.com/nedbat/coveragepy/issues/1592).


:arrow_right:  PyPI page: [coverage 7.2.3](https://pypi.org/project/coverage/7.2.3).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.3`

7.2.2

-   Fix: if a virtualenv was created inside a source directory, and a sourced package was installed inside the virtualenv, then all of the third-party packages inside the virtualenv would be measured. This was incorrect, but has now been fixed: only the specified packages will be measured, thanks to [Manuel Jacob](https://github.com/nedbat/coveragepy/pull/1560).
-   Fix: the `coverage lcov` command could create a .lcov file with incorrect LF (lines found) and LH (lines hit) totals. This is now fixed, thanks to [Ian Moore](https://github.com/nedbat/coveragepy/pull/1583).
-   Fix: the `coverage xml` command on Windows could create a .xml file with duplicate `<package>` elements. This is now fixed, thanks to [Benjamin Parzella](https://github.com/nedbat/coveragepy/pull/1574), closing [issue 1573](https://github.com/nedbat/coveragepy/issues/1573).


:arrow_right:  PyPI page: [coverage 7.2.2](https://pypi.org/project/coverage/7.2.2).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.2`

7.2.1

-   Fix: the PyPI page had broken links to documentation pages, but no longer does, closing [issue 1566](https://github.com/nedbat/coveragepy/issues/1566).
-   Fix: public members of the coverage module are now properly indicated so that mypy will find them, fixing [issue 1564](https://github.com/nedbat/coveragepy/issues/1564).


:arrow_right:  PyPI page: [coverage 7.2.1](https://pypi.org/project/coverage/7.2.1).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.1`

7.2.0

-   Added a new setting `[report] exclude_also` to let you add more exclusions without overwriting the defaults. Thanks, [Alpha Chen](https://github.com/nedbat/coveragepy/pull/1557), closing [issue 1391](https://github.com/nedbat/coveragepy/issues/1391).
-   Added a `.CoverageData.purge_files` method to remove recorded data for a particular file. Contributed by [Stephan Deibel](https://github.com/nedbat/coveragepy/pull/1547).
-   Fix: when reporting commands fail, they will no longer congratulate themselves with messages like "Wrote XML report to file.xml" before spewing a traceback about their failure.
-   Fix: arguments in the public API that name file paths now accept pathlib.Path objects. This includes the `data_file` and `config_file` arguments to the Coverage constructor and the `basename` argument to CoverageData. Closes [issue 1552](https://github.com/nedbat/coveragepy/issues/1552).
-   Fix: In some embedded environments, an IndexError could occur on stop() when the originating thread exits before completion. This is now fixed, thanks to [Russell Keith-Magee](https://github.com/nedbat/coveragepy/pull/1543), closing [issue 1542](https://github.com/nedbat/coveragepy/issues/1542).
-   Added a `py.typed` file to announce our type-hintedness. Thanks, [KotlinIsland](https://github.com/nedbat/coveragepy/pull/1550).


:arrow_right:  PyPI page: [coverage 7.2.0](https://pypi.org/project/coverage/7.2.0).
:arrow_right:  To install: `python3 -m pip install coverage==7.2.0`

7.1.0

-   Added: the debug output file can now be specified with `[run] debug_file` in the configuration file. Closes [issue 1319](https://github.com/nedbat/coveragepy/issues/1319).
-   Performance: fixed a slowdown with dynamic contexts that's been around since 6.4.3. The fix closes [issue 1538](https://github.com/nedbat/coveragepy/issues/1538). Thankfully this doesn't break the [Cython change](https://github.com/nedbat/coveragepy/pull/1347) that fixed [issue 972](https://github.com/nedbat/coveragepy/issues/972). Thanks to Mathieu Kniewallner for the deep investigative work and comprehensive issue report.
-   Typing: all product and test code has type annotations.


:arrow_right:  PyPI page: [coverage 7.1.0](https://pypi.org/project/coverage/7.1.0).
:arrow_right:  To install: `python3 -m pip install coverage==7.1.0`

7.0.5

-   Fix: On Python 3.7, a file with type annotations but no `from __future__ import annotations` would be missing statements in the coverage report. This is now fixed, closing [issue 1524](https://github.com/nedbat/coveragepy/issues/1524).


:arrow_right:  PyPI page: [coverage 7.0.5](https://pypi.org/project/coverage/7.0.5).
:arrow_right:  To install: `python3 -m pip install coverage==7.0.5`

7.0.4

-   Performance: an internal cache of file names was accidentally disabled, resulting in sometimes drastic reductions in performance. This is now fixed, closing [issue 1527](https://github.com/nedbat/coveragepy/issues/1527). Thanks to Ivan Ciuvalschii for the reproducible test case.


:arrow_right:  PyPI page: [coverage 7.0.4](https://pypi.org/project/coverage/7.0.4).
:arrow_right:  To install: `python3 -m pip install coverage==7.0.4`

7.0.3

-   Fix: when using pytest-cov or pytest-xdist, or perhaps both, the combining step could fail with `assert row is not None` using 7.0.2. This was due to a race condition that has always been possible and is still possible. In 7.0.1 and before, the error was silently swallowed by the combining code. Now it will produce a message "Couldn't combine data file" and ignore the data file as it used to do before 7.0.2. Closes [issue 1522](https://github.com/nedbat/coveragepy/issues/1522).


:arrow_right:  PyPI page: [coverage 7.0.3](https://pypi.org/project/coverage/7.0.3).
:arrow_right:  To install: `python3 -m pip install coverage==7.0.3`

7.0.2

-   Fix: when using the `[run] relative_files = True` setting, a relative `[paths]` pattern was still being made absolute. This is now fixed, closing [issue 1519](https://github.com/nedbat/coveragepy/issues/1519).
-   Fix: if Python doesn't provide tomllib, then TOML configuration files can only be read if coverage.py is installed with the `[toml]` extra. Coverage.py will raise an error if TOML support is not installed when it sees your settings are in a .toml file. But it didn't understand that `[tools.coverage]` was a valid section header, so the error wasn't reported if you used that header, and settings were silently ignored. This is now fixed, closing [issue 1516](https://github.com/nedbat/coveragepy/issues/1516).
-   Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing [issue 1515](https://github.com/nedbat/coveragepy/issues/1515).
-   Fix: the `coverage lcov` report did not properly implement the `--fail-under=MIN` option. This has been fixed.
-   Refactor: added many type annotations, including a number of refactorings. This should not affect outward behavior, but they were a bit invasive in some places, so keep your eyes peeled for oddities.
-   Refactor: removed the vestigial and long untested support for Jython and IronPython.


:arrow_right:  PyPI page: [coverage 7.0.2](https://pypi.org/project/coverage/7.0.2).
:arrow_right:  To install: `python3 -m pip install coverage==7.0.2`
Links

Update django from 4.1.4 to 5.0.1.

Changelog

5.0.1

==========================

*January 2, 2024*

Django 5.0.1 fixes several bugs in 5.0.

Bugfixes
========

* Reallowed, following a regression in Django 5.0, using a foreign key to a
model with a primary key that is not ``AutoField`` in
:attr:`.ModelAdmin.list_filter` (:ticket:`35020`).

* Fixed a long standing bug in handling the ``RETURNING INTO`` clause that
caused a crash when creating a model instance with a ``GeneratedField`` which
``output_field`` had backend-specific converters (:ticket:`35024`).

* Fixed a regression in Django 5.0 that caused a crash of ``Model.save()`` for
models with both ``GeneratedField`` and ``ForeignKey`` fields
(:ticket:`35019`).

* Fixed a bug in Django 5.0 that caused a migration crash on Oracle < 23c when
adding a ``GeneratedField`` with ``output_field=BooleanField``
(:ticket:`35018`).

* Fixed a regression in Django 5.0 where admin fields on the same line could
overflow the page and become non-interactive (:ticket:`35012`).

* Added compatibility for ``oracledb`` 2.0.0 (:ticket:`35054`).

* Fixed a regression in Django 5.0 where querysets referenced incorrect field
names from ``FilteredRelation()`` (:ticket:`35050`).

* Fixed a regression in Django 5.0 that caused a system check crash when
``ModelAdmin.filter_horizontal`` or ``filter_vertical`` contained a reverse
many-to-many relation with ``related_name`` (:ticket:`35056`).


========================

5.0

========================

*December 4, 2023*

Welcome to Django 5.0!

These release notes cover the :ref:`new features <whats-new-5.0>`, as well as
some :ref:`backwards incompatible changes <backwards-incompatible-5.0>` you'll
want to be aware of when upgrading from Django 4.2 or earlier. We've
:ref:`begun the deprecation process for some features
<deprecated-features-5.0>`.

See the :doc:`/howto/upgrade-version` guide if you're updating an existing
project.

Python compatibility
====================

Django 5.0 supports Python 3.10, 3.11, and 3.12. We **highly recommend** and
only officially support the latest release of each series.

The Django 4.2.x series is the last to support Python 3.8 and 3.9.

Third-party library support for older version of Django
=======================================================

Following the release of Django 5.0, we suggest that third-party app authors
drop support for all versions of Django prior to 4.2. At that time, you should
be able to run your package's tests using ``python -Wd`` so that deprecation
warnings appear. After making the deprecation warning fixes, your app should be
compatible with Django 5.0.

.. _whats-new-5.0:

What's new in Django 5.0
========================

Facet filters in the admin
--------------------------

Facet counts are now shown for applied filters in the admin changelist when
toggled on via the UI. This behavior can be changed via the new
:attr:`.ModelAdmin.show_facets` attribute. For more information see
:ref:`facet-filters`.

Simplified templates for form field rendering
---------------------------------------------

Django 5.0 introduces the concept of a field group, and field group templates.
This simplifies rendering of the related elements of a Django form field such
as its label, widget, help text, and errors.

For example, the template below:

.. code-block:: html+django

 <form>
 ...
 <div>
   {{ form.name.label_tag }}
   {% if form.name.help_text %}
     <div class="helptext" id="{{ form.name.auto_id }}_helptext">
       {{ form.name.help_text|safe }}
     </div>
   {% endif %}
   {{ form.name.errors }}
   {{ form.name }}
   <div class="row">
     <div class="col">
       {{ form.email.label_tag }}
       {% if form.email.help_text %}
         <div class="helptext" id="{{ form.email.auto_id }}_helptext">
           {{ form.email.help_text|safe }}
         </div>
       {% endif %}
       {{ form.email.errors }}
       {{ form.email }}
     </div>
     <div class="col">
       {{ form.password.label_tag }}
       {% if form.password.help_text %}
         <div class="helptext" id="{{ form.password.auto_id }}_helptext">
           {{ form.password.help_text|safe }}
         </div>
       {% endif %}
       {{ form.password.errors }}
       {{ form.password }}
     </div>
   </div>
 </div>
 ...
 </form>

Can now be simplified to:

.. code-block:: html+django

 <form>
 ...
 <div>
   {{ form.name.as_field_group }}
   <div class="row">
     <div class="col">{{ form.email.as_field_group }}</div>
     <div class="col">{{ form.password.as_field_group }}</div>
   </div>
 </div>
 ...
 </form>

:meth:`~django.forms.BoundField.as_field_group` renders fields with the
``"django/forms/field.html"`` template by default and can be customized on a
per-project, per-field, or per-request basis. See
:ref:`reusable-field-group-templates`.

Database-computed default values
--------------------------------

The new :attr:`Field.db_default <django.db.models.Field.db_default>` parameter
sets a database-computed default value. For example::

 from django.db import models
 from django.db.models.functions import Now, Pi


 class MyModel(models.Model):
     age = models.IntegerField(db_default=18)
     created = models.DateTimeField(db_default=Now())
     circumference = models.FloatField(db_default=2 * Pi())

Database generated model field
------------------------------

The new :class:`~django.db.models.GeneratedField` allows creation of database
generated columns. This field can be used on all supported database backends
to create a field that is always computed from other fields. For example::

 from django.db import models
 from django.db.models import F


 class Square(models.Model):
     side = models.IntegerField()
     area = models.GeneratedField(
         expression=F("side") * F("side"),
         output_field=models.BigIntegerField(),
         db_persist=True,
     )

More options for declaring field choices
----------------------------------------

:attr:`.Field.choices` *(for model fields)* and :attr:`.ChoiceField.choices`
*(for form fields)* allow for more flexibility when declaring their values. In
previous versions of Django, ``choices`` should either be a list of 2-tuples,
or an :ref:`field-choices-enum-types` subclass, but the latter required
accessing the ``.choices`` attribute to provide the values in the expected
form::

 from django.db import models

 Medal = models.TextChoices("Medal", "GOLD SILVER BRONZE")

 SPORT_CHOICES = [
     ("Martial Arts", [("judo", "Judo"), ("karate", "Karate")]),
     ("Racket", [("badminton", "Badminton"), ("tennis", "Tennis")]),
     ("unknown", "Unknown"),
 ]


 class Winner(models.Model):
     name = models.CharField(...)
     medal = models.CharField(..., choices=Medal.choices)
     sport = models.CharField(..., choices=SPORT_CHOICES)

Django 5.0 adds support for accepting a mapping or a callable instead of an
iterable, and also no longer requires ``.choices`` to be used directly to
expand :ref:`enumeration types <field-choices-enum-types>`::

 from django.db import models

 Medal = models.TextChoices("Medal", "GOLD SILVER BRONZE")

 SPORT_CHOICES = {   Using a mapping instead of a list of 2-tuples.
     "Martial Arts": {"judo": "Judo", "karate": "Karate"},
     "Racket": {"badminton": "Badminton", "tennis": "Tennis"},
     "unknown": "Unknown",
 }


 def get_scores():
     return [(i, str(i)) for i in range(10)]


 class Winner(models.Model):
     name = models.CharField(...)
     medal = models.CharField(..., choices=Medal)   Using `.choices` not required.
     sport = models.CharField(..., choices=SPORT_CHOICES)
     score = models.IntegerField(choices=get_scores)   A callable is allowed.

Under the hood the provided ``choices`` are normalized into a list of 2-tuples
as the canonical form whenever the ``choices`` value is updated. For more
information, please check the :ref:`model field reference on choices
<field-choices>`.

Minor features
--------------

:mod:`django.contrib.admin`
~~~~~~~~~~~~~~~~~~~~~~~~~~~

* The new :meth:`.AdminSite.get_log_entries` method allows customizing the
queryset for the site's listed log entries.

* The ``django.contrib.admin.AllValuesFieldListFilter``,
``ChoicesFieldListFilter``, ``RelatedFieldListFilter``, and
``RelatedOnlyFieldListFilter`` admin filters now handle multi-valued query
parameters.

* ``XRegExp`` is upgraded from version 3.2.0 to 5.1.1.

* The new :meth:`.AdminSite.get_model_admin` method returns an admin class for
the given model class.

* Properties in :attr:`.ModelAdmin.list_display` now support ``boolean``
attribute.

* jQuery is upgraded from version 3.6.4 to 3.7.1.


:mod:`django.contrib.auth`
~~~~~~~~~~~~~~~~~~~~~~~~~~

* The default iteration count for the PBKDF2 password hasher is increased from
600,000 to 720,000.

* The new asynchronous functions are now provided, using an
``a`` prefix: :func:`django.contrib.auth.aauthenticate`,
:func:`~.django.contrib.auth.aget_user`,
:func:`~.django.contrib.auth.alogin`, :func:`~.django.contrib.auth.alogout`,
and :func:`~.django.contrib.auth.aupdate_session_auth_hash`.

* ``AuthenticationMiddleware`` now adds an :meth:`.HttpRequest.auser`
asynchronous method that returns the currently logged-in user.

* The new :func:`django.contrib.auth.hashers.acheck_password` asynchronous
function and :meth:`.AbstractBaseUser.acheck_password` method allow
asynchronous checking of user passwords.

:mod:`django.contrib.contenttypes`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* :meth:`.QuerySet.prefetch_related` now supports prefetching
:class:`~django.contrib.contenttypes.fields.GenericForeignKey` with
non-homogeneous set of results.

:mod:`django.contrib.gis`
~~~~~~~~~~~~~~~~~~~~~~~~~

* The new
:class:`ClosestPoint() <django.contrib.gis.db.models.functions.ClosestPoint>`
function returns a 2-dimensional point on the geometry that is closest to
another geometry.

* :ref:`GIS aggregates <gis-aggregation-functions>` now support the ``filter``
argument.

* Support for GDAL 3.7 and GEOS 3.12 is added.

* The new :meth:`.GEOSGeometry.equals_identical` method allows point-wise
equivalence checking of geometries.

:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* The new :meth:`.MessagesTestMixin.assertMessages` assertion method allows
testing :mod:`~django.contrib.messages` added to a
:class:`response <django.http.HttpResponse>`.

:mod:`django.contrib.postgres`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* The new :attr:`~.ExclusionConstraint.violation_error_code` attribute of
:class:`~django.contrib.postgres.constraints.ExclusionConstraint` allows
customizing the ``code`` of ``ValidationError`` raised during
:ref:`model validation <validating-objects>`.

Asynchronous views
~~~~~~~~~~~~~~~~~~

* Under ASGI, ``http.disconnect`` events are now handled. This allows views to
perform any necessary cleanup if a client disconnects before the response is
generated. See :ref:`async-handling-disconnect` for more details.

Decorators
~~~~~~~~~~

* The following decorators now support wrapping asynchronous view functions:

* :func:`~django.views.decorators.cache.cache_control`
* :func:`~django.views.decorators.cache.never_cache`
* :func:`~django.views.decorators.common.no_append_slash`
* :func:`~django.views.decorators.csrf.csrf_exempt`
* :func:`~django.views.decorators.csrf.csrf_protect`
* :func:`~django.views.decorators.csrf.ensure_csrf_cookie`
* :func:`~django.views.decorators.csrf.requires_csrf_token`
* :func:`~django.views.decorators.debug.sensitive_variables`
* :func:`~django.views.decorators.debug.sensitive_post_parameters`
* :func:`~django.views.decorators.gzip.gzip_page`
* :func:`~django.views.decorators.http.condition`
* ``conditional_page()``
* :func:`~django.views.decorators.http.etag`
* :func:`~django.views.decorators.http.last_modified`
* :func:`~django.views.decorators.http.require_http_methods`
* :func:`~django.views.decorators.http.require_GET`
* :func:`~django.views.decorators.http.require_POST`
* :func:`~django.views.decorators.http.require_safe`
* :func:`~django.views.decorators.vary.vary_on_cookie`
* :func:`~django.views.decorators.vary.vary_on_headers`
* ``xframe_options_deny()``
* ``xframe_options_sameorigin()``
* ``xframe_options_exempt()``

Error Reporting
~~~~~~~~~~~~~~~

* :func:`~django.views.decorators.debug.sensitive_variables` and
:func:`~django.views.decorators.debug.sensitive_post_parameters` can now be
used with asynchronous functions.

File Storage
~~~~~~~~~~~~

* :meth:`.File.open` now passes all positional (``*args``) and keyword
arguments (``**kwargs``) to Python's built-in :func:`python:open`.

Forms
~~~~~

* The new :attr:`~django.forms.URLField.assume_scheme` argument for
:class:`~django.forms.URLField` allows specifying a default URL scheme.

* In order to improve accessibility, the following changes are made:

* Form fields now include the ``aria-describedby`` HTML attribute to enable
 screen readers to associate form fields with their help text.
* Invalid form fields now include the ``aria-invalid="true"`` HTML attribute.

Internationalization
~~~~~~~~~~~~~~~~~~~~

* Support and translations for the Uyghur language are now available.

Migrations
~~~~~~~~~~

* Serialization of functions decorated with :func:`functools.cache` or
:func:`functools.lru_cache` is now supported without the need to write a
custom serializer.

Models
~~~~~~

* The new ``create_defaults`` argument of :meth:`.QuerySet.update_or_create`
and :meth:`.QuerySet.aupdate_or_create` methods allows specifying a different
field values for the create operation.

* The new ``violation_error_code`` attribute of
:class:`~django.db.models.BaseConstraint`,
:class:`~django.db.models.CheckConstraint`, and
:class:`~django.db.models.UniqueConstraint` allows customizing the ``code``
of ``ValidationError`` raised during
:ref:`model validation <validating-objects>`.

* The :ref:`force_insert <ref-models-force-insert>` argument of
:meth:`.Model.save` now allows specifying a tuple of parent classes that must
be forced to be inserted.

* :meth:`.QuerySet.bulk_c

@pyup-bot
Copy link
Collaborator Author

pyup-bot commented Feb 5, 2024

Closing this in favor of #207

@pyup-bot pyup-bot closed this Feb 5, 2024
@Jackevansevo Jackevansevo deleted the pyup-scheduled-update-2024-01-29 branch February 5, 2024 16:45
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.

None yet

1 participant