forked from fonttools/fontbakery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
183 lines (171 loc) · 5.74 KB
/
setup.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Copyright 2017 The Font Bakery Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# See AUTHORS.txt for the list of Authors and LICENSE.txt for the License.
from setuptools import setup
try:
readme = open("README.md", encoding="utf8").read()
except IOError:
readme = ""
FONTTOOLS_VERSION = ">=4.39.0" # Python 3.8+ required
UFO2FT_VERSION = ">=2.25.2" # 2.25.2 updated the script lists for Unicode 14.0
VHARFBUZZ_VERSION = ">=0.2.0" # 0.2.0 had an API update
# Profile-specific dependencies:
shaping_extras = [
"collidoscope>=0.5.2", # 0.5.2 added Python 3.11 wheels
# (see https://github.com/googlefonts/fontbakery/issues/3970)
"stringbrewer",
f"ufo2ft{UFO2FT_VERSION}",
f"vharfbuzz{VHARFBUZZ_VERSION}",
]
ufo_sources_extras = [
"defcon",
f"fontTools[ufo]{FONTTOOLS_VERSION}",
f"ufo2ft{UFO2FT_VERSION}",
"ufolint",
]
googlefonts_extras = (
[
"axisregistry>=0.3.0",
"beautifulsoup4", # For parsing registered vendor IDs from Microsoft's webpage
"dehinter>=3.1.0", # 3.1.0 added dehinter.font.hint function
"font-v",
f"fontTools[lxml,unicode]{FONTTOOLS_VERSION}",
"gflanguages>=0.3.0", # 0.3.0 had an api simplification/update
# (see https://github.com/googlefonts/gflanguages/pull/7)
"glyphsets>=0.5.0",
"protobuf>=3.7.0, <4", # 3.7.0 fixed a bug on parsing some METADATA.pb files.
# We cannot use v4 because our protobuf files have been compiled with v3.
# (see https://github.com/googlefonts/fontbakery/issues/2200)
f"vharfbuzz{VHARFBUZZ_VERSION}",
]
+ shaping_extras
+ ufo_sources_extras
)
iso15008_extras = [
"uharfbuzz",
]
fontval_extras = [
"lxml",
]
docs_extras = [
"recommonmark",
"sphinx >= 1.4",
"sphinx_rtd_theme",
]
all_extras = set(
docs_extras
+ fontval_extras
+ googlefonts_extras
+ iso15008_extras
+ shaping_extras
+ ufo_sources_extras
)
setup(
name="fontbakery",
use_scm_version={"write_to": "Lib/fontbakery/_version.py"},
url="https://github.com/googlefonts/fontbakery/",
description="A font quality assurance tool for everyone",
long_description=readme,
long_description_content_type="text/markdown",
author=(
"FontBakery authors and contributors:"
" Dave Crossland,"
" Felipe Sanches,"
" Lasse Fister,"
" Marc Foley,"
" Nikolaus Waxweiler,"
" Chris Simpkins,"
" Jens Kutilek,"
" Vitaly Volkov,"
" Simon Cozens,"
" Miguel Sousa"
),
author_email="juca@members.fsf.org",
package_dir={"": "Lib"},
packages=[
"fontbakery",
"fontbakery.reporters",
"fontbakery.profiles",
"fontbakery.commands",
],
package_data={"fontbakery": ["data/*.cache", "data/googlefonts/*_exceptions.txt"]},
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
python_requires=">=3.8",
setup_requires=[
"setuptools>=61.2",
"setuptools_scm[toml]>=6.2",
],
install_requires=[
# ---
# core dependencies
f"fontTools{FONTTOOLS_VERSION}",
"freetype-py!=2.4.0", # Avoiding 2.4.0 due to seg-fault described at
# https://github.com/googlefonts/fontbakery/issues/4143
"opentypespec",
"opentype-sanitizer>=7.1.9", # 7.1.9 fixes caret value format = 3 bug
# (see https://github.com/khaledhosny/ots/pull/182)
# ---
# fontTools extra that is needed by 'interpolation_issues' check in
# Universal profile
"munkres",
# ---
# for parsing Configuration files (Lib/fontbakery/configuration.py)
"PyYAML",
"toml",
# ---
# used by Reporters (Lib/fontbakery/reporters)
"cmarkgfm", # (html.py)
"rich", # (terminal.py)
# ---
# used by 'fontbakery_version' check in Universal profile
"packaging",
"pip-api",
"requests", # also used by Google Fonts profile
# ---
# used by 'italic_angle' check in OpenType profile ('post' table);
# also used by ISO 15008 profile
"beziers>=0.5.0", # 0.5.0 uses new fontTools glyph outline access
# ---
],
extras_require={
"all": all_extras,
"docs": docs_extras,
"fontval": fontval_extras,
"fontwerk": googlefonts_extras,
"googlefonts": googlefonts_extras,
"notofonts": googlefonts_extras,
"iso15008": iso15008_extras,
"shaping": shaping_extras,
"ufo-sources": ufo_sources_extras,
},
entry_points={
"console_scripts": ["fontbakery=fontbakery.cli:main"],
},
# TODO: review this and make it cross-platform:
# data_files=[
# ('/etc/bash_completion.d', ['snippets/fontbakery.bash-completion']),
# ]
)