Skip to content

Commit b0540fe

Browse files
committed
setup.py added.
1 parent 5e5a3cb commit b0540fe

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

setup.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env python
2+
3+
import pathlib
4+
import setuptools.command.test
5+
import sys
6+
from setuptools import setup, find_packages
7+
8+
requirements = [
9+
'tzlocal~=2.0',
10+
]
11+
12+
test_requirements = [
13+
'pytest~=6.0',
14+
]
15+
16+
with open('README.rst', 'r') as file:
17+
readme = file.read()
18+
19+
20+
def parse_about():
21+
about_globals = {}
22+
this_path = pathlib.Path(__file__).parent
23+
about_module_text = pathlib.Path(this_path, 'crontools', '__about__.py').read_text()
24+
exec(about_module_text, about_globals)
25+
26+
return about_globals
27+
28+
29+
about = parse_about()
30+
31+
32+
class PyTest(setuptools.command.test.test):
33+
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
34+
35+
def initialize_options(self):
36+
setuptools.command.test.test.initialize_options(self)
37+
self.pytest_args = []
38+
39+
def run_tests(self):
40+
import pytest
41+
sys.exit(pytest.main(self.pytest_args))
42+
43+
44+
setup(
45+
name=about['__title__'],
46+
version=about['__version__'],
47+
description=about['__description__'],
48+
long_description=readme,
49+
author=about['__author__'],
50+
author_email=about['__email__'],
51+
url=about['__url__'],
52+
license=about['__license__'],
53+
keywords=[
54+
'cron', 'crontab', 'cron-utils', 'cron-tools', 'parser',
55+
],
56+
python_requires=">=3.7",
57+
packages=find_packages(),
58+
install_requires=requirements,
59+
tests_require=test_requirements,
60+
classifiers=[
61+
'Development Status :: 4 - Beta',
62+
'Intended Audience :: Developers',
63+
'Natural Language :: English',
64+
'License :: Public Domain',
65+
'Programming Language :: Python',
66+
'Programming Language :: Python :: 3.7',
67+
'Programming Language :: Python :: 3.8',
68+
'Programming Language :: Python :: 3.9',
69+
],
70+
project_urls={
71+
'Source': 'https://github.com/dapper91/crontools',
72+
},
73+
cmdclass={'test': PyTest},
74+
)

0 commit comments

Comments
 (0)