-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
executable file
·49 lines (40 loc) · 1.49 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
#!/usr/bin/env python
# pylint: disable=invalid-name, missing-docstring
import os
import io
import importlib
from setuptools import setup, find_packages
_dir = os.path.abspath(os.path.dirname(__file__))
SRC = os.path.join(_dir, 'linuxdoc')
README = os.path.join(_dir, 'README.rst')
DOCS = os.path.join(_dir, 'docs')
TESTS = os.path.join(_dir, 'tests')
def load_source(modname, modpath):
spec = importlib.util.spec_from_file_location(modname, modpath)
if not spec:
raise ValueError("Error loading '%s' module" % modpath)
module = importlib.util.module_from_spec(spec)
if not spec.loader:
raise ValueError("Error loading '%s' module" % modpath)
spec.loader.exec_module(module)
return module
def readFile(fname, m='rt', enc='utf-8', nl=None):
with io.open(fname, mode=m, encoding=enc, newline=nl) as f:
return f.read()
PKG = load_source('__pkginfo__', os.path.join(SRC, '__pkginfo__.py'))
setup(
name = PKG.package
, version = PKG.version
, description = PKG.description
, long_description = readFile(README)
, url = PKG.url
, author = PKG.authors[0]
, author_email = PKG.emails[0]
, license = PKG.license
, keywords = PKG.keywords
, packages = ['linuxdoc']
, install_requires = PKG.install_requires
, entry_points = PKG.get_entry_points()
, classifiers = PKG.classifiers
, project_urls = PKG.project_urls
)