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.
1 # Copyright (C) 2018 Łukasz Langa
2 from setuptools import setup
6 assert sys.version_info >= (3, 6, 0), "black requires Python 3.6+"
7 from pathlib import Path # noqa E402
9 CURRENT_DIR = Path(__file__).parent
10 sys.path.insert(0, str(CURRENT_DIR)) # for setuptools.build_meta
13 def get_long_description() -> str:
15 (CURRENT_DIR / "README.md").read_text(encoding="utf8")
17 + (CURRENT_DIR / "CHANGES.md").read_text(encoding="utf8")
22 # To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH
23 if len(sys.argv) > 1 and sys.argv[1] == "--use-mypyc":
26 if os.getenv("BLACK_USE_MYPYC", None) == "1":
34 "blib2to3/pgen2/parse.py",
35 "blib2to3/pgen2/grammar.py",
36 "blib2to3/pgen2/token.py",
37 "blib2to3/pgen2/driver.py",
38 "blib2to3/pgen2/pgen.py",
41 from mypyc.build import mypycify
43 opt_level = os.getenv("MYPYC_OPT_LEVEL", "3")
44 ext_modules = mypycify(mypyc_targets, opt_level=opt_level)
51 "write_to": "_black_version.py",
52 "write_to_template": 'version = "{version}"\n',
54 description="The uncompromising code formatter.",
55 long_description=get_long_description(),
56 long_description_content_type="text/markdown",
57 keywords="automation formatter yapf autopep8 pyfmt gofmt rustfmt",
58 author="Łukasz Langa",
59 author_email="lukasz@langa.pl",
60 url="https://github.com/psf/black",
62 py_modules=["black", "blackd", "_black_version"],
63 ext_modules=ext_modules,
64 packages=["blib2to3", "blib2to3.pgen2"],
65 package_data={"blib2to3": ["*.txt"]},
66 python_requires=">=3.6",
76 "dataclasses>=0.6; python_version < '3.7'",
77 "typing_extensions>=3.7.4",
78 "mypy_extensions>=0.4.3",
80 extras_require={"d": ["aiohttp>=3.3.2", "aiohttp-cors"]},
81 test_suite="tests.test_black",
83 "Development Status :: 4 - Beta",
84 "Environment :: Console",
85 "Intended Audience :: Developers",
86 "License :: OSI Approved :: MIT License",
87 "Operating System :: OS Independent",
88 "Programming Language :: Python",
89 "Programming Language :: Python :: 3.6",
90 "Programming Language :: Python :: 3.7",
91 "Programming Language :: Python :: 3.8",
92 "Programming Language :: Python :: 3 :: Only",
93 "Topic :: Software Development :: Libraries :: Python Modules",
94 "Topic :: Software Development :: Quality Assurance",
98 "black=black:patched_main",
99 "blackd=blackd:patched_main [d]",