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

2d8da88f6c69de2d24267a4aaa230e987cf5728a
[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 = { text = "MIT" }
36 requires-python = ">=3.8"
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   "Programming Language :: Python :: 3.11",
62   "Topic :: Software Development :: Libraries :: Python Modules",
63   "Topic :: Software Development :: Quality Assurance",
64 ]
65 dependencies = [
66   "click>=8.0.0",
67   "mypy_extensions>=0.4.3",
68   "packaging>=22.0",
69   "pathspec>=0.9.0",
70   "platformdirs>=2",
71   "tomli>=1.1.0; python_version < '3.11'",
72   "typing_extensions>=3.10.0.0; python_version < '3.10'",
73 ]
74 dynamic = ["readme", "version"]
75
76 [project.optional-dependencies]
77 colorama = ["colorama>=0.4.3"]
78 uvloop = ["uvloop>=0.15.2"]
79 d = [
80   "aiohttp>=3.7.4",
81 ]
82 jupyter = [
83   "ipython>=7.8.0",
84   "tokenize-rt>=3.2.0",
85 ]
86
87 [project.scripts]
88 black = "black:patched_main"
89 blackd = "blackd:patched_main [d]"
90
91 [project.urls]
92 Changelog = "https://github.com/psf/black/blob/main/CHANGES.md"
93 Homepage = "https://github.com/psf/black"
94
95 [tool.hatch.metadata.hooks.fancy-pypi-readme]
96 content-type = "text/markdown"
97 fragments = [
98   { path = "README.md" },
99   { path = "CHANGES.md" },
100 ]
101
102 [tool.hatch.version]
103 source = "vcs"
104
105 [tool.hatch.build.hooks.vcs]
106 version-file = "src/_black_version.py"
107 template = '''
108 version = "{version}"
109 '''
110
111 [tool.hatch.build.targets.sdist]
112 exclude = ["/profiling"]
113
114 [tool.hatch.build.targets.wheel]
115 only-include = ["src"]
116 sources = ["src"]
117
118 [tool.hatch.build.targets.wheel.hooks.mypyc]
119 enable-by-default = false
120 dependencies = [
121   "hatch-mypyc>=0.16.0",
122   "mypy==1.3",
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 options = { debug_level = "0" }
141
142 [tool.cibuildwheel]
143 build-verbosity = 1
144 # So these are the environments we target:
145 # - Python: CPython 3.8+ only
146 # - Architecture (64-bit only): amd64 / x86_64, universal2, and arm64
147 # - OS: Linux (no musl), Windows, and macOS
148 build = "cp3*-*"
149 skip = ["*-manylinux_i686", "*-musllinux_*", "*-win32", "pp-*"]
150 # This is the bare minimum needed to run the test suite. Pulling in the full
151 # test_requirements.txt would download a bunch of other packages not necessary
152 # here and would slow down the testing step a fair bit.
153 test-requires = ["pytest>=6.1.1"]
154 test-command = 'pytest {project} -k "not incompatible_with_mypyc"'
155 test-extras = ["d"," jupyter"]
156 # Skip trying to test arm64 builds on Intel Macs. (so cross-compilation doesn't
157 # straight up crash)
158 test-skip = ["*-macosx_arm64", "*-macosx_universal2:arm64"]
159
160 [tool.cibuildwheel.environment]
161 HATCH_BUILD_HOOKS_ENABLE = "1"
162 MYPYC_OPT_LEVEL = "3"
163 MYPYC_DEBUG_LEVEL = "0"
164 # CPython 3.11 wheels aren't available for aiohttp and building a Cython extension
165 # from source also doesn't work.
166 AIOHTTP_NO_EXTENSIONS = "1"
167
168 [tool.cibuildwheel.linux]
169 before-build = [
170     "yum install -y clang gcc",
171 ]
172
173 [tool.cibuildwheel.linux.environment]
174 HATCH_BUILD_HOOKS_ENABLE = "1"
175 MYPYC_OPT_LEVEL = "3"
176 MYPYC_DEBUG_LEVEL = "0"
177 # Black needs Clang to compile successfully on Linux.
178 CC = "clang"
179 AIOHTTP_NO_EXTENSIONS = "1"
180
181 [tool.isort]
182 atomic = true
183 profile = "black"
184 line_length = 88
185 skip_gitignore = true
186 skip_glob = ["src/blib2to3", "tests/data", "profiling"]
187 known_first_party = ["black", "blib2to3", "blackd", "_black_version"]
188
189 [tool.pytest.ini_options]
190 # Option below requires `tests/optional.py`
191 addopts = "--strict-config --strict-markers"
192 optional-tests = [
193   "no_blackd: run when `d` extra NOT installed",
194   "no_jupyter: run when `jupyter` extra NOT installed",
195 ]
196 markers = [
197   "incompatible_with_mypyc: run when testing mypyc compiled black"
198 ]
199 xfail_strict = true
200 filterwarnings = [
201     "error",
202     # this is mitigated by a try/catch in https://github.com/psf/black/pull/2974/
203     # this ignore can be removed when support for aiohttp 3.7 is dropped.
204     '''ignore:Decorator `@unittest_run_loop` is no longer needed in aiohttp 3\.8\+:DeprecationWarning''',
205     # this is mitigated by a try/catch in https://github.com/psf/black/pull/3198/
206     # this ignore can be removed when support for aiohttp 3.x is dropped.
207     '''ignore:Middleware decorator is deprecated since 4\.0 and its behaviour is default, you can simply remove this decorator:DeprecationWarning''',
208     # aiohttp is using deprecated cgi modules - Safe to remove when fixed:
209     # https://github.com/aio-libs/aiohttp/issues/6905
210     '''ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning''',
211     # Work around https://github.com/pytest-dev/pytest/issues/10977 for Python 3.12
212     '''ignore:(Attribute s|Attribute n|ast.Str|ast.Bytes|ast.NameConstant|ast.Num) is deprecated and will be removed in Python 3.14:DeprecationWarning'''
213 ]