]> git.madduck.net Git - etc/vim.git/blob - pyproject.toml

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix parser bug where "type" was misinterpreted as a keyword inside a match (#3950)
[etc/vim.git] / pyproject.toml
1 # Example configuration for Black.
2
3 # NOTE: you have to use single-quoted strings in TOML for regular expressions.
4 # It's the equivalent of r-strings in Python.  Multiline strings are treated as
5 # verbose regular expressions by Black.  Use [ ] to denote a significant space
6 # character.
7
8 [tool.black]
9 line-length = 88
10 target-version = ['py37', 'py38']
11 include = '\.pyi?$'
12 extend-exclude = '''
13 /(
14   # The following are specific to Black, you probably don't want those.
15   tests/data
16   | profiling
17 )/
18 '''
19 # We use preview style for formatting Black itself. If you
20 # want stable formatting across releases, you should keep
21 # this off.
22 preview = true
23
24 # Build system information and other project-specific configuration below.
25 # NOTE: You don't need this in your own Black configuration.
26
27 [build-system]
28 requires = ["hatchling>=1.8.0", "hatch-vcs", "hatch-fancy-pypi-readme"]
29 build-backend = "hatchling.build"
30
31 [project]
32 name = "black"
33 description = "The uncompromising code formatter."
34 license = { text = "MIT" }
35 requires-python = ">=3.8"
36 authors = [
37   { name = "Łukasz Langa", email = "lukasz@langa.pl" },
38 ]
39 keywords = [
40   "automation",
41   "autopep8",
42   "formatter",
43   "gofmt",
44   "pyfmt",
45   "rustfmt",
46   "yapf",
47 ]
48 classifiers = [
49   "Development Status :: 5 - Production/Stable",
50   "Environment :: Console",
51   "Intended Audience :: Developers",
52   "License :: OSI Approved :: MIT License",
53   "Operating System :: OS Independent",
54   "Programming Language :: Python",
55   "Programming Language :: Python :: 3 :: Only",
56   "Programming Language :: Python :: 3.8",
57   "Programming Language :: Python :: 3.9",
58   "Programming Language :: Python :: 3.10",
59   "Programming Language :: Python :: 3.11",
60   "Programming Language :: Python :: 3.12",
61   "Topic :: Software Development :: Libraries :: Python Modules",
62   "Topic :: Software Development :: Quality Assurance",
63 ]
64 dependencies = [
65   "click>=8.0.0",
66   "mypy_extensions>=0.4.3",
67   "packaging>=22.0",
68   "pathspec>=0.9.0",
69   "platformdirs>=2",
70   "tomli>=1.1.0; python_version < '3.11'",
71   "typing_extensions>=4.0.1; python_version < '3.11'",
72 ]
73 dynamic = ["readme", "version"]
74
75 [project.optional-dependencies]
76 colorama = ["colorama>=0.4.3"]
77 uvloop = ["uvloop>=0.15.2"]
78 d = [
79   "aiohttp>=3.7.4",
80 ]
81 jupyter = [
82   "ipython>=7.8.0",
83   "tokenize-rt>=3.2.0",
84 ]
85
86 [project.scripts]
87 black = "black:patched_main"
88 blackd = "blackd:patched_main [d]"
89
90 [project.urls]
91 Changelog = "https://github.com/psf/black/blob/main/CHANGES.md"
92 Homepage = "https://github.com/psf/black"
93
94 [tool.hatch.metadata.hooks.fancy-pypi-readme]
95 content-type = "text/markdown"
96 fragments = [
97   { path = "README.md" },
98   { path = "CHANGES.md" },
99 ]
100
101 [tool.hatch.version]
102 source = "vcs"
103
104 [tool.hatch.build.hooks.vcs]
105 version-file = "src/_black_version.py"
106 template = '''
107 version = "{version}"
108 '''
109
110 [tool.hatch.build.targets.sdist]
111 exclude = ["/profiling"]
112
113 [tool.hatch.build.targets.wheel]
114 only-include = ["src"]
115 sources = ["src"]
116
117 [tool.hatch.build.targets.wheel.hooks.mypyc]
118 enable-by-default = false
119 dependencies = [
120   "hatch-mypyc>=0.16.0",
121   "mypy==1.5.1",
122   "click==8.1.3",  # avoid https://github.com/pallets/click/issues/2558
123 ]
124 require-runtime-dependencies = true
125 exclude = [
126   # There's no good reason for blackd to be compiled.
127   "/src/blackd",
128   # Not performance sensitive, so save bytes + compilation time:
129   "/src/blib2to3/__init__.py",
130   "/src/blib2to3/pgen2/__init__.py",
131   "/src/black/output.py",
132   "/src/black/concurrency.py",
133   "/src/black/files.py",
134   "/src/black/report.py",
135   # Breaks the test suite when compiled (and is also useless):
136   "/src/black/debug.py",
137   # Compiled modules can't be run directly and that's a problem here:
138   "/src/black/__main__.py",
139 ]
140 mypy-args = ["--ignore-missing-imports"]
141 options = { debug_level = "0" }
142
143 [tool.cibuildwheel]
144 build-verbosity = 1
145 # So these are the environments we target:
146 # - Python: CPython 3.8+ only
147 # - Architecture (64-bit only): amd64 / x86_64, universal2, and arm64
148 # - OS: Linux (no musl), Windows, and macOS
149 build = "cp3*"
150 skip = ["*-manylinux_i686", "*-musllinux_*", "*-win32", "pp*", "cp312-*"]
151 # This is the bare minimum needed to run the test suite. Pulling in the full
152 # test_requirements.txt would download a bunch of other packages not necessary
153 # here and would slow down the testing step a fair bit.
154 test-requires = ["pytest>=6.1.1"]
155 test-command = 'pytest {project} -k "not incompatible_with_mypyc"'
156 test-extras = ["d"," jupyter"]
157 # Skip trying to test arm64 builds on Intel Macs. (so cross-compilation doesn't
158 # straight up crash)
159 test-skip = ["*-macosx_arm64", "*-macosx_universal2:arm64"]
160
161 [tool.cibuildwheel.environment]
162 HATCH_BUILD_HOOKS_ENABLE = "1"
163 MYPYC_OPT_LEVEL = "3"
164 MYPYC_DEBUG_LEVEL = "0"
165 # CPython 3.11 wheels aren't available for aiohttp and building a Cython extension
166 # from source also doesn't work.
167 AIOHTTP_NO_EXTENSIONS = "1"
168
169 [tool.cibuildwheel.linux]
170 before-build = [
171     "yum install -y clang gcc",
172 ]
173
174 [tool.cibuildwheel.linux.environment]
175 HATCH_BUILD_HOOKS_ENABLE = "1"
176 MYPYC_OPT_LEVEL = "3"
177 MYPYC_DEBUG_LEVEL = "0"
178 # Black needs Clang to compile successfully on Linux.
179 CC = "clang"
180 AIOHTTP_NO_EXTENSIONS = "1"
181
182 [tool.isort]
183 atomic = true
184 profile = "black"
185 line_length = 88
186 skip_gitignore = true
187 skip_glob = ["tests/data", "profiling"]
188 known_first_party = ["black", "blib2to3", "blackd", "_black_version"]
189
190 [tool.pytest.ini_options]
191 # Option below requires `tests/optional.py`
192 addopts = "--strict-config --strict-markers"
193 optional-tests = [
194   "no_blackd: run when `d` extra NOT installed",
195   "no_jupyter: run when `jupyter` extra NOT installed",
196 ]
197 markers = [
198   "incompatible_with_mypyc: run when testing mypyc compiled black"
199 ]
200 xfail_strict = true
201 filterwarnings = [
202     "error",
203     # this is mitigated by a try/catch in https://github.com/psf/black/pull/2974/
204     # this ignore can be removed when support for aiohttp 3.7 is dropped.
205     '''ignore:Decorator `@unittest_run_loop` is no longer needed in aiohttp 3\.8\+:DeprecationWarning''',
206     # this is mitigated by a try/catch in https://github.com/psf/black/pull/3198/
207     # this ignore can be removed when support for aiohttp 3.x is dropped.
208     '''ignore:Middleware decorator is deprecated since 4\.0 and its behaviour is default, you can simply remove this decorator:DeprecationWarning''',
209     # aiohttp is using deprecated cgi modules - Safe to remove when fixed:
210     # https://github.com/aio-libs/aiohttp/issues/6905
211     '''ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning''',
212     # Work around https://github.com/pytest-dev/pytest/issues/10977 for Python 3.12
213     '''ignore:(Attribute s|Attribute n|ast.Str|ast.Bytes|ast.NameConstant|ast.Num) is deprecated and will be removed in Python 3.14:DeprecationWarning''',
214     # Will be fixed with aiohttp 3.9.0
215     # https://github.com/aio-libs/aiohttp/pull/7302
216     "ignore:datetime.*utcfromtimestamp\\(\\) is deprecated and scheduled for removal:DeprecationWarning",
217 ]
218 [tool.coverage.report]
219 omit = [
220   "src/blib2to3/*",
221   "tests/data/*",
222   "*/site-packages/*",
223   ".tox/*"
224 ]
225 [tool.coverage.run]
226 relative_files = true
227
228 [tool.mypy]
229 # Specify the target platform details in config, so your developers are
230 # free to run mypy on Windows, Linux, or macOS and get consistent
231 # results.
232 python_version = "3.8"
233 mypy_path = "src"
234 strict = true
235 # Unreachable blocks have been an issue when compiling mypyc, let's try to avoid 'em in the first place.
236 warn_unreachable = true
237 implicit_reexport = true
238 show_error_codes = true
239 show_column_numbers = true
240
241 [[tool.mypy.overrides]]
242 module = ["pathspec.*", "IPython.*", "colorama.*", "tokenize_rt.*", "uvloop.*", "_black_version.*"]
243 ignore_missing_imports = true
244
245 # CI only checks src/, but in case users are running LSP or similar we explicitly ignore
246 # errors in test data files.
247 [[tool.mypy.overrides]]
248 module = ["tests.data.*"]
249 ignore_errors = true