mirror of
https://github.com/codelucas/newspaper.git
synced 2025-12-23 05:36:50 +00:00
Change setup.py format in python2
This commit is contained in:
parent
eeea6a41af
commit
4e57afbcc7
1 changed files with 13 additions and 10 deletions
23
setup.py
23
setup.py
|
|
@ -19,16 +19,6 @@ def hilight(input_string):
|
|||
return '\x1b[%sm%s\x1b[0m' % (';'.join(attr), input_string)
|
||||
|
||||
|
||||
# This *must* run early. Please see this API limitation on our users:
|
||||
# https://github.com/codelucas/newspaper/issues/155
|
||||
if sys.version_info[0] == 3:
|
||||
warning_string = hilight(
|
||||
'WARNING! You are attempting to install newspaper\'s '
|
||||
'python2 repository on python3. PLEASE RUN '
|
||||
'`$ pip3 install newspaper3k` for python3 or '
|
||||
'`$ pip install newspaper` for python2')
|
||||
sys.exit(warning_string)
|
||||
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
|
|
@ -40,6 +30,19 @@ if sys.argv[-1] == 'publish':
|
|||
sys.exit()
|
||||
|
||||
|
||||
# This *must* run early. Please see this API limitation on our users:
|
||||
# https://github.com/codelucas/newspaper/issues/155
|
||||
# But, this can't run before the `os.system('python setup.py sdist upload')` publish
|
||||
# command because publishing only works in python3 for my MANIFEST.in format
|
||||
if sys.version_info[0] == 3:
|
||||
warning_string = hilight(
|
||||
'WARNING! You are attempting to install newspaper\'s '
|
||||
'python2 repository on python3. PLEASE RUN '
|
||||
'`$ pip3 install newspaper3k` for python3 or '
|
||||
'`$ pip install newspaper` for python2')
|
||||
sys.exit(warning_string)
|
||||
|
||||
|
||||
packages = [
|
||||
'newspaper',
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue