forked from GetRD/academic-file-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (59 loc) · 2.24 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
import os
import sys
import re
import shutil
from setuptools import setup, find_packages
def get_version(package):
"""Return package version as listed in `__version__` in `init.py`."""
version_py = open(os.path.join(package, 'version.py')).read()
return re.search("version = ['\"]([^'\"]+)['\"]", version_py).group(1)
version = get_version('academic')
if sys.argv[-1] == 'publish':
if os.system("pip3 freeze --all | grep wheel"):
print("wheel not installed.\nUse `pip install wheel`.\nExiting.")
sys.exit()
if os.system("pip3 freeze --all | grep twine"):
print("twine not installed.\nUse `pip install twine`.\nExiting.")
sys.exit()
os.system("python3 setup.py sdist bdist_wheel")
os.system("twine upload dist/*")
print("You probably want to also tag the version now:")
print(" git tag -a {0} -m 'version {0}'".format(version))
print(" git push --tags")
shutil.rmtree('dist')
shutil.rmtree('build')
shutil.rmtree('academic.egg-info')
sys.exit()
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='academic',
version=version,
author='George Cushen',
author_email='hugo-discuss@googlegroups.com',
url='https://sourcethemes.com/academic/',
description='The website designer for Hugo',
long_description=long_description,
long_description_content_type="text/markdown",
keywords='cli academic hugo theme static-site-generator cms blog-engine github-pages netlify hugo-theme documentation-generator',
include_package_data=True,
license='MIT',
packages=find_packages(exclude=['tests']),
python_requires='>=3.6',
install_requires=['toml', 'requests', 'bibtexparser'],
entry_points="""
[console_scripts]
academic=academic.cli:main
""",
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Site Management',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)