forked from mathsman5133/coc.py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (53 loc) · 2.13 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
import subprocess
from setuptools import setup, Command
REQUIREMENTS = []
with open(os.path.join(os.getcwd(), "requirements.txt")) as f:
REQUIREMENTS = f.read().splitlines()
VERSION = "2.0.1"
if "a" in VERSION:
VERSION += "+" + subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).decode("utf-8").strip()
README = ""
with open("README.rst") as f:
README = f.read()
class LintCommand(Command):
description = "Lint's the project code."
user_options = [("subcommands=", None, "input directory")]
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pylint = """python -m pylint coc
--disable=too-many-instance-attributes,too-many-public-methods,too-many-lines,too-few-public-methods,duplicate-code,bad-continuation,raise-missing-from
--max-line-length=120
--notes=fixme
--output-format=colorized
--ignore=examples,docs
--ignored-modules=aiohttp
"""
self.spawn(pylint.split())
self.spawn("python -m black --check --verbose --diff --line-length=120 --exclude=.pyi coc docs".split())
self.spawn("python -m flake8 coc --max-line-length=120 --exclude=coc/__init__.py".split())
self.spawn("sphinx-build -W docs/ /tmp/foo --keep-going -T".split())
setup(
name="coc.py",
author="mathsman5133",
url="https://github.com/mathsman5133/coc.py",
package_data={"coc": ["events.pyi"]},
packages=["coc", "coc.ext.discordlinks"],
version=VERSION,
license="MIT",
description="A python wrapper for the Clash of Clans API",
long_description=README,
python_requires=">=3.5.3",
install_requires=REQUIREMENTS,
include_package_data=True,
extras_require={"docs": ["sphinx", "sphinx_rtd_theme", "sphinxcontrib_trio", "autodocsumm"]},
classifiers={
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
},
cmdclass={"lint": LintCommand},
)