-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
65 lines (52 loc) · 2.21 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
from os import path
from subprocess import check_output
from setuptools import setup, find_packages
git_version_command = 'git describe --tags --long --dirty'
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def read_version_from_git() -> str:
try:
version_string = check_output(git_version_command.split()).decode('utf-8').strip().split("-")
dirty = version_string[1] != "0"
if dirty:
return f"{version_string[0]}+{version_string[2]}"
return version_string[0]
except:
return "0.0.0"
if path.exists(here + "/.git"):
init_file = None
with open(path.join(here, 'jivago/__init__.py'), 'r', encoding='utf-8') as f:
init_file = f.read()
if "@@VERSION@@" in init_file:
with open(path.join(here, 'jivago/__init__.py'), 'w', encoding='utf-8') as f:
f.write(init_file.replace("@@VERSION@@", read_version_from_git()))
import jivago
setup(
name='jivago',
version=jivago.__version__,
setup_requires=[],
description='The highly-reflective object-oriented Python web framework',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/keotl/jivago',
author='Kento A. Lauzon',
author_email='kento.lauzon@ligature.ca',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
package_data={"jivago": ["*.typed"]},
include_package_data=True,
packages=find_packages(
exclude=['contrib', 'docs', 'test', 'test.*' 'tests', 'tests.*', 'example_app', 'example_app.*', 'test_data',
'test_data.*', 'test_utils', 'test_utils.*', 'e2e_test', 'e2e_test.*']),
install_requires=['Jinja2', 'croniter', 'pyyaml', 'werkzeug'],
)