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/propcache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.0
Choose a base ref
...
head repository: aio-libs/propcache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.3.1
Choose a head ref
  • 12 commits
  • 24 files changed
  • 3 contributors

Commits on Feb 20, 2025

  1. Increment version to 0.3.1.dev0 (#97)

    bdraco authored Feb 20, 2025
    Copy the full SHA
    a95662f View commit details

Commits on Feb 24, 2025

  1. Bump sphinx from 8.2.0 to 8.2.1 (#99)

    Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.2.0 to 8.2.1.
    - [Release notes](https://github.com/sphinx-doc/sphinx/releases)
    - [Changelog](https://github.com/sphinx-doc/sphinx/blob/v8.2.1/CHANGES.rst)
    - [Commits](sphinx-doc/sphinx@v8.2.0...v8.2.1)
    
    ---
    updated-dependencies:
    - dependency-name: sphinx
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 24, 2025
    Copy the full SHA
    d44bb30 View commit details

Commits on Mar 17, 2025

  1. Strict typing (#103)

    Dreamsorcerer authored Mar 17, 2025
    Copy the full SHA
    eb64b65 View commit details
  2. Bump sphinx from 8.2.1 to 8.2.3 (#100)

    Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.2.1 to 8.2.3.
    - [Release notes](https://github.com/sphinx-doc/sphinx/releases)
    - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
    - [Commits](sphinx-doc/sphinx@v8.2.1...v8.2.3)
    
    ---
    updated-dependencies:
    - dependency-name: sphinx
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 17, 2025
    Copy the full SHA
    c5d43c7 View commit details
  3. Bump pytest from 8.3.4 to 8.3.5 (#101)

    Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.4 to 8.3.5.
    - [Release notes](https://github.com/pytest-dev/pytest/releases)
    - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
    - [Commits](pytest-dev/pytest@8.3.4...8.3.5)
    
    ---
    updated-dependencies:
    - dependency-name: pytest
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 17, 2025
    Copy the full SHA
    317e5a4 View commit details
  4. Bump pypa/cibuildwheel from 2.22.0 to 2.23.0 (#102)

    Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.22.0 to 2.23.0.
    - [Release notes](https://github.com/pypa/cibuildwheel/releases)
    - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
    - [Commits](pypa/cibuildwheel@v2.22.0...v2.23.0)
    
    ---
    updated-dependencies:
    - dependency-name: pypa/cibuildwheel
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 17, 2025
    Copy the full SHA
    92b4baf View commit details
  5. Bump pypa/cibuildwheel from 2.23.0 to 2.23.1 (#104)

    Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.23.0 to 2.23.1.
    - [Release notes](https://github.com/pypa/cibuildwheel/releases)
    - [Changelog](https://github.com/pypa/cibuildwheel/blob/v2.23.1/docs/changelog.md)
    - [Commits](pypa/cibuildwheel@v2.23.0...v2.23.1)
    
    ---
    updated-dependencies:
    - dependency-name: pypa/cibuildwheel
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 17, 2025
    Copy the full SHA
    7c65ce0 View commit details

Commits on Mar 18, 2025

  1. Bump pre-commit from 4.1.0 to 4.2.0 (#106)

    Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 4.1.0 to 4.2.0.
    - [Release notes](https://github.com/pre-commit/pre-commit/releases)
    - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
    - [Commits](pre-commit/pre-commit@v4.1.0...v4.2.0)
    
    ---
    updated-dependencies:
    - dependency-name: pre-commit
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 18, 2025
    Copy the full SHA
    f89c519 View commit details

Commits on Mar 19, 2025

  1. Allow TypedDict for cache implementation (#105)

    Dreamsorcerer authored Mar 19, 2025
    Copy the full SHA
    4fdda24 View commit details

Commits on Mar 25, 2025

  1. Bump pypa/cibuildwheel from 2.23.1 to 2.23.2 (#107)

    Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.23.1 to 2.23.2.
    - [Release notes](https://github.com/pypa/cibuildwheel/releases)
    - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
    - [Commits](pypa/cibuildwheel@v2.23.1...v2.23.2)
    
    ---
    updated-dependencies:
    - dependency-name: pypa/cibuildwheel
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 25, 2025
    Copy the full SHA
    b884eda View commit details

Commits on Mar 26, 2025

  1. Release v0.3.1 (#108)

    Dreamsorcerer authored Mar 26, 2025
    Copy the full SHA
    f9d877d View commit details
  2. Fix release

    Dreamsorcerer authored Mar 26, 2025
    Copy the full SHA
    79088e6 View commit details
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

codecov:
notify:
after_n_builds: 23 # The number of test matrix+lint jobs uploading coverage
after_n_builds: 20 # The number of test matrix+lint jobs uploading coverage
wait_for_ci: false

require_ci_to_pass: false
5 changes: 4 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -13,7 +13,10 @@ _site-packages-to-src-mapping =

[report]
exclude_also =
^\s*@pytest\.mark\.xfail
if TYPE_CHECKING
assert False
: \.\.\.(\s*#.*)?$
^ +\.\.\.$
# small library, don't fail when running without C-extension
fail_under = 50.00
skip_covered = true
2 changes: 1 addition & 1 deletion .github/workflows/reusable-build-wheel.yml
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ jobs:
shell: bash

- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
uses: pypa/cibuildwheel@v2.23.2
env:
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_CONFIG_SETTINGS: >- # Cython line tracing for coverage collection
5 changes: 1 addition & 4 deletions .github/workflows/reusable-linters.yml
Original file line number Diff line number Diff line change
@@ -71,10 +71,7 @@ jobs:
with:
token: ${{ secrets.codecov-token }}
files: >-
.tox/.tmp/.mypy/python-3.13/cobertura.xml,
.tox/.tmp/.mypy/python-3.12/cobertura.xml,
.tox/.tmp/.mypy/python-3.11/cobertura.xml,
.tox/.tmp/.mypy/python-3.9/cobertura.xml
.tox/.tmp/.mypy/python-3.11/cobertura.xml
flags: >-
CI-GHA,
MyPy
72 changes: 27 additions & 45 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -1,46 +1,28 @@
[mypy]
python_version = 3.9
color_output = true
error_summary = true
files =
packaging/,
tests/,
src/propcache/

# check_untyped_defs = true

# disallow_untyped_calls = true
# disallow_untyped_defs = true
# disallow_any_generics = true

enable_error_code =
ignore-without-code

follow_imports = normal

ignore_missing_imports = false

pretty = true

show_column_numbers = true
show_error_codes = true
strict_optional = true

warn_no_return = true
warn_redundant_casts = true
warn_unused_ignores = true

[mypy-Cython.*]
ignore_missing_imports = true

[mypy-distutils.*]
ignore_missing_imports = true

[mypy-expandvars]
ignore_missing_imports = true

[mypy-pytest]
ignore_missing_imports = true

[mypy-tomllib]
ignore_missing_imports = true
files = packaging, src, tests
check_untyped_defs = True
follow_imports_for_stubs = True
disallow_any_decorated = True
disallow_any_generics = True
disallow_any_unimported = True
disallow_incomplete_defs = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
disallow_untyped_defs = True
# TODO(PY312): explicit-override
enable_error_code = deprecated, ignore-without-code, possibly-undefined, redundant-expr, redundant-self, truthy-bool, truthy-iterable, unused-awaitable
extra_checks = True
follow_untyped_imports = True
implicit_reexport = False
no_implicit_optional = True
pretty = True
show_column_numbers = True
show_error_codes = True
show_error_code_links = True
strict_equality = True
warn_incomplete_stub = True
warn_redundant_casts = True
warn_return_any = True
warn_unreachable = True
warn_unused_ignores = True
49 changes: 2 additions & 47 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -109,40 +109,12 @@ repos:
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.14.1
hooks:
- id: mypy
alias: mypy-py313
name: MyPy, for Python 3.13
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest
- pytest_codspeed==3.0.0
- tomli # requirement of packaging/pep517_backend/
- types-setuptools # requirement of packaging/pep517_backend/
args:
- --python-version=3.13
- --txt-report=.tox/.tmp/.mypy/python-3.13
- --cobertura-xml-report=.tox/.tmp/.mypy/python-3.13
- --html-report=.tox/.tmp/.mypy/python-3.13
pass_filenames: false
- id: mypy
alias: mypy-py312
name: MyPy, for Python 3.12
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest
- pytest_codspeed==3.0.0
- tomli # requirement of packaging/pep517_backend/
- types-setuptools # requirement of packaging/pep517_backend/
args:
- --python-version=3.12
- --txt-report=.tox/.tmp/.mypy/python-3.12
- --cobertura-xml-report=.tox/.tmp/.mypy/python-3.12
- --html-report=.tox/.tmp/.mypy/python-3.12
pass_filenames: false
- id: mypy
alias: mypy-py311
name: MyPy, for Python 3.11
additional_dependencies:
- Cython
- expandvars
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest
- pytest_codspeed==3.0.0
@@ -156,23 +128,6 @@ repos:
- --cobertura-xml-report=.tox/.tmp/.mypy/python-3.11
- --html-report=.tox/.tmp/.mypy/python-3.11
pass_filenames: false
- id: mypy
alias: mypy-py39
name: MyPy, for Python 3.9
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest
- pytest_codspeed==3.0.0
- tomli # requirement of packaging/pep517_backend/
- types-setuptools # requirement of packaging/pep517_backend/
- types-Pygments
- types-colorama
args:
- --python-version=3.9
- --txt-report=.tox/.tmp/.mypy/python-3.9
- --cobertura-xml-report=.tox/.tmp/.mypy/python-3.9
- --html-report=.tox/.tmp/.mypy/python-3.9
pass_filenames: false

- repo: https://github.com/rhysd/actionlint.git
rev: v1.7.6
19 changes: 19 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -14,6 +14,25 @@ Changelog

.. towncrier release notes start
0.3.1
=====

*(2025-03-25)*


Bug fixes
---------

- Improved typing annotations, fixing some type errors under correct usage
and improving typing robustness generally -- by :user:`Dreamsorcerer`.

*Related issues and pull requests on GitHub:*
:issue:`103`.


----


0.3.0
=====

34 changes: 18 additions & 16 deletions packaging/pep517_backend/_backend.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
import os
import sysconfig
import typing as t
from collections.abc import Iterator
from contextlib import contextmanager, nullcontext, suppress
from functools import partial
from pathlib import Path
@@ -56,7 +57,7 @@
'get_requires_for_build_wheel',
'prepare_metadata_for_build_wheel',
*(
() if _setuptools_build_editable is None
() if _setuptools_build_editable is None # type: ignore[redundant-expr]
else (
'build_editable',
'get_requires_for_build_editable',
@@ -87,7 +88,7 @@
"""A fallback for ``pure-python`` is not set."""


def _is_truthy_setting_value(setting_value) -> bool:
def _is_truthy_setting_value(setting_value: str) -> bool:
truthy_values = {'', None, 'true', '1', 'on'}
return setting_value.lower() in truthy_values

@@ -108,7 +109,7 @@ def _get_setting_value(
continue

with suppress(lookup_errors): # type: ignore[arg-type]
return _is_truthy_setting_value(src_mapping[src_key]) # type: ignore[index]
return _is_truthy_setting_value(src_mapping[src_key]) # type: ignore[arg-type,index]

return default

@@ -125,7 +126,7 @@ def _make_pure_python(config_settings: _ConfigDict | None = None) -> bool:
def _include_cython_line_tracing(
config_settings: _ConfigDict | None = None,
*,
default=False,
default: bool = False,
) -> bool:
return _get_setting_value(
config_settings,
@@ -136,60 +137,61 @@ def _include_cython_line_tracing(


@contextmanager
def patched_distutils_cmd_install():
def patched_distutils_cmd_install() -> Iterator[None]:
"""Make `install_lib` of `install` cmd always use `platlib`.
:yields: None
"""
# Without this, build_lib puts stuff under `*.data/purelib/` folder
orig_finalize = _distutils_install_cmd.finalize_options

def new_finalize_options(self): # noqa: WPS430
def new_finalize_options(self: _distutils_install_cmd) -> None:
self.install_lib = self.install_platlib
orig_finalize(self)

_distutils_install_cmd.finalize_options = new_finalize_options
_distutils_install_cmd.finalize_options = new_finalize_options # type: ignore[method-assign]
try:
yield
finally:
_distutils_install_cmd.finalize_options = orig_finalize
_distutils_install_cmd.finalize_options = orig_finalize # type: ignore[method-assign]


@contextmanager
def patched_dist_has_ext_modules():
def patched_dist_has_ext_modules() -> Iterator[None]:
"""Make `has_ext_modules` of `Distribution` always return `True`.
:yields: None
"""
# Without this, build_lib puts stuff under `*.data/platlib/` folder
orig_func = _DistutilsDistribution.has_ext_modules

_DistutilsDistribution.has_ext_modules = lambda *args, **kwargs: True
_DistutilsDistribution.has_ext_modules = lambda *args, **kwargs: True # type: ignore[method-assign]
try:
yield
finally:
_DistutilsDistribution.has_ext_modules = orig_func
_DistutilsDistribution.has_ext_modules = orig_func # type: ignore[method-assign]


@contextmanager
def patched_dist_get_long_description():
def patched_dist_get_long_description() -> Iterator[None]:
"""Make `has_ext_modules` of `Distribution` always return `True`.
:yields: None
"""
# Without this, build_lib puts stuff under `*.data/platlib/` folder
_orig_func = _DistutilsDistributionMetadata.get_long_description

def _get_sanitized_long_description(self):
def _get_sanitized_long_description(self: _DistutilsDistributionMetadata) -> str:
assert self.long_description is not None
return sanitize_rst_roles(self.long_description)

_DistutilsDistributionMetadata.get_long_description = (
_DistutilsDistributionMetadata.get_long_description = ( # type: ignore[method-assign]
_get_sanitized_long_description
)
try:
yield
finally:
_DistutilsDistributionMetadata.get_long_description = _orig_func
_DistutilsDistributionMetadata.get_long_description = _orig_func # type: ignore[method-assign]


def _exclude_dir_path(
@@ -293,7 +295,7 @@ def maybe_prebuild_c_extensions(

cythonize_args = _make_cythonize_cli_args_from_config(config)
with _patched_cython_env(config['env'], cython_line_tracing_requested):
_cythonize_cli_cmd(cythonize_args)
_cythonize_cli_cmd(cythonize_args) # type: ignore[no-untyped-call]
with patched_distutils_cmd_install():
with patched_dist_has_ext_modules():
yield
23 changes: 9 additions & 14 deletions packaging/pep517_backend/_compat.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
"""Cross-python stdlib shims."""

import os
import typing as t
import sys
from collections.abc import Iterator
from contextlib import contextmanager
from pathlib import Path

# isort: off
try:
from contextlib import chdir as chdir_cm # type: ignore[attr-defined, unused-ignore] # noqa: E501
except ImportError:
if sys.version_info >= (3, 11):
from contextlib import chdir as chdir_cm
from tomllib import loads as load_toml_from_string
else:
from tomli import loads as load_toml_from_string

@contextmanager # type: ignore[no-redef, unused-ignore]
def chdir_cm(path: os.PathLike) -> t.Iterator[None]:
@contextmanager
def chdir_cm(path: os.PathLike) -> Iterator[None]:
"""Temporarily change the current directory, recovering on exit."""
original_wd = Path.cwd()
os.chdir(path)
@@ -22,12 +25,4 @@ def chdir_cm(path: os.PathLike) -> t.Iterator[None]:


# isort: on


try:
from tomllib import loads as load_toml_from_string
except ImportError:
from tomli import loads as load_toml_from_string


__all__ = ("chdir_cm", "load_toml_from_string") # noqa: WPS410
Loading