-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·63 lines (52 loc) · 1.81 KB
/
setup.py
File metadata and controls
executable file
·63 lines (52 loc) · 1.81 KB
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
#!/usr/bin/env python3
import os
import sys
from setuptools import setup
pkg_root = os.path.abspath(os.path.dirname(__file__))
readme_rst = os.path.join(pkg_root, "README.rst")
remove_rst = False
def getLongDesc():
global remove_rst
if not os.path.exists(readme_rst):
# dynamically generate a restructured text formatted long description
# from markdown for setuptools to use
import subprocess
pandoc = "/usr/bin/pandoc"
if not os.path.exists(pandoc):
print("Can't generate RST readme from MD readme, because pandoc isn't installed. Skipping long description.", file=sys.stderr)
return "no long description available"
subprocess.check_call(
[pandoc, "-f", "markdown", "-t", "rst", "-o", "README.rst", "README.md"],
)
remove_rst = True
with open(readme_rst, 'r') as rst_file:
long_desc = rst_file.read()
return long_desc
long_desc = getLongDesc()
try:
setup(
name='oscfs',
version='0.9.1',
description='A FUSE based file system to access Open Build Service (OBS) instances',
long_description=long_desc,
author='Matthias Gerstner',
author_email='matthias.gerstner@suse.de',
license='GPL2',
keywords='fuse obs osc openSUSE',
packages=['oscfs'],
install_requires=['osc', 'fusepy'],
url='https://github.com/mgerstner/oscfs',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Programming Language :: Python :: 2.7',
'Topic :: System :: Filesystems'
],
scripts=['bin/oscfs']
)
finally:
try:
if remove_rst:
os.remove(readme_rst)
except Exception:
pass