Skip to content

Commit 70f6866

Browse files
committed
Tidy up setup.py to import requirements.txt
1 parent 8aee027 commit 70f6866

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
recursive-include newspaper *include requirements.txt
1+
include requirements.txt

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ nltk==2.0.4
77
requests==2.3.0
88
six==1.7.3
99
jieba==0.35
10-
-e git+https://github.com/karls/responses@regex-url-matching#egg=responses
10+
responses==0.3.0

setup.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
1-
#!/bin/python2.7
21
# -*- coding: utf-8 -*-
32
"""
43
Lucas Ou 2014 -- http://lucasou.com
54
65
Setup guide: http://guide.python-distribute.org/creation.html
76
python setup.py sdist bdist_wininst upload
87
"""
8+
import sys
9+
import os
10+
911
try:
1012
from setuptools import setup
1113
except ImportError:
1214
from distutils.core import setup
1315

16+
17+
if sys.argv[-1] == 'publish':
18+
os.system('python setup.py sdist bdist_wininst upload')
19+
sys.exit()
20+
21+
1422
packages = [
1523
'newspaper',
1624
'newspaper.packages',
1725
'newspaper.packages.tldextract',
1826
'newspaper.packages.feedparser',
1927
]
2028

21-
required = []
29+
2230
with open('requirements.txt') as f:
2331
required = f.read().splitlines()
2432

25-
"""
26-
requires = [
27-
'lxml==3.3.5',
28-
'jieba==0.35',
29-
'requests==2.3.0',
30-
'nltk==2.0.4',
31-
'Pillow==2.5.1',
32-
'cssselect==0.9.1',
33-
'BeautifulSoup==3.2.1'
34-
]
35-
"""
3633

3734
setup(
3835
name='newspaper',
@@ -44,6 +41,6 @@
4441
packages=packages,
4542
include_package_data=True,
4643
install_requires=required,
47-
license='',
44+
license='MIT',
4845
zip_safe=False,
4946
)

0 commit comments

Comments
 (0)