Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aio-libs/multidict
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.1.0
Choose a base ref
...
head repository: aio-libs/multidict
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.2.0
Choose a head ref
Loading
Showing with 2,738 additions and 1,216 deletions.
  1. +10 −10 .codecov.yml
  2. +20 −7 .coveragerc
  3. +1 −1 .flake8
  4. +1 −1 .github/workflows/auto-merge.yml
  5. +142 −16 .github/workflows/ci-cd.yml
  6. +6 −5 .github/workflows/reusable-build-wheel.yml
  7. +4 −5 .github/workflows/reusable-linters.yml
  8. +8 −111 .mypy.ini
  9. +7 −31 .pre-commit-config.yaml
  10. +2 −2 .readthedocs.yml
  11. +75 −24 CHANGES.rst
  12. +17 −9 CHANGES/.TEMPLATE.rst
  13. +2 −3 docs/conf.py
  14. +1 −0 docs/spelling_wordlist.txt
  15. +7 −7 multidict/__init__.py
  16. +0 −152 multidict/__init__.pyi
  17. +49 −28 multidict/_abc.py
  18. +37 −48 multidict/_multidict.c
  19. +48 −24 multidict/_multidict_base.py
  20. +270 −217 multidict/_multidict_py.py
  21. +0 −4 multidict/_multilib/defs.h
  22. +0 −4 multidict/_multilib/istr.h
  23. +48 −12 multidict/_multilib/pair_list.h
  24. +1,142 −0 multidict/_multilib/pythoncapi_compat.h
  25. +4 −70 pyproject.toml
  26. +3 −5 pytest.ini
  27. +1 −1 requirements/doc-spelling.txt
  28. +2 −2 requirements/doc.txt
  29. +4 −3 requirements/lint.txt
  30. +3 −2 requirements/pytest.txt
  31. +1 −2 setup.cfg
  32. +29 −39 tests/conftest.py
  33. +6 −2 tests/gen_pickles.py
  34. +12 −74 tests/test_abc.py
  35. +12 −4 tests/test_copy.py
  36. +4 −6 tests/test_guard.py
  37. +1 −1 tests/test_istr.py
  38. +128 −124 tests/test_multidict.py
  39. +391 −0 tests/test_multidict_benchmarks.py
  40. +62 −62 tests/test_mutable_multidict.py
  41. +18 −3 tests/test_pickle.py
  42. +25 −27 tests/test_types.py
  43. +18 −26 tests/test_update.py
  44. +49 −42 tests/test_version.py
  45. +68 −0 towncrier.toml
20 changes: 10 additions & 10 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -7,37 +7,37 @@ codecov:

require_ci_to_pass: false

token: 796e466d-bf08-4b98-8d5b-0e9c442aef06 # repo-scoped

comment:
require_changes: true

coverage:
range: 97.87..100
status:
patch:
default:
target: 100%
flags:
- pytest
project:
default:
target: 100%
lib:
flags:
- unit
- pytest
paths:
- multidict/**/*.py
- multidict/
target: 94.05%
tests:
flags:
- unit
- pytest
paths:
- tests/
target: 100%
typing:
flags:
- MyPy
target: 100%
typing-stubs:
flags:
- MyPy
paths:
- >-
**/*.pyi
target: 100%

...
27 changes: 20 additions & 7 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
[html]
show_contexts = true
skip_covered = false

[paths]
source =
multidict
*/lib/pypy*/site-packages/multidict
*/lib/python*/site-packages/multidict
*/Lib/site-packages/multidict
_site-packages-to-src-mapping =
.
*/lib/pypy*/site-packages
*/lib/python*/site-packages
*\Lib\site-packages

