-readme = "README.md"
-# FIXME: use proper Unicode below when new `pip` comes out with a fix for
-# https://github.com/pypa/pip/pull/5482.
-authors = ["Lukasz Langa <lukasz@langa.pl>"]
-homepage = "https://github.com/ambv/black/"
-documentation = "https://black.readthedocs.io/en/stable/"
-license = "MIT"
-keywords = ["automation", "formatter", "yapf", "autopep8", "gofmt"]
-classifiers=[
- "Development Status :: 4 - Beta",
- "Environment :: Console",
- "Intended Audience :: Developers",
- "Operating System :: OS Independent",
- "Topic :: Software Development :: Libraries :: Python Modules",
- "Topic :: Software Development :: Quality Assurance",
+license = { text = "MIT" }
+requires-python = ">=3.8"
+authors = [
+ { name = "Łukasz Langa", email = "lukasz@langa.pl" },
+]
+keywords = [
+ "automation",
+ "autopep8",
+ "formatter",
+ "gofmt",
+ "pyfmt",
+ "rustfmt",
+ "yapf",
+]
+classifiers = [
+ "Development Status :: 5 - Production/Stable",
+ "Environment :: Console",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3 :: Only",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Topic :: Software Development :: Quality Assurance",
+]
+dependencies = [
+ "click>=8.0.0",
+ "mypy_extensions>=0.4.3",
+ "packaging>=22.0",
+ "pathspec>=0.9.0",
+ "platformdirs>=2",
+ "tomli>=1.1.0; python_version < '3.11'",
+ "typing_extensions>=3.10.0.0; python_version < '3.10'",
+]
+dynamic = ["readme", "version"]
+
+[project.optional-dependencies]
+colorama = ["colorama>=0.4.3"]
+uvloop = ["uvloop>=0.15.2"]
+d = [
+ "aiohttp>=3.7.4",
+]
+jupyter = [
+ "ipython>=7.8.0",
+ "tokenize-rt>=3.2.0",
+]
+
+[project.scripts]
+black = "black:patched_main"
+blackd = "blackd:patched_main [d]"
+
+[project.urls]
+Changelog = "https://github.com/psf/black/blob/main/CHANGES.md"
+Homepage = "https://github.com/psf/black"
+
+[tool.hatch.metadata.hooks.fancy-pypi-readme]
+content-type = "text/markdown"
+fragments = [
+ { path = "README.md" },
+ { path = "CHANGES.md" },
+]
+
+[tool.hatch.version]
+source = "vcs"
+
+[tool.hatch.build.hooks.vcs]
+version-file = "src/_black_version.py"
+template = '''
+version = "{version}"
+'''
+
+[tool.hatch.build.targets.sdist]
+exclude = ["/profiling"]
+
+[tool.hatch.build.targets.wheel]
+only-include = ["src"]
+sources = ["src"]
+
+[tool.hatch.build.targets.wheel.hooks.mypyc]
+enable-by-default = false
+dependencies = [
+ "hatch-mypyc>=0.16.0",
+ "mypy==1.3",
+ "click==8.1.3", # avoid https://github.com/pallets/click/issues/2558
+]
+require-runtime-dependencies = true
+exclude = [
+ # There's no good reason for blackd to be compiled.
+ "/src/blackd",
+ # Not performance sensitive, so save bytes + compilation time:
+ "/src/blib2to3/__init__.py",
+ "/src/blib2to3/pgen2/__init__.py",
+ "/src/black/output.py",
+ "/src/black/concurrency.py",
+ "/src/black/files.py",
+ "/src/black/report.py",
+ # Breaks the test suite when compiled (and is also useless):
+ "/src/black/debug.py",
+ # Compiled modules can't be run directly and that's a problem here:
+ "/src/black/__main__.py",