This repository has been archived by the owner on May 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
42 lines (38 loc) · 2.75 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
import os
import platform
from setuptools import setup
import re, subprocess
req = """
requests
aiohttp
"""
with open('baracchino/__init__.py') as f:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError('version is not set')
if version.endswith(('a', 'b', 'rc')):
# append version identifier based on commit count
try:
p = os.popen(" ".join(['git', 'describe', '--always']))
version += p.read()[:-1].replace('a', "").replace('b', "").replace('c', "").replace('d', "").replace('e', "").replace('f', "").replace('g', "").replace('h', "").replace("i", "")
print(version)
except Exception:
import traceback
traceback.print_exc()
print(Exception())
requirements = []
print(f"Using version {version}")
requirements = req.splitlines()
setup(name="baracchino.py", version=f"{version}", packages=["baracchino"], license="MIT", install_requires=requirements, classifiers=['Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Internet',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
'Typing :: Typed'])