-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathsetup.py
41 lines (36 loc) · 1.02 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
import atexit
import os
import sys
import pawk
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info[0] != 3:
print("PAWK requires Python 3")
exit(1)
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
with open('README.rst', 'w') as f:
f.write(long_description)
atexit.register(lambda: os.unlink('README.rst'))
except (ImportError, OSError):
print('WARNING: Could not locate pandoc, using Markdown long_description.')
with open('README.md') as f:
long_description = f.read()
description = long_description.splitlines()[0].strip()
setup(
name='pawk',
url='http://github.com/alecthomas/pawk',
download_url='http://github.com/alecthomas/pawk',
version=pawk.__version__,
description=description,
long_description=long_description,
license='PSF',
platforms=['any'],
author='Alec Thomas',
author_email='alec@swapoff.org',
py_modules=['pawk'],
scripts=['pawk'],
)