##// END OF EJS Templates
Merge pull request #13702 from Carreau/mdocs...
Merge pull request #13702 from Carreau/mdocs Misc documentation fixes.

File last commit:

r27682:971e5ce2
r27696:35918166 merge
Show More
setup.py
148 lines | 4.8 KiB | text/x-python | PythonLexer
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 # -*- coding: utf-8 -*-
"""Setup script for IPython.
Under Posix environments it works like a typical setup.py script.
Under Windows, the command sdist is not supported, since IPython
requires utilities which are not available under Windows."""
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2011, IPython Development Team.
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
# Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
# Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
#
# Distributed under the terms of the Modified BSD License.
#
Jonathan Frederic
s/COPYING.txt/COPYING.rst
r15990 # The full license is in the file COPYING.rst, distributed with this software.
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 #-----------------------------------------------------------------------------
Thomas Kluyver
Code style cleanups
r23546 import os
Fernando Perez
Inform user at install time of minimal python requirements if not met....
r2493 import sys
Thomas Kluyver
Clean up pip version check
r23544 # **Python version check**
#
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 # This check is also made in IPython/__init__, don't forget to update both when
# changing Python version requirements.
Matthias Bussonnier
Stop support for 3.7 on the master branch....
r27132 if sys.version_info < (3, 8):
Thomas Kluyver
Clean up pip version check
r23544 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
Matthias Bussonnier
more pip infos
r23539 try:
import pip
pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
if pip_version < (9, 0, 1) :
Thomas Kluyver
Clean up pip version check
r23544 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
Matthias Bussonnier
more pip infos
r23539 'pip {} detected.'.format(pip.__version__)
Thomas Kluyver
Suppress message about pip if we do find a new enough pip
r23548 else:
# pip is new enough - it must be something else
pip_message = ''
Matthias Bussonnier
more pip infos
r23539 except Exception:
pass
Rastislav Barlik
Fix broken jedi auto-completion with newest jedi...
r24033
Matthias Bussonnier
Improve our error messages for non compatibility.
r22823 error = """
Matthias Bussonnier
Stop support for 3.7 on the master branch....
r27132 IPython 8+ supports Python 3.8 and above, following NEP 29.
Matthias Bussonnier
Improve our error messages for non compatibility.
r22823 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
Matthias Bussonnier
remove duplicate WatsNew from bad rebase
r24471 Python 3.3 and 3.4 were supported up to IPython 6.x.
Matthias Bussonnier
Adopt NEP 29, Drop Python 3.5 and Numpy <1.14...
r25225 Python 3.5 was supported with IPython 7.0 to 7.9.
Matthias Bussonnier
NEP 29 stop support for 3.6
r25874 Python 3.6 was supported with IPython up to 7.16.
Matthias Bussonnier
Stop support for 3.7 on the master branch....
r27132 Python 3.7 was still supported with the 7.x branch.
Matthias Bussonnier
Improve our error messages for non compatibility.
r22823
See IPython `README.rst` file for more information:
https://github.com/ipython/ipython/blob/master/README.rst
Matthias Bussonnier
more pip infos
r23539 Python {py} detected.
{pip}
Matthias Bussonnier
reformat setup.py
r27641 """.format(
py=sys.version_info, pip=pip_message
)
Matthias Bussonnier
Improve our error messages for non compatibility.
r22823
MinRK
update version-check message in setup.py and IPython.__init__...
r12473 print(error, file=sys.stderr)
sys.exit(1)
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829
# At least we're on the python version we need, move on.
James Morris
Only use setuptools, avoid distutils as much as possible
r27251 from setuptools import setup
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829
# Our own imports
Michał Górny
Modernize setuptools usage in pyproject.toml...
r27682 sys.path.insert(0, ".")
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 from setupbase import target_update
from setupbase import (
setup_args,
MinRK
run check_package_data as part of build_py...
r15165 check_package_data_first,
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 find_data_files,
MinRK
ensure submodules exist prior to doing anything...
r10484 git_prebuild,
Thomas Kluyver
Rework setup to allow installing on Python 2 and 3....
r13452 install_symlinked,
install_lib_symlink,
install_scripts_for_symlink,
Thomas Kluyver
Add 'unsymlink command to remove the symlink
r13862 unsymlink,
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 )
#-------------------------------------------------------------------------------
# Handle OS specific things
#-------------------------------------------------------------------------------
MinRK
don't give up on weird os names...
r10087 if os.name in ('nt','dos'):
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 os_name = 'windows'
Ville M. Vainio
more crlf
r1033 else:
MinRK
don't give up on weird os names...
r10087 os_name = os.name
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829
# Under Windows, 'sdist' has not been supported. Now that the docs build with
# Sphinx it might work, but let's not turn it on until someone confirms that it
# actually works.
if os_name == 'windows' and 'sdist' in sys.argv:
print('The sdist command is not available under Windows. Exiting.')
sys.exit(1)
MinRK
ensure submodules exist prior to doing anything...
r10484
#-------------------------------------------------------------------------------
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 # Things related to the IPython documentation
#-------------------------------------------------------------------------------
# update the manuals when building a source dist
if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
# List of things to be updated. Each entry is a triplet of args for
# target_update()
to_update = [
Matthias Bussonnier
reformat
r27268 (
"docs/man/ipython.1.gz",
["docs/man/ipython.1"],
"cd docs/man && python -m gzip --best ipython.1",
),
]
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829
[ target_update(*t) for t in to_update ]
#---------------------------------------------------------------------------
# Find all the packages, package data, and data_files
#---------------------------------------------------------------------------
data_files = find_data_files()
setup_args['data_files'] = data_files
#---------------------------------------------------------------------------
MinRK
record sysinfo in sdist...
r7794 # custom distutils commands
MinRK
enable uploading wininst to PyPI with tools/release_windows.py...
r7792 #---------------------------------------------------------------------------
MinRK
record sysinfo in sdist...
r7794 # imports here, so they are after setuptools import if there was one
James Morris
Only use setuptools, avoid distutils as much as possible
r27251 from setuptools.command.sdist import sdist
MinRK
enable uploading wininst to PyPI with tools/release_windows.py...
r7792
MinRK
record sysinfo in sdist...
r7794 setup_args['cmdclass'] = {
Min RK
remove notebook-specific parts of setup, git-hooks
r21249 'build_py': \
check_package_data_first(git_prebuild('IPython')),
'sdist' : git_prebuild('IPython', sdist),
Thomas Kluyver
Rework setup to allow installing on Python 2 and 3....
r13452 'symlink': install_symlinked,
'install_lib_symlink': install_lib_symlink,
'install_scripts_sym': install_scripts_for_symlink,
Thomas Kluyver
Add 'unsymlink command to remove the symlink
r13862 'unsymlink': unsymlink,
MinRK
record sysinfo in sdist...
r7794 }
MinRK
enable uploading wininst to PyPI with tools/release_windows.py...
r7792
Thomas Kluyver
Remove separate setup.py file for Python 3.
r5829 #---------------------------------------------------------------------------
# Do the actual setup now
#---------------------------------------------------------------------------
Matthias Bussonnier
updates
r27267 if __name__ == "__main__":
setup(**setup_args)