forked from codelucas/newspaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·63 lines (48 loc) · 1.48 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
#!/bin/python2.7
# -*- coding: utf-8 -*-
"""
Lucas Ou-Yang 2014 -- http://codelucas.com
"""
import sys
import os
import codecs
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
packages = [
'newspaper',
]
if sys.argv[-1] == 'publish':
os.system('python3 setup.py sdist upload -r pypi')
sys.exit()
# This *must* run early. Please see this API limitation on our users:
# https://github.com/codelucas/newspaper/issues/155
if sys.version_info[0] == 2 and sys.argv[-1] not in ['publish', 'upload']:
sys.exit('WARNING! You are attempting to install newspaper3k\'s '
'python3 repository on python2. PLEASE RUN '
'`$ pip3 install newspaper3k` for python3 or '
'`$ pip install newspaper` for python2')
with open('requirements.txt') as f:
required = f.read().splitlines()
with codecs.open('README.rst', 'r', 'utf-8') as f:
readme = f.read()
setup(
name='newspaper3k',
version='0.2.7',
description='Simplified python article discovery & extraction.',
long_description=readme,
author='Lucas Ou-Yang',
author_email='[email protected]',
url='https://github.com/codelucas/newspaper/',
packages=packages,
include_package_data=True,
install_requires=required,
license='MIT',
zip_safe=False,
classifiers=[
'Programming Language :: Python :: 3',
'Natural Language :: English',
'Intended Audience :: Developers',
],
)