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:
14 readme_md = CURRENT_DIR / "README.md"
15 with open(readme_md, encoding="utf8") as ld_file:
20 # To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH
21 if len(sys.argv) > 1 and sys.argv[1] == "--use-mypyc":
24 if os.getenv("BLACK_USE_MYPYC", None) == "1":
32 "blib2to3/pgen2/parse.py",
33 "blib2to3/pgen2/grammar.py",
34 "blib2to3/pgen2/token.py",
35 "blib2to3/pgen2/driver.py",
36 "blib2to3/pgen2/pgen.py",
39 from mypyc.build import mypycify
41 opt_level = os.getenv("MYPYC_OPT_LEVEL", "3")
42 ext_modules = mypycify(mypyc_targets, opt_level=opt_level)
49 "write_to": "_black_version.py",
50 "write_to_template": 'version = "{version}"\n',
52 description="The uncompromising code formatter.",
53 long_description=get_long_description(),
54 long_description_content_type="text/markdown",
55 keywords="automation formatter yapf autopep8 pyfmt gofmt rustfmt",
56 author="Łukasz Langa",
57 author_email="lukasz@langa.pl",
58 url="https://github.com/psf/black",
60 py_modules=["black", "blackd", "_black_version"],
61 ext_modules=ext_modules,
62 packages=["blib2to3", "blib2to3.pgen2"],
63 package_data={"blib2to3": ["*.txt"]},
64 python_requires=">=3.6",
74 "dataclasses>=0.6; python_version < '3.7'",
75 "typing_extensions>=3.7.4",
76 "mypy_extensions>=0.4.3",
78 extras_require={"d": ["aiohttp>=3.3.2", "aiohttp-cors"]},
79 test_suite="tests.test_black",
81 "Development Status :: 4 - Beta",
82 "Environment :: Console",
83 "Intended Audience :: Developers",
84 "License :: OSI Approved :: MIT License",
85 "Operating System :: OS Independent",
86 "Programming Language :: Python",
87 "Programming Language :: Python :: 3.6",
88 "Programming Language :: Python :: 3.7",
89 "Programming Language :: Python :: 3.8",
90 "Programming Language :: Python :: 3 :: Only",
91 "Topic :: Software Development :: Libraries :: Python Modules",
92 "Topic :: Software Development :: Quality Assurance",
96 "black=black:patched_main",
97 "blackd=blackd:patched_main [d]",