-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·91 lines (87 loc) · 3.06 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
89
90
91
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@||
''' # ||
--- # ||
<(META)>: # ||
docid: # ||
name: # ||
description: > # ||
expirary: <[expiration]> # ||
version: <[version]> # ||
authority: document|this # ||
security: sec|lvl2 # ||
<(WT)>: -32 # ||
''' # ||
# -*- coding: utf-8 -*-# ||
#==============================Core Modules=====================================||
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import codecs, io, os, re, sys
#===============================================================================||
here = os.path.abspath(os.path.dirname(__file__))
#===============================================================================||
version_file = open(os.path.join(here, '<[name]>', '__init__.py'), 'r')
__version__ = re.sub(r".*\b__version__\s+=\s+'([^']+)'.*", r'\1',
[line.strip() for line in version_file if '__version__' in line].pop(0))
version_file.close()
#===============================================================================||
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
buf.append(f.read())
return sep.join(buf)
short_description = """"""
try:
long_description = read('README.md')
except IOError:
long_description = "See README.md where installed."
class PyTest(TestCommand):
''' '''
def finalize_options(self):
''' '''
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
''' '''
import pytest
errcode = pytest.main(self.test_args)
sys.exit(errcode)
tests_require = [<[test_packages]>]
setup(name='<[name]>', version='0.1',
description='<[description]>',
url='<[url]>',
author='<[author]>',
author_email='<[author_email]>',
license='<[license]>',
tests_require=tests_require,
include_package_data=True,
install_requires=[<[requirements]>],
cmdclass={'test': PyTest},
namespace_packages=['<[name]>',],
packages=[<[packages]>], platforms='any', zip_safe=False,
classifiers=[<[classifiers]>],
extras_require={'testing': tests_require, })
#==============================Source Materials=================================||
'''
setuptools.setup(
name="example-pkg-your-username",
version="0.0.1",
author="Example Author",
author_email="[email protected]",
description="A small example package",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/pypa/sampleproject",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
)
'''
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@||