-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
59 lines (49 loc) · 1.68 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import re
import io
import os
import sys
import json
import subprocess
from shutil import rmtree
from pathlib import Path
from setuptools.config import read_configuration
from setuptools import find_packages, setup, Command
from setuptools.command.install import install
from subprocess import check_call, check_output
import inspect
import os
current_dir = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
setup_cfg = read_configuration("setup.cfg")
metadata = setup_cfg['metadata']
NAME = metadata['name']
# What packages are required for this module to be executed?
REQUIRED = [
"click==8.1.3", "inquirer==3.4.0", "pyyaml", "pytest", "pudb"
]
here = os.path.abspath(os.path.dirname(__file__))
try:
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
except FileNotFoundError:
long_description = metadata['DESCRIPTION']
# Load the package's __version__.py module as a dictionary.
about = {}
if not metadata['version']:
project_slug = metadata['name'].lower().replace("-", "_").replace(" ", "_")
with open(os.path.join(here, project_slug, '__version__.py')) as f:
exec(f.read(), about)
else:
about['__version__'] = metadata['version']
# Where the magic happens:
setup(
version=about['__version__'],
long_description=long_description,
long_description_content_type='text/markdown',
install_requires=REQUIRED,
packages=find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
include_package_data=True,
)