forked from terrencepreilly/darglint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
88 lines (68 loc) · 2.34 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
"""Defines the package, tests, and dependencies."""
import os
from setuptools import setup, find_packages, Command
import subprocess
def read_full_documentation(fname):
"""Get long documentation from the README.rst.
Args:
fname: The filename for the documentation.
Returns:
The documentation, as a string.
"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
requirements = []
class CleanCommand(Command):
"""Cleans the project.
- Remove the dist directory.
- Remove the build directory.
"""
description = 'Clean the directory of build artifacts'
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
assert os.getcwd() == self.cwd, 'We must be in the package root.'
subprocess.run(['rm', '-rf', './dist'])
subprocess.run(['rm', '-rf', './build'])
flake8_entry_point = 'flake8.extension'
setup(
name="darglint",
version="1.1.3",
author="Terrence Reilly",
author_email="terrencepreilly@gmail.com",
description=("A utility for ensuring Google-style docstrings "
"stay up to date with the source code."),
license="MIT",
keywords="documentation linter development",
url="http://github.com/terrencepreilly/darglint",
packages=find_packages(exclude=('tests', 'docs')),
long_description=read_full_documentation('README.md'),
long_description_content_type="text/markdown",
entry_points={
'console_scripts': [
'darglint = darglint.driver:main',
],
flake8_entry_point: [
'DAR = darglint.flake8_entry:DarglintChecker',
],
},
install_requires=requirements,
setup_requires=requirements,
tests_require=['pytest', 'tox'] + requirements,
python_requires='>=3.5',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Documentation',
'Topic :: Software Development :: Quality Assurance',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.5',
],
cmdclass={
'clean': CleanCommand,
},
)