Skip to content

Commit 740c3c0

Browse files
authored
Vendor in latest packages available (#5657)
* Update to the latest vendoring package versions available. * add news fragment * fix vendoring CI
1 parent 4ce2d98 commit 740c3c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2254
-1351
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
api_key: ${{ secrets.FORESIGHT_API_KEY }}
7878
- run: |
79-
python -m pip install --upgrade wheel invoke parver beautifulsoup4 vistir towncrier requests parse
79+
python -m pip install --upgrade wheel invoke parver beautifulsoup4 vistir towncrier requests parse hatch-fancy-pypi-readme
8080
python -m invoke vendoring.update
8181
tests:
8282
name: ${{matrix.os}} / ${{ matrix.python-version }}

news/5657.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Vendor in latest available dependencies: ``attrs==23.1.0`` ``click-didyoumean==0.3.0`` ``click==8.1.3`` ``markupsafe==2.1.2`` ``pipdeptree==2.7.0`` ``shellingham==1.5.0.post1`` ``tomlkit==0.11.7``

pipenv/vendor/attr/__init__.py

Lines changed: 74 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# SPDX-License-Identifier: MIT
22

3-
4-
import sys
3+
"""
4+
Classes Without Boilerplate
5+
"""
56

67
from functools import partial
8+
from typing import Callable
79

810
from . import converters, exceptions, filters, setters, validators
911
from ._cmp import cmp_using
@@ -20,31 +22,22 @@
2022
make_class,
2123
validate,
2224
)
25+
from ._next_gen import define, field, frozen, mutable
2326
from ._version_info import VersionInfo
2427

2528

26-
__version__ = "22.1.0"
27-
__version_info__ = VersionInfo._from_version_string(__version__)
28-
29-
__title__ = "attrs"
30-
__description__ = "Classes Without Boilerplate"
31-
__url__ = "https://www.attrs.org/"
32-
__uri__ = __url__
33-
__doc__ = __description__ + " <" + __uri__ + ">"
34-
35-
__author__ = "Hynek Schlawack"
36-
__email__ = "hs@ox.cx"
37-
38-
__license__ = "MIT"
39-
__copyright__ = "Copyright (c) 2015 Hynek Schlawack"
40-
41-
4229
s = attributes = attrs
4330
ib = attr = attrib
4431
dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)
4532

33+
34+
class AttrsInstance:
35+
pass
36+
37+
4638
__all__ = [
4739
"Attribute",
40+
"AttrsInstance",
4841
"Factory",
4942
"NOTHING",
5043
"asdict",
@@ -56,15 +49,19 @@
5649
"attrs",
5750
"cmp_using",
5851
"converters",
52+
"define",
5953
"evolve",
6054
"exceptions",
55+
"field",
6156
"fields",
6257
"fields_dict",
6358
"filters",
59+
"frozen",
6460
"get_run_validators",
6561
"has",
6662
"ib",
6763
"make_class",
64+
"mutable",
6865
"resolve_types",
6966
"s",
7067
"set_run_validators",
@@ -73,7 +70,63 @@
7370
"validators",
7471
]
7572

76-
if sys.version_info[:2] >= (3, 6):
77-
from ._next_gen import define, field, frozen, mutable # noqa: F401
7873

79-
__all__.extend(("define", "field", "frozen", "mutable"))
74+
def _make_getattr(mod_name: str) -> Callable:
75+
"""
76+
Create a metadata proxy for packaging information that uses *mod_name* in
77+
its warnings and errors.
78+
"""
79+
80+
def __getattr__(name: str) -> str:
81+
dunder_to_metadata = {
82+
"__title__": "Name",
83+
"__copyright__": "",
84+
"__version__": "version",
85+
"__version_info__": "version",
86+
"__description__": "summary",
87+
"__uri__": "",
88+
"__url__": "",
89+
"__author__": "",
90+
"__email__": "",
91+
"__license__": "license",
92+
}
93+
if name not in dunder_to_metadata.keys():
94+
raise AttributeError(f"module {mod_name} has no attribute {name}")
95+
96+
import sys
97+
import warnings
98+
99+
if sys.version_info < (3, 8):
100+
from importlib_metadata import metadata
101+
else:
102+
from importlib.metadata import metadata
103+
104+
if name != "__version_info__":
105+
warnings.warn(
106+
f"Accessing {mod_name}.{name} is deprecated and will be "
107+
"removed in a future release. Use importlib.metadata directly "
108+
"to query for attrs's packaging metadata.",
109+
DeprecationWarning,
110+
stacklevel=2,
111+
)
112+
113+
meta = metadata("attrs")
114+
if name == "__license__":
115+
return "MIT"
116+
elif name == "__copyright__":
117+
return "Copyright (c) 2015 Hynek Schlawack"
118+
elif name in ("__uri__", "__url__"):
119+
return meta["Project-URL"].split(" ", 1)[-1]
120+
elif name == "__version_info__":
121+
return VersionInfo._from_version_string(meta["version"])
122+
elif name == "__author__":
123+
return meta["Author-email"].rsplit(" ", 1)[0]
124+
elif name == "__email__":
125+
return meta["Author-email"].rsplit("<", 1)[1][:-1]
126+
127+
return meta[dunder_to_metadata[name]]
128+
129+
return __getattr__
130+
131+
132+
__getattr__ = _make_getattr(__name__)

0 commit comments

Comments
 (0)