]> 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:

c37702616fc9cde0176da27c8f095fca5dc7b042
[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   | blib2to3
16   | tests/data
17   | profiling
18 )/
19 '''
20 # We use preview style for formatting Black itself. If you
21 # want stable formatting across releases, you should keep
22 # this off.
23 preview = true
24
25 # Build system information and other project-specific configuration below.
26 # NOTE: You don't need this in your own Black configuration.
27
28 [build-system]
29 requires = ["hatchling>=1.8.0", "hatch-vcs", "hatch-fancy-pypi-readme"]
30 build-backend = "hatchling.build"
31
32 [project]
33 name = "black"
34 description = "The uncompromising code formatter."
35 license = "MIT"
36 requires-python = ">=3.7"
37 authors = [
38   { name = "Łukasz Langa", email = "lukasz@langa.pl" },
39 ]
40 keywords = [
41   "automation",
42   "autopep8",
43   "formatter",
44   "gofmt",
45   "pyfmt",
46   "rustfmt",
47   "yapf",
48 ]
49 classifiers = [
50   "Development Status :: 5 - Production/Stable",
51   "Environment :: Console",
52   "Intended Audience :: Developers",
53   "License :: OSI Approved :: MIT License",
54   "Operating System :: OS Independent",
55   "Programming Language :: Python",
56   "Programming Language :: Python :: 3 :: Only",
57   "Programming Language :: Python :: 3.7",
58   "Programming Language :: Python :: 3.8",
59   "Programming Language :: Python :: 3.9",
60   "Programming Language :: Python :: 3.10",
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   "pathspec>=0.9.0",
68   "platformdirs>=2",
69   "tomli>=1.1.0; python_full_version < '3.11.0a7'",
70   "typed-ast>=1.4.2; python_version < '3.8' and implementation_name == 'cpython'",
71   "typing_extensions>=3.10.0.0; python_version < '3.10'",
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.13.0",
121   "mypy==0.971",
122   # Required stubs to be removed when the packages support PEP 561 themselves
123   "types-typed-ast>=1.4.2",
124 ]
125 require-runtime-dependencies = true
126 exclude = [
127   # There's no good reason for blackd to be compiled.
128   "/src/blackd",
129   # Not performance sensitive, so save bytes + compilation time:
130   "/src/blib2to3/__init__.py",
131   "/src/blib2to3/pgen2/__init__.py",
132   "/src/black/output.py",
133   "/src/black/concurrency.py",
134   "/src/black/files.py",
135   "/src/black/report.py",
136   # Breaks the test suite when compiled (and is also useless):
137   "/src/black/debug.py",
138   # Compiled modules can't be run directly and that's a problem here:
139   "/src/black/__main__.py",
140 ]
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.7+ 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-*"]
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 # The dependencies required to build wheels with mypyc aren't specified in
166 # [build-system].requires so we'll have to manage the build environment ourselves.
167 PIP_NO_BUILD_ISOLATION = "no"
168 # CPython 3.11 wheels aren't available for aiohttp and building a Cython extension
169 # from source also doesn't work.
170 AIOHTTP_NO_EXTENSIONS = "1"
171
172 [tool.cibuildwheel.linux]
173 before-build = [
174     "yum install -y clang gcc",
175 ]
176
177 [tool.cibuildwheel.linux.environment]
178 HATCH_BUILD_HOOKS_ENABLE = "1"
179 MYPYC_OPT_LEVEL = "3"
180 MYPYC_DEBUG_LEVEL = "0"
181 # Black needs Clang to compile successfully on Linux.
182 CC = "clang"
183 AIOHTTP_NO_EXTENSIONS = "1"
184
185 [tool.isort]
186 atomic = true
187 profile = "black"
188 line_length = 88
189 skip_gitignore = true
190 skip_glob = ["src/blib2to3", "tests/data", "profiling"]
191 known_first_party = ["black", "blib2to3", "blackd", "_black_version"]
192
193 [tool.pytest.ini_options]
194 # Option below requires `tests/optional.py`
195 addopts = "--strict-config --strict-markers"
196 optional-tests = [
197   "no_blackd: run when `d` extra NOT installed",
198   "no_jupyter: run when `jupyter` extra NOT installed",
199 ]
200 markers = [
201   "incompatible_with_mypyc: run when testing mypyc compiled black"
202 ]
203 xfail_strict = true
204 filterwarnings = [
205     "error",
206     # this is mitigated by a try/catch in https://github.com/psf/black/pull/2974/
207     # this ignore can be removed when support for aiohttp 3.7 is dropped.
208     '''ignore:Decorator `@unittest_run_loop` is no longer needed in aiohttp 3\.8\+:DeprecationWarning''',
209     # this is mitigated by a try/catch in https://github.com/psf/black/pull/3198/
210     # this ignore can be removed when support for aiohttp 3.x is dropped.
211     '''ignore:Middleware decorator is deprecated since 4\.0 and its behaviour is default, you can simply remove this decorator:DeprecationWarning''',
212     # this is mitigated by https://github.com/python/cpython/issues/79071 in python 3.8+
213     # this ignore can be removed when support for 3.7 is dropped.
214     '''ignore:Bare functions are deprecated, use async ones:DeprecationWarning''',
215     # aiohttp is using deprecated cgi modules - Safe to remove when fixed:
216     # https://github.com/aio-libs/aiohttp/issues/6905
217     '''ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning''',
218 ]