Skip to content

Commit 3b74dc4

Browse files
committed
Vendor attrs to avoid unpickle issues #3179 #3192
We have vendored attrs only for its use in licensedcode.models. With this, we avoid updates to the attrs library that would make unpickling the license index fail. Reported-by: Soim @soimkim Reference: #3192 Reference: #3179 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent b4f497c commit 3b74dc4

Some content is hidden

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

48 files changed

+6567
-38
lines changed

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ tomli==2.0.1
2929
tqdm==4.64.0
3030
twine==4.0.1
3131
typing_extensions==4.3.0
32+
vendorize==0.3.0
33+

setup-mini.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ testing =
130130
twine
131131
black
132132
isort
133+
vendorize >= 0.3.0
133134

134135
docs =
135136
Sphinx >= 3.3.1

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ testing =
130130
twine
131131
black
132132
isort
133+
vendorize >= 0.3.0
133134

134135
docs =
135136
Sphinx >= 3.3.1

src/licensedcode/_vendor/__init__.py

Whitespace-only changes.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
from __future__ import absolute_import, division, print_function
4+
5+
import sys
6+
7+
from functools import partial
8+
9+
from . import converters, exceptions, filters, setters, validators
10+
from ._cmp import cmp_using
11+
from ._config import get_run_validators, set_run_validators
12+
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
13+
from ._make import (
14+
NOTHING,
15+
Attribute,
16+
Factory,
17+
attrib,
18+
attrs,
19+
fields,
20+
fields_dict,
21+
make_class,
22+
validate,
23+
)
24+
from ._version_info import VersionInfo
25+
26+
27+
__version__ = "21.4.0"
28+
__version_info__ = VersionInfo._from_version_string(__version__)
29+
30+
__title__ = "attrs"
31+
__description__ = "Classes Without Boilerplate"
32+
__url__ = "https://www.attrs.org/"
33+
__uri__ = __url__
34+
__doc__ = __description__ + " <" + __uri__ + ">"
35+
36+
__author__ = "Hynek Schlawack"
37+
__email__ = "hs@ox.cx"
38+
39+
__license__ = "MIT"
40+
__copyright__ = "Copyright (c) 2015 Hynek Schlawack"
41+
42+
43+
s = attributes = attrs
44+
ib = attr = attrib
45+
dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)
46+
47+
__all__ = [
48+
"Attribute",
49+
"Factory",
50+
"NOTHING",
51+
"asdict",
52+
"assoc",
53+
"astuple",
54+
"attr",
55+
"attrib",
56+
"attributes",
57+
"attrs",
58+
"cmp_using",
59+
"converters",
60+
"evolve",
61+
"exceptions",
62+
"fields",
63+
"fields_dict",
64+
"filters",
65+
"get_run_validators",
66+
"has",
67+
"ib",
68+
"make_class",
69+
"resolve_types",
70+
"s",
71+
"set_run_validators",
72+
"setters",
73+
"validate",
74+
"validators",
75+
]
76+
77+
if sys.version_info[:2] >= (3, 6):
78+
from ._next_gen import define, field, frozen, mutable # noqa: F401
79+
80+
__all__.extend(("define", "field", "frozen", "mutable"))

0 commit comments

Comments
 (0)