-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
110 lines (87 loc) · 2.77 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright: (c) 2020 Raul Gomis
:license: MIT, see LICENSE for more details.
"""
import io
import os
from setuptools import setup, find_packages, Command
# Package meta-data.
NAME = 'semversioner'
DESCRIPTION = 'Manage properly semver in your repository'
URL = 'https://github.com/raulgomis/semversioner'
EMAIL = '[email protected]'
AUTHOR = 'Raul Gomis'
REQUIRES_PYTHON = '>=3.8.0'
VERSION = None
REQUIRED = [
'click>=8.0.0',
'jinja2>=3.0.0',
'packaging>=21.0'
]
here = os.path.abspath(os.path.dirname(__file__))
readme = DESCRIPTION
with io.open(os.path.join(here, "README.md"), "rt", encoding="utf8") as f:
readme = f.read()
with io.open(os.path.join(here, "CHANGELOG.md"), "rt", encoding="utf8") as f:
changelog = f.read()
# Load the package's __version__.py module as a dictionary.
if not VERSION:
with open(os.path.join(here, 'semversioner', '__version__.py')) as f:
about = {}
exec(f.read(), about)
VERSION = about['__version__']
# # Load the package's __version__.py module as a dictionary.
# if not VERSION:
# with open(os.path.join(here, 'semversioner', '__init__.py')) as f:
# VERSION = (
# re.compile(r""".*__version__ = ["'](.*?)['"]""", re.S).match(f.read()).group(1)
# )
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf ./build ./dist ./*.pyc ./*.egg-info')
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=u"\n\n".join([readme, changelog]),
long_description_content_type='text/markdown',
tests_require=['nose'],
url=URL,
author=AUTHOR,
author_email=EMAIL,
license='MIT',
packages=find_packages(exclude=('tests',)),
python_requires=REQUIRES_PYTHON,
entry_points={
'console_scripts': [
'semversioner = semversioner.__main__:main'
]
},
install_requires=REQUIRED,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Operating System :: OS Independent',
],
cmdclass={
'clean': CleanCommand,
}
)