[report]
exclude_also =
pass
if TYPE_CHECKING
assert False
: \.\.\.(\s*#.*)?$
^ +\.\.\.$
# fail_under = 98.95
skip_covered = true
skip_empty = true
show_missing = true

[run]
branch = true
cover_pylib = false
# https://coverage.rtfd.io/en/latest/contexts.html#dynamic-contexts
# dynamic_context = test_function # conflicts with `pytest-cov` if set here
parallel = true
# plugins =
# covdefaults
relative_files = true
source =
tests
.
source_pkgs =
multidict
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
# Y026,Y027: Incompatible with Python 3.7 (https://github.com/aio-libs/multidict/pull/798)
ignore = E302,E701,E305,E704,F811,N811,W503,Y026,Y027
ignore = E301,E302,E701,E305,E501,E704,F811,N811,W503,Y026,Y027
max-line-length=88

# flake8-pytest-style
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.2.0
uses: dependabot/fetch-metadata@v2.3.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
158 changes: 142 additions & 16 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ jobs:
}
>> "${GITHUB_OUTPUT}"
- name: Upload built artifacts for testing
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ needs.pre-setup.outputs.dists-artifact-name }}
@@ -150,21 +150,25 @@ jobs:
strategy:
matrix:
pyver:
- 3.13-freethreading
- 3.13
- 3.12
- 3.11
- "3.10"
- 3.9
- 3.8
no-extensions: ['', 'Y']
os: [ubuntu, macos, windows]
exclude:
- os: macos
no-extensions: Y
- os: windows
no-extensions: Y
- os: macos
pyver: 3.13-freethreading # this is still tested within cibuildwheel
- os: windows
pyver: 3.13-freethreading # this is still tested within cibuildwheel
include:
- pyver: pypy-3.8
- pyver: pypy-3.9
no-extensions: Y
os: ubuntu
fail-fast: false
@@ -180,25 +184,59 @@ jobs:
steps:
- name: Retrieve the project source from an sdist inside the GHA artifact
uses: re-actors/checkout-python-sdist@release/v1
uses: re-actors/checkout-python-sdist@release/v2
with:
source-tarball-name: >-
${{ needs.build-pure-python-dists.outputs.sdist-filename }}
workflow-artifact-name: >-
${{ needs.pre-setup.outputs.dists-artifact-name }}
- name: Download distributions
if: ${{ !endsWith(matrix.pyver, '-dev') && true || false }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.pre-setup.outputs.dists-artifact-name }}
pattern: ${{ needs.pre-setup.outputs.dists-artifact-name }}*
merge-multiple: true
path: dist

- name: Setup Python ${{ matrix.pyver }}
id: python-install
if: >-
!endsWith(matrix.pyver, '-freethreading')
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}
allow-prereleases: true
- name: Setup Python ${{ matrix.pyver }}
if: endsWith(matrix.pyver, '-freethreading')
uses: deadsnakes/action@v3.2.0
with:
python-version: 3.13-dev
nogil: true
- name: Compute runtime Python version
id: python-install
run: |
import sys
from os import environ
from pathlib import Path
FILE_APPEND_MODE = 'a'
python_version_str = ".".join(
map(str, sys.version_info[:3]),
)
freethreading_suffix = (
'' if sys.version_info < (3, 13) or sys._is_gil_enabled()
else 't'
)
with Path(environ['GITHUB_OUTPUT']).open(
mode=FILE_APPEND_MODE,
) as outputs_file:
print(
f'python-version={python_version_str}{freethreading_suffix}',
file=outputs_file,
)
shell: python

- name: Get pip cache dir
id: pip-cache
run: |
@@ -318,7 +356,90 @@ jobs:
# combining Linux and Windows paths is tricky, left this exercise for
# others multidict has no Windows or macOS specific code paths anyway
if: ${{ matrix.os == 'ubuntu' }}
uses: aio-libs/prepare-coverage@v22.1.2
uses: aio-libs/prepare-coverage@v24.9.2

benchmark:
name: Benchmark
needs:
- build-pure-python-dists # transitive, for accessing settings
- build-wheels-for-tested-arches
- pre-setup # transitive, for accessing settings
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Retrieve the project source from an sdist inside the GHA artifact
uses: re-actors/checkout-python-sdist@release/v2
with:
source-tarball-name: >-
${{ needs.build-pure-python-dists.outputs.sdist-filename }}
workflow-artifact-name: >-
${{ needs.pre-setup.outputs.dists-artifact-name }}
- name: Download distributions
uses: actions/download-artifact@v4
with:
path: dist
pattern: ${{ needs.pre-setup.outputs.dists-artifact-name }}*
merge-multiple: true

- name: Setup Python 3.12
id: python-install
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: requirements/*.txt
- name: Install dependencies
uses: py-actions/py-dependency-install@v4
with:
path: requirements/pytest.txt
- name: Determine pre-compiled compatible wheel
env:
# NOTE: When `pip` is forced to colorize output piped into `jq`,
# NOTE: the latter can't parse it. So we're overriding the color
# NOTE: preference here via https://no-color.org.
# NOTE: Setting `FORCE_COLOR` to any value (including 0, an empty
# NOTE: string, or a "YAML null" `~`) doesn't have any effect and
# NOTE: `pip` (through its verndored copy of `rich`) treats the
# NOTE: presence of the variable as "force-color" regardless.
#
# NOTE: This doesn't actually work either, so we'll resort to unsetting
# NOTE: in the Bash script.
# NOTE: Ref: https://github.com/Textualize/rich/issues/2622
NO_COLOR: 1
id: wheel-file
run: >
echo -n path= | tee -a "${GITHUB_OUTPUT}"
unset FORCE_COLOR
python
-X utf8
-u -I
-m pip install
--find-links=./dist
--no-index
'${{ env.PROJECT_NAME }}'
--force-reinstall
--no-color
--no-deps
--only-binary=:all:
--dry-run
--report=-
--quiet
| jq --raw-output .install[].download_info.url
| tee -a "${GITHUB_OUTPUT}"
shell: bash
- name: Self-install
run: python -Im pip install '${{ steps.wheel-file.outputs.path }}'
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: python -Im pytest --no-cov -vvvvv --codspeed

test-summary:
name: Tests status
@@ -336,16 +457,17 @@ jobs:
with:
jobs: ${{ toJSON(needs) }}
- name: Retrieve the project source from an sdist inside the GHA artifact
uses: re-actors/checkout-python-sdist@release/v1
uses: re-actors/checkout-python-sdist@release/v2
with:
source-tarball-name: >-
${{ needs.build-pure-python-dists.outputs.sdist-filename }}
workflow-artifact-name: >-
${{ needs.pre-setup.outputs.dists-artifact-name }}
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: coverage
pattern: coverage*
merge-multiple: true
path: ${{ runner.temp }}/coverage
- name: Install coverage
run: |
@@ -360,12 +482,13 @@ jobs:
coverage xml
shell: bash
- name: Send coverage data to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: coverage.xml
flags: >-
CI-GHA,
unit
pytest
token: ${{ secrets.CODECOV_TOKEN }}

pre-deploy:
@@ -419,17 +542,18 @@ jobs:

steps:
- name: Retrieve the project source from an sdist inside the GHA artifact
uses: re-actors/checkout-python-sdist@release/v1
uses: re-actors/checkout-python-sdist@release/v2
with:
source-tarball-name: >-
${{ needs.build-pure-python-dists.outputs.sdist-filename }}
workflow-artifact-name: >-
${{ needs.pre-setup.outputs.dists-artifact-name }}
- name: Download distributions
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.pre-setup.outputs.dists-artifact-name }}
pattern: ${{ needs.pre-setup.outputs.dists-artifact-name }}*
merge-multiple: true
path: dist
- run: |
tree
@@ -445,6 +569,8 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
artifact: >-
${{ needs.pre-setup.outputs.dists-artifact-name }}
head_line: >-
{version}\n=+\n\n\*\({date}\)\*\n
fix_issue_regex: >-
:issue:`(\d+)`
fix_issue_repl: >-
Loading