-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathsetup.py
55 lines (47 loc) · 1.58 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
#!/usr/bin/python
import os
import re
import subprocess
from setuptools import setup
with open("README.md", encoding="utf-8") as f:
long_description = f.read()
def get_version():
"""Get the version from git tags.
Version is determined by the latest git tag, and will be the tag name without the leading 'v'.
Returns:
str: The version number.
"""
try:
# Get the latest git tag
version = subprocess.check_output(
["git", "describe", "--tags", "--abbrev=0"], encoding="utf-8"
).strip()
version = re.sub("^v", "", version)
return version
except subprocess.CalledProcessError:
return "0.0.0"
setup(
name="anybadge",
description="Simple, flexible badge generator for project badges.",
long_description=long_description,
long_description_content_type="text/markdown",
version=get_version(),
author="Jon Grace-Cox",
author_email="30441316+jongracecox@users.noreply.github.com",
packages=["anybadge", "anybadge.templates", "anybadge.server"],
py_modules=["anybadge_server"],
setup_requires=["setuptools", "wheel"],
tests_require=[],
install_requires=["packaging"],
package_data={"anybadge": ["templates/*.svg"]},
options={"bdist_wheel": {"universal": False}},
python_requires=">=3.7",
url="https://github.com/jongracecox/anybadge",
entry_points={
"console_scripts": [
"anybadge=anybadge.cli:main",
"anybadge-server=anybadge.server.cli:main",
],
},
classifiers=["License :: OSI Approved :: MIT License"],
)