Skip to content

Commit

Permalink
Migrate to using propcache for property caching (#1169)
Browse files Browse the repository at this point in the history
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
  • Loading branch information
bdraco and webknjaz authored Oct 8, 2024
1 parent 31c9fee commit 4f35eda
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 208 deletions.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ body:
$ python -m pip show multidict
validations:
required: true
- type: textarea
attributes:
label: propcache Version
description: Attach your version of propcache.
render: console
value: |
$ python -m pip show propcache
validations:
required: true
- type: textarea
attributes:
label: yarl Version
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ repos:
- hypothesis
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- multidict
- propcache >= 0.2.0
- pytest
- tomli # requirement of packaging/pep517_backend/
- types-setuptools # requirement of packaging/pep517_backend/
Expand All @@ -132,6 +133,7 @@ repos:
- hypothesis
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- multidict
- propcache >= 0.2.0
- pytest
- tomli # requirement of packaging/pep517_backend/
- types-setuptools # requirement of packaging/pep517_backend/
Expand All @@ -148,6 +150,7 @@ repos:
- hypothesis
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- multidict
- propcache >= 0.2.0
- pytest
- tomli # requirement of packaging/pep517_backend/
- types-setuptools # requirement of packaging/pep517_backend/
Expand All @@ -166,6 +169,7 @@ repos:
- hypothesis
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- multidict
- propcache >= 0.2.0
- pytest
- tomli # requirement of packaging/pep517_backend/
- types-setuptools # requirement of packaging/pep517_backend/
Expand Down
6 changes: 6 additions & 0 deletions CHANGES/1169.packaging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Switched to using the :mod:`propcache <propcache.api>` package for property caching
-- by :user:`bdraco`.

The :mod:`propcache <propcache.api>` package is derived from the property caching
code in :mod:`yarl` and has been broken out to avoid maintaining it for multiple
projects.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ by this variable.
Dependencies
------------

YARL requires multidict_ library.
YARL requires multidict_ and propcache_ libraries.


API documentation
Expand Down Expand Up @@ -203,3 +203,5 @@ It's *Apache 2* licensed and freely available.
.. _GitHub: https://github.com/aio-libs/yarl

.. _multidict: https://github.com/aio-libs/multidict

.. _propcache: https://github.com/aio-libs/propcache
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"multidict": ("https://multidict.aio-libs.org/en/stable", None),
"propcache": ("https://propcache.aio-libs.org/en/stable", None),
}


Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ by this variable.
Dependencies
------------

``yarl`` requires :mod:`multidict` library.
``yarl`` requires the :mod:`multidict` and :mod:`propcache <propcache.api>` libraries.

It installs it automatically.

Expand Down
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ covdefaults
hypothesis>=6.0
idna==3.10
multidict==6.1.0
propcache==0.2.0
pytest==8.3.3
pytest-cov>=2.3.1
pytest-xdist
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ include_package_data = True
install_requires =
idna >= 2.0
multidict >= 4.0
propcache >= 0.2.0

[options.package_data]
# Ref:
Expand Down
91 changes: 0 additions & 91 deletions tests/test_helpers.py

This file was deleted.

31 changes: 0 additions & 31 deletions yarl/_helpers.py

This file was deleted.

6 changes: 0 additions & 6 deletions yarl/_helpers_c.pyi

This file was deleted.

36 changes: 0 additions & 36 deletions yarl/_helpers_c.pyx

This file was deleted.

41 changes: 0 additions & 41 deletions yarl/_helpers_py.py

This file was deleted.

2 changes: 1 addition & 1 deletion yarl/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

import idna
from multidict import MultiDict, MultiDictProxy, istr
from propcache.api import under_cached_property as cached_property

from ._helpers import cached_property
from ._quoting import _Quoter, _Unquoter

DEFAULT_PORTS = {"http": 80, "https": 443, "ws": 80, "wss": 443, "ftp": 21}
Expand Down

0 comments on commit 4f35eda

Please sign in to comment.