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

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