-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py
79 lines (70 loc) · 3.04 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# ============================
# > Project definition & setup
# ============================
import dataclasses
import platform
import sys
from operator import attrgetter
from typing import List, Optional
if sys.version_info >= (3, 8):
from typing import Final
else:
from typing_extensions import Final
@dataclasses.dataclass
class Project:
name: str
url: str
custom_arguments: List[str] = dataclasses.field(default_factory=list)
python_requires: Optional[str] = None
commit: Optional[str] = None
@property
def supported_by_runtime(self) -> bool:
from packaging.specifiers import SpecifierSet
if self.python_requires is None:
return True
return SpecifierSet(self.python_requires).contains(platform.python_version())
PROJECTS: Final = [
Project("aioexabgp", "https://github.com/cooperlees/aioexabgp.git"),
Project("attrs", "https://github.com/python-attrs/attrs.git"),
Project("bandersnatch", "https://github.com/pypa/bandersnatch.git"),
Project("blackbench", "https://github.com/ichard26/blackbench.git"),
Project("channel", "https://github.com/django/channels.git"),
Project("diff-shades", "https://github.com/ichard26/diff-shades.git"),
Project(
"django",
"https://github.com/django/django.git",
custom_arguments=[
"--skip-string-normalization",
"--extend-exclude",
(
"/((docs|scripts)/|django/forms/models.py"
"|tests/gis_tests/test_spatialrefsys.py"
"|tests/test_runner_apps/tagged/tests_syntax_error.py)"
),
],
python_requires=">=3.8",
),
Project("flake8-bugbear", "https://github.com/PyCQA/flake8-bugbear.git"),
Project("hypothesis", "https://github.com/HypothesisWorks/hypothesis.git"),
Project("pandas", "https://github.com/pandas-dev/pandas.git"),
Project("pillow", "https://github.com/python-pillow/Pillow.git"),
Project("poetry", "https://github.com/python-poetry/poetry.git"),
Project("ptr", "https://github.com/facebookincubator/ptr.git"),
Project("pyanalyze", "https://github.com/quora/pyanalyze.git"),
Project("pyramid", "https://github.com/Pylons/pyramid.git"),
Project("pytest", "https://github.com/pytest-dev/pytest.git"),
Project(
"scikit-lego",
"https://github.com/koaning/scikit-lego.git",
# Uses Python 3.12+ f-string syntax, not yet supported by Black
custom_arguments=["--extend-exclude", "/docs/_scripts/feature-selection.py"],
),
Project("sqlalchemy", "https://github.com/sqlalchemy/sqlalchemy.git"),
Project("tox", "https://github.com/tox-dev/tox.git"),
Project("typeshed", "https://github.com/python/typeshed.git"),
Project("virtualenv", "https://github.com/pypa/virtualenv.git"),
Project("warehouse", "https://github.com/pypa/warehouse.git"),
]
assert PROJECTS == sorted(PROJECTS, key=attrgetter("name")), "PROJECTS is not sorted"
for p in PROJECTS:
assert p.name == p.name.casefold(), f"project name '{p.name}' wasn't casefolded"