]> git.madduck.net Git - etc/vim.git/blob - setup.py

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:

f0b727c205bd8ae9bac44fcbd3cd8244a9ae4ed2
[etc/vim.git] / setup.py
1 # Copyright (C) 2018 Łukasz Langa
2 from setuptools import setup
3 import sys
4 import os
5
6 assert sys.version_info >= (3, 6, 0), "black requires Python 3.6+"
7 from pathlib import Path  # noqa E402
8
9 CURRENT_DIR = Path(__file__).parent
10 sys.path.insert(0, str(CURRENT_DIR))  # for setuptools.build_meta
11
12
13 def get_long_description() -> str:
14     readme_md = CURRENT_DIR / "README.md"
15     with open(readme_md, encoding="utf8") as ld_file:
16         return ld_file.read()
17
18
19 USE_MYPYC = False
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":
22     sys.argv.pop(1)
23     USE_MYPYC = True
24 if os.getenv("BLACK_USE_MYPYC", None) == "1":
25     USE_MYPYC = True
26
27 if USE_MYPYC:
28     mypyc_targets = [
29         "black.py",
30         "blib2to3/pytree.py",
31         "blib2to3/pygram.py",
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",
37     ]
38
39     from mypyc.build import mypycify
40
41     opt_level = os.getenv("MYPYC_OPT_LEVEL", "3")
42     ext_modules = mypycify(mypyc_targets, opt_level=opt_level)
43 else:
44     ext_modules = []
45
46 setup(
47     name="black",
48     use_scm_version={
49         "write_to": "_black_version.py",
50         "write_to_template": 'version = "{version}"\n',
51     },
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",
59     license="MIT",
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",
65     zip_safe=False,
66     install_requires=[
67         "click>=6.5",
68         "attrs>=18.1.0",
69         "appdirs",
70         "toml>=0.9.4",
71         "typed-ast>=1.4.0",
72         "regex>=2020.1.8",
73         "pathspec>=0.6, <1",
74         "dataclasses>=0.6; python_version < '3.7'",
75         "typing_extensions>=3.7.4",
76         "mypy_extensions>=0.4.3",
77     ],
78     extras_require={"d": ["aiohttp>=3.3.2", "aiohttp-cors"]},
79     test_suite="tests.test_black",
80     classifiers=[
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",
93     ],
94     entry_points={
95         "console_scripts": [
96             "black=black:patched_main",
97             "blackd=blackd:patched_main [d]",
98         ]
99     },
100 )