Show More
@@ -1,125 +1,125 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """Release data for the IPython project.""" |
|
2 | """Release data for the IPython project.""" | |
3 |
|
3 | |||
4 | #----------------------------------------------------------------------------- |
|
4 | #----------------------------------------------------------------------------- | |
5 | # Copyright (c) 2008, IPython Development Team. |
|
5 | # Copyright (c) 2008, IPython Development Team. | |
6 | # Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu> |
|
6 | # Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu> | |
7 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> |
|
7 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> | |
8 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> |
|
8 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> | |
9 | # |
|
9 | # | |
10 | # Distributed under the terms of the Modified BSD License. |
|
10 | # Distributed under the terms of the Modified BSD License. | |
11 | # |
|
11 | # | |
12 | # The full license is in the file COPYING.txt, distributed with this software. |
|
12 | # The full license is in the file COPYING.txt, distributed with this software. | |
13 | #----------------------------------------------------------------------------- |
|
13 | #----------------------------------------------------------------------------- | |
14 |
|
14 | |||
15 | # Name of the package for release purposes. This is the name which labels |
|
15 | # Name of the package for release purposes. This is the name which labels | |
16 | # the tarballs and RPMs made by distutils, so it's best to lowercase it. |
|
16 | # the tarballs and RPMs made by distutils, so it's best to lowercase it. | |
17 | name = 'ipython' |
|
17 | name = 'ipython' | |
18 |
|
18 | |||
19 | # IPython version information. An empty _version_extra corresponds to a full |
|
19 | # IPython version information. An empty _version_extra corresponds to a full | |
20 | # release. 'dev' as a _version_extra string means this is a development |
|
20 | # release. 'dev' as a _version_extra string means this is a development | |
21 | # version |
|
21 | # version | |
22 | _version_major = 4 |
|
22 | _version_major = 4 | |
23 | _version_minor = 1 |
|
23 | _version_minor = 1 | |
24 | _version_patch = 0 |
|
24 | _version_patch = 0 | |
25 | _version_extra = 'dev' |
|
25 | _version_extra = '.dev' | |
26 | # _version_extra = 'rc1' |
|
26 | # _version_extra = 'rc1' | |
27 | # _version_extra = '' # Uncomment this for full releases |
|
27 | # _version_extra = '' # Uncomment this for full releases | |
28 |
|
28 | |||
29 | # release.codename is deprecated in 2.0, will be removed in 3.0 |
|
29 | # release.codename is deprecated in 2.0, will be removed in 3.0 | |
30 | codename = '' |
|
30 | codename = '' | |
31 |
|
31 | |||
32 | # Construct full version string from these. |
|
32 | # Construct full version string from these. | |
33 | _ver = [_version_major, _version_minor, _version_patch] |
|
33 | _ver = [_version_major, _version_minor, _version_patch] | |
34 |
|
34 | |||
35 | __version__ = '.'.join(map(str, _ver)) |
|
35 | __version__ = '.'.join(map(str, _ver)) | |
36 | if _version_extra: |
|
36 | if _version_extra: | |
37 |
__version__ = __version__ |
|
37 | __version__ = __version__ + _version_extra | |
38 |
|
38 | |||
39 | version = __version__ # backwards compatibility name |
|
39 | version = __version__ # backwards compatibility name | |
40 | version_info = (_version_major, _version_minor, _version_patch, _version_extra) |
|
40 | version_info = (_version_major, _version_minor, _version_patch, _version_extra) | |
41 |
|
41 | |||
42 | # Change this when incrementing the kernel protocol version |
|
42 | # Change this when incrementing the kernel protocol version | |
43 | kernel_protocol_version_info = (5, 0) |
|
43 | kernel_protocol_version_info = (5, 0) | |
44 | kernel_protocol_version = "%i.%i" % kernel_protocol_version_info |
|
44 | kernel_protocol_version = "%i.%i" % kernel_protocol_version_info | |
45 |
|
45 | |||
46 | description = "IPython: Productive Interactive Computing" |
|
46 | description = "IPython: Productive Interactive Computing" | |
47 |
|
47 | |||
48 | long_description = \ |
|
48 | long_description = \ | |
49 | """ |
|
49 | """ | |
50 | IPython provides a rich toolkit to help you make the most out of using Python |
|
50 | IPython provides a rich toolkit to help you make the most out of using Python | |
51 | interactively. Its main components are: |
|
51 | interactively. Its main components are: | |
52 |
|
52 | |||
53 | * A powerful interactive Python shell |
|
53 | * A powerful interactive Python shell | |
54 | * A `Jupyter <http://jupyter.org/>`_ kernel to work with Python code in Jupyter |
|
54 | * A `Jupyter <http://jupyter.org/>`_ kernel to work with Python code in Jupyter | |
55 | notebooks and other interactive frontends. |
|
55 | notebooks and other interactive frontends. | |
56 |
|
56 | |||
57 | The enhanced interactive Python shells have the following main features: |
|
57 | The enhanced interactive Python shells have the following main features: | |
58 |
|
58 | |||
59 | * Comprehensive object introspection. |
|
59 | * Comprehensive object introspection. | |
60 |
|
60 | |||
61 | * Input history, persistent across sessions. |
|
61 | * Input history, persistent across sessions. | |
62 |
|
62 | |||
63 | * Caching of output results during a session with automatically generated |
|
63 | * Caching of output results during a session with automatically generated | |
64 | references. |
|
64 | references. | |
65 |
|
65 | |||
66 | * Extensible tab completion, with support by default for completion of python |
|
66 | * Extensible tab completion, with support by default for completion of python | |
67 | variables and keywords, filenames and function keywords. |
|
67 | variables and keywords, filenames and function keywords. | |
68 |
|
68 | |||
69 | * Extensible system of 'magic' commands for controlling the environment and |
|
69 | * Extensible system of 'magic' commands for controlling the environment and | |
70 | performing many tasks related either to IPython or the operating system. |
|
70 | performing many tasks related either to IPython or the operating system. | |
71 |
|
71 | |||
72 | * A rich configuration system with easy switching between different setups |
|
72 | * A rich configuration system with easy switching between different setups | |
73 | (simpler than changing $PYTHONSTARTUP environment variables every time). |
|
73 | (simpler than changing $PYTHONSTARTUP environment variables every time). | |
74 |
|
74 | |||
75 | * Session logging and reloading. |
|
75 | * Session logging and reloading. | |
76 |
|
76 | |||
77 | * Extensible syntax processing for special purpose situations. |
|
77 | * Extensible syntax processing for special purpose situations. | |
78 |
|
78 | |||
79 | * Access to the system shell with user-extensible alias system. |
|
79 | * Access to the system shell with user-extensible alias system. | |
80 |
|
80 | |||
81 | * Easily embeddable in other Python programs and GUIs. |
|
81 | * Easily embeddable in other Python programs and GUIs. | |
82 |
|
82 | |||
83 | * Integrated access to the pdb debugger and the Python profiler. |
|
83 | * Integrated access to the pdb debugger and the Python profiler. | |
84 |
|
84 | |||
85 | The latest development version is always available from IPython's `GitHub |
|
85 | The latest development version is always available from IPython's `GitHub | |
86 | site <http://github.com/ipython>`_. |
|
86 | site <http://github.com/ipython>`_. | |
87 | """ |
|
87 | """ | |
88 |
|
88 | |||
89 | license = 'BSD' |
|
89 | license = 'BSD' | |
90 |
|
90 | |||
91 | authors = {'Fernando' : ('Fernando Perez','fperez.net@gmail.com'), |
|
91 | authors = {'Fernando' : ('Fernando Perez','fperez.net@gmail.com'), | |
92 | 'Janko' : ('Janko Hauser','jhauser@zscout.de'), |
|
92 | 'Janko' : ('Janko Hauser','jhauser@zscout.de'), | |
93 | 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'), |
|
93 | 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'), | |
94 | 'Ville' : ('Ville Vainio','vivainio@gmail.com'), |
|
94 | 'Ville' : ('Ville Vainio','vivainio@gmail.com'), | |
95 | 'Brian' : ('Brian E Granger', 'ellisonbg@gmail.com'), |
|
95 | 'Brian' : ('Brian E Granger', 'ellisonbg@gmail.com'), | |
96 | 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com'), |
|
96 | 'Min' : ('Min Ragan-Kelley', 'benjaminrk@gmail.com'), | |
97 | 'Thomas' : ('Thomas A. Kluyver', 'takowl@gmail.com'), |
|
97 | 'Thomas' : ('Thomas A. Kluyver', 'takowl@gmail.com'), | |
98 | 'Jorgen' : ('Jorgen Stenarson', 'jorgen.stenarson@bostream.nu'), |
|
98 | 'Jorgen' : ('Jorgen Stenarson', 'jorgen.stenarson@bostream.nu'), | |
99 | 'Matthias' : ('Matthias Bussonnier', 'bussonniermatthias@gmail.com'), |
|
99 | 'Matthias' : ('Matthias Bussonnier', 'bussonniermatthias@gmail.com'), | |
100 | } |
|
100 | } | |
101 |
|
101 | |||
102 | author = 'The IPython Development Team' |
|
102 | author = 'The IPython Development Team' | |
103 |
|
103 | |||
104 | author_email = 'ipython-dev@scipy.org' |
|
104 | author_email = 'ipython-dev@scipy.org' | |
105 |
|
105 | |||
106 | url = 'http://ipython.org' |
|
106 | url = 'http://ipython.org' | |
107 |
|
107 | |||
108 | download_url = 'https://github.com/ipython/ipython/downloads' |
|
108 | download_url = 'https://github.com/ipython/ipython/downloads' | |
109 |
|
109 | |||
110 | platforms = ['Linux','Mac OSX','Windows XP/Vista/7/8'] |
|
110 | platforms = ['Linux','Mac OSX','Windows XP/Vista/7/8'] | |
111 |
|
111 | |||
112 | keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed', |
|
112 | keywords = ['Interactive','Interpreter','Shell','Parallel','Distributed', | |
113 | 'Web-based computing', 'Qt console', 'Embedding'] |
|
113 | 'Web-based computing', 'Qt console', 'Embedding'] | |
114 |
|
114 | |||
115 | classifiers = [ |
|
115 | classifiers = [ | |
116 | 'Framework :: IPython', |
|
116 | 'Framework :: IPython', | |
117 | 'Intended Audience :: Developers', |
|
117 | 'Intended Audience :: Developers', | |
118 | 'Intended Audience :: Science/Research', |
|
118 | 'Intended Audience :: Science/Research', | |
119 | 'License :: OSI Approved :: BSD License', |
|
119 | 'License :: OSI Approved :: BSD License', | |
120 | 'Programming Language :: Python', |
|
120 | 'Programming Language :: Python', | |
121 | 'Programming Language :: Python :: 2', |
|
121 | 'Programming Language :: Python :: 2', | |
122 | 'Programming Language :: Python :: 2.7', |
|
122 | 'Programming Language :: Python :: 2.7', | |
123 | 'Programming Language :: Python :: 3', |
|
123 | 'Programming Language :: Python :: 3', | |
124 | 'Topic :: System :: Shells' |
|
124 | 'Topic :: System :: Shells' | |
125 | ] |
|
125 | ] |
@@ -1,28 +1,76 b'' | |||||
1 | .. _developer_guide: |
|
1 | .. _developer_guide: | |
2 |
|
2 | |||
3 | ========================= |
|
3 | ========================= | |
4 | IPython developer's guide |
|
4 | IPython developer's guide | |
5 | ========================= |
|
5 | ========================= | |
6 |
|
6 | |||
7 | This are two categories of developer focused documentation: |
|
7 | This are two categories of developer focused documentation: | |
8 |
|
8 | |||
9 | 1. Documentation for developers of *IPython itself*. |
|
9 | 1. Documentation for developers of *IPython itself*. | |
10 | 2. Documentation for developers of third party tools and libraries |
|
10 | 2. Documentation for developers of third party tools and libraries | |
11 | that use IPython. |
|
11 | that use IPython. | |
12 |
|
12 | |||
13 | This part of our documentation only contains information in the second category. |
|
13 | This part of our documentation only contains information in the second category. | |
14 |
|
14 | |||
15 | Developers interested in working on IPython itself should consult |
|
15 | Developers interested in working on IPython itself should consult | |
16 | our `developer information <https://github.com/ipython/ipython/wiki/Dev:-Index>`_ |
|
16 | our `developer information <https://github.com/ipython/ipython/wiki/Dev:-Index>`_ | |
17 | on the IPython GitHub wiki. |
|
17 | on the IPython GitHub wiki. | |
18 |
|
18 | |||
19 | .. toctree:: |
|
19 | .. toctree:: | |
20 | :maxdepth: 1 |
|
20 | :maxdepth: 1 | |
21 |
|
21 | |||
22 | how_ipython_works |
|
22 | how_ipython_works | |
23 | wrapperkernels |
|
23 | wrapperkernels | |
24 | execution |
|
24 | execution | |
25 | lexer |
|
25 | lexer | |
26 | pycompat |
|
26 | pycompat | |
27 | config |
|
27 | config | |
28 | inputhook_app |
|
28 | inputhook_app | |
|
29 | ||||
|
30 | Making an IPython release | |||
|
31 | ========================= | |||
|
32 | ||||
|
33 | Make sure the repository is clean of any file that could be problematic. | |||
|
34 | You can remove all non-tracked files with: | |||
|
35 | ||||
|
36 | .. code:: | |||
|
37 | ||||
|
38 | $ git clean -xfdi | |||
|
39 | ||||
|
40 | This would ask you for confirmation before removing all untracked files. Make | |||
|
41 | sure the ``dist/`` folder is clean and avoid stale build from | |||
|
42 | previous attempts. | |||
|
43 | ||||
|
44 | 1. Update version number in ``IPython/core/release.py``. | |||
|
45 | ||||
|
46 | Make sure the version number match pep440, in particular, `rc` and `beta` are | |||
|
47 | not separated by `.` or the `sdist` and `bdist` will appear as different | |||
|
48 | releases. | |||
|
49 | ||||
|
50 | 2. Commit and tag the release with the current version number: | |||
|
51 | ||||
|
52 | .. code:: | |||
|
53 | ||||
|
54 | git commit -am "release $VERSION" | |||
|
55 | git tag $VERSION | |||
|
56 | ||||
|
57 | ||||
|
58 | 3. You are now ready to build the ``sdist`` and ``wheel``: | |||
|
59 | ||||
|
60 | .. code:: | |||
|
61 | ||||
|
62 | $ python setup.py sdist --formats=zip,gztar | |||
|
63 | $ python setup.py bdist_wheel | |||
|
64 | ||||
|
65 | ||||
|
66 | 4. You can now test the ``wheel`` and the ``sdist`` locally before uploading to PyPI. | |||
|
67 | Make sure to use `twine <https://github.com/pypa/twine>`_ to upload the archives over SSL. | |||
|
68 | ||||
|
69 | .. code:: | |||
|
70 | ||||
|
71 | $ twine upload dist/* | |||
|
72 | ||||
|
73 | 5. If all went well, change the ``IPython/core/release.py`` back adding the ``.dev`` suffix. | |||
|
74 | ||||
|
75 | 6. Push directly on master, not forgetting to push ``--tags``. | |||
|
76 |
@@ -1,298 +1,305 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | # -*- coding: utf-8 -*- |
|
2 | # -*- coding: utf-8 -*- | |
3 | """Setup script for IPython. |
|
3 | """Setup script for IPython. | |
4 |
|
4 | |||
5 | Under Posix environments it works like a typical setup.py script. |
|
5 | Under Posix environments it works like a typical setup.py script. | |
6 | Under Windows, the command sdist is not supported, since IPython |
|
6 | Under Windows, the command sdist is not supported, since IPython | |
7 | requires utilities which are not available under Windows.""" |
|
7 | requires utilities which are not available under Windows.""" | |
8 |
|
8 | |||
9 | #----------------------------------------------------------------------------- |
|
9 | #----------------------------------------------------------------------------- | |
10 | # Copyright (c) 2008-2011, IPython Development Team. |
|
10 | # Copyright (c) 2008-2011, IPython Development Team. | |
11 | # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> |
|
11 | # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> | |
12 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> |
|
12 | # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> | |
13 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> |
|
13 | # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> | |
14 | # |
|
14 | # | |
15 | # Distributed under the terms of the Modified BSD License. |
|
15 | # Distributed under the terms of the Modified BSD License. | |
16 | # |
|
16 | # | |
17 | # The full license is in the file COPYING.rst, distributed with this software. |
|
17 | # The full license is in the file COPYING.rst, distributed with this software. | |
18 | #----------------------------------------------------------------------------- |
|
18 | #----------------------------------------------------------------------------- | |
19 |
|
19 | |||
20 | #----------------------------------------------------------------------------- |
|
20 | #----------------------------------------------------------------------------- | |
21 | # Minimal Python version sanity check |
|
21 | # Minimal Python version sanity check | |
22 | #----------------------------------------------------------------------------- |
|
22 | #----------------------------------------------------------------------------- | |
23 | from __future__ import print_function |
|
23 | from __future__ import print_function | |
24 |
|
24 | |||
25 | import sys |
|
25 | import sys | |
|
26 | import re | |||
26 |
|
27 | |||
27 | # This check is also made in IPython/__init__, don't forget to update both when |
|
28 | # This check is also made in IPython/__init__, don't forget to update both when | |
28 | # changing Python version requirements. |
|
29 | # changing Python version requirements. | |
29 | v = sys.version_info |
|
30 | v = sys.version_info | |
30 | if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)): |
|
31 | if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)): | |
31 | error = "ERROR: IPython requires Python version 2.7 or 3.3 or above." |
|
32 | error = "ERROR: IPython requires Python version 2.7 or 3.3 or above." | |
32 | print(error, file=sys.stderr) |
|
33 | print(error, file=sys.stderr) | |
33 | sys.exit(1) |
|
34 | sys.exit(1) | |
34 |
|
35 | |||
35 | PY3 = (sys.version_info[0] >= 3) |
|
36 | PY3 = (sys.version_info[0] >= 3) | |
36 |
|
37 | |||
37 | # At least we're on the python version we need, move on. |
|
38 | # At least we're on the python version we need, move on. | |
38 |
|
39 | |||
39 | #------------------------------------------------------------------------------- |
|
40 | #------------------------------------------------------------------------------- | |
40 | # Imports |
|
41 | # Imports | |
41 | #------------------------------------------------------------------------------- |
|
42 | #------------------------------------------------------------------------------- | |
42 |
|
43 | |||
43 | # Stdlib imports |
|
44 | # Stdlib imports | |
44 | import os |
|
45 | import os | |
45 | import shutil |
|
|||
46 |
|
46 | |||
47 | from glob import glob |
|
47 | from glob import glob | |
48 |
|
48 | |||
49 | # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly |
|
49 | # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly | |
50 | # update it when the contents of directories change. |
|
50 | # update it when the contents of directories change. | |
51 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') |
|
51 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') | |
52 |
|
52 | |||
53 | from distutils.core import setup |
|
53 | from distutils.core import setup | |
54 |
|
54 | |||
55 | # Our own imports |
|
55 | # Our own imports | |
56 | from setupbase import target_update |
|
56 | from setupbase import target_update | |
57 |
|
57 | |||
58 | from setupbase import ( |
|
58 | from setupbase import ( | |
59 | setup_args, |
|
59 | setup_args, | |
60 | find_packages, |
|
60 | find_packages, | |
61 | find_package_data, |
|
61 | find_package_data, | |
62 | check_package_data_first, |
|
62 | check_package_data_first, | |
63 | find_entry_points, |
|
63 | find_entry_points, | |
64 | build_scripts_entrypt, |
|
64 | build_scripts_entrypt, | |
65 | find_data_files, |
|
65 | find_data_files, | |
66 | git_prebuild, |
|
66 | git_prebuild, | |
67 | install_symlinked, |
|
67 | install_symlinked, | |
68 | install_lib_symlink, |
|
68 | install_lib_symlink, | |
69 | install_scripts_for_symlink, |
|
69 | install_scripts_for_symlink, | |
70 | unsymlink, |
|
70 | unsymlink, | |
71 | ) |
|
71 | ) | |
72 |
|
72 | |||
73 | isfile = os.path.isfile |
|
73 | isfile = os.path.isfile | |
74 | pjoin = os.path.join |
|
74 | pjoin = os.path.join | |
75 |
|
75 | |||
76 | #------------------------------------------------------------------------------- |
|
76 | #------------------------------------------------------------------------------- | |
77 | # Handle OS specific things |
|
77 | # Handle OS specific things | |
78 | #------------------------------------------------------------------------------- |
|
78 | #------------------------------------------------------------------------------- | |
79 |
|
79 | |||
80 | if os.name in ('nt','dos'): |
|
80 | if os.name in ('nt','dos'): | |
81 | os_name = 'windows' |
|
81 | os_name = 'windows' | |
82 | else: |
|
82 | else: | |
83 | os_name = os.name |
|
83 | os_name = os.name | |
84 |
|
84 | |||
85 | # Under Windows, 'sdist' has not been supported. Now that the docs build with |
|
85 | # Under Windows, 'sdist' has not been supported. Now that the docs build with | |
86 | # Sphinx it might work, but let's not turn it on until someone confirms that it |
|
86 | # Sphinx it might work, but let's not turn it on until someone confirms that it | |
87 | # actually works. |
|
87 | # actually works. | |
88 | if os_name == 'windows' and 'sdist' in sys.argv: |
|
88 | if os_name == 'windows' and 'sdist' in sys.argv: | |
89 | print('The sdist command is not available under Windows. Exiting.') |
|
89 | print('The sdist command is not available under Windows. Exiting.') | |
90 | sys.exit(1) |
|
90 | sys.exit(1) | |
91 |
|
91 | |||
92 |
|
92 | |||
93 | #------------------------------------------------------------------------------- |
|
93 | #------------------------------------------------------------------------------- | |
94 | # Things related to the IPython documentation |
|
94 | # Things related to the IPython documentation | |
95 | #------------------------------------------------------------------------------- |
|
95 | #------------------------------------------------------------------------------- | |
96 |
|
96 | |||
97 | # update the manuals when building a source dist |
|
97 | # update the manuals when building a source dist | |
98 | if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): |
|
98 | if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): | |
99 |
|
99 | |||
100 | # List of things to be updated. Each entry is a triplet of args for |
|
100 | # List of things to be updated. Each entry is a triplet of args for | |
101 | # target_update() |
|
101 | # target_update() | |
102 | to_update = [ |
|
102 | to_update = [ | |
103 | ('docs/man/ipython.1.gz', |
|
103 | ('docs/man/ipython.1.gz', | |
104 | ['docs/man/ipython.1'], |
|
104 | ['docs/man/ipython.1'], | |
105 | 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'), |
|
105 | 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'), | |
106 | ] |
|
106 | ] | |
107 |
|
107 | |||
108 |
|
108 | |||
109 | [ target_update(*t) for t in to_update ] |
|
109 | [ target_update(*t) for t in to_update ] | |
110 |
|
110 | |||
111 | #--------------------------------------------------------------------------- |
|
111 | #--------------------------------------------------------------------------- | |
112 | # Find all the packages, package data, and data_files |
|
112 | # Find all the packages, package data, and data_files | |
113 | #--------------------------------------------------------------------------- |
|
113 | #--------------------------------------------------------------------------- | |
114 |
|
114 | |||
115 | packages = find_packages() |
|
115 | packages = find_packages() | |
116 | package_data = find_package_data() |
|
116 | package_data = find_package_data() | |
117 |
|
117 | |||
118 | data_files = find_data_files() |
|
118 | data_files = find_data_files() | |
119 |
|
119 | |||
120 | setup_args['packages'] = packages |
|
120 | setup_args['packages'] = packages | |
121 | setup_args['package_data'] = package_data |
|
121 | setup_args['package_data'] = package_data | |
122 | setup_args['data_files'] = data_files |
|
122 | setup_args['data_files'] = data_files | |
123 |
|
123 | |||
124 | #--------------------------------------------------------------------------- |
|
124 | #--------------------------------------------------------------------------- | |
125 | # custom distutils commands |
|
125 | # custom distutils commands | |
126 | #--------------------------------------------------------------------------- |
|
126 | #--------------------------------------------------------------------------- | |
127 | # imports here, so they are after setuptools import if there was one |
|
127 | # imports here, so they are after setuptools import if there was one | |
128 | from distutils.command.sdist import sdist |
|
128 | from distutils.command.sdist import sdist | |
129 | from distutils.command.upload import upload |
|
129 | from distutils.command.upload import upload | |
130 |
|
130 | |||
131 | class UploadWindowsInstallers(upload): |
|
131 | class UploadWindowsInstallers(upload): | |
132 |
|
132 | |||
133 | description = "Upload Windows installers to PyPI (only used from tools/release_windows.py)" |
|
133 | description = "Upload Windows installers to PyPI (only used from tools/release_windows.py)" | |
134 | user_options = upload.user_options + [ |
|
134 | user_options = upload.user_options + [ | |
135 | ('files=', 'f', 'exe file (or glob) to upload') |
|
135 | ('files=', 'f', 'exe file (or glob) to upload') | |
136 | ] |
|
136 | ] | |
137 | def initialize_options(self): |
|
137 | def initialize_options(self): | |
138 | upload.initialize_options(self) |
|
138 | upload.initialize_options(self) | |
139 | meta = self.distribution.metadata |
|
139 | meta = self.distribution.metadata | |
140 | base = '{name}-{version}'.format( |
|
140 | base = '{name}-{version}'.format( | |
141 | name=meta.get_name(), |
|
141 | name=meta.get_name(), | |
142 | version=meta.get_version() |
|
142 | version=meta.get_version() | |
143 | ) |
|
143 | ) | |
144 | self.files = os.path.join('dist', '%s.*.exe' % base) |
|
144 | self.files = os.path.join('dist', '%s.*.exe' % base) | |
145 |
|
145 | |||
146 | def run(self): |
|
146 | def run(self): | |
147 | for dist_file in glob(self.files): |
|
147 | for dist_file in glob(self.files): | |
148 | self.upload_file('bdist_wininst', 'any', dist_file) |
|
148 | self.upload_file('bdist_wininst', 'any', dist_file) | |
149 |
|
149 | |||
150 | setup_args['cmdclass'] = { |
|
150 | setup_args['cmdclass'] = { | |
151 | 'build_py': \ |
|
151 | 'build_py': \ | |
152 | check_package_data_first(git_prebuild('IPython')), |
|
152 | check_package_data_first(git_prebuild('IPython')), | |
153 | 'sdist' : git_prebuild('IPython', sdist), |
|
153 | 'sdist' : git_prebuild('IPython', sdist), | |
154 | 'upload_wininst' : UploadWindowsInstallers, |
|
154 | 'upload_wininst' : UploadWindowsInstallers, | |
155 | 'symlink': install_symlinked, |
|
155 | 'symlink': install_symlinked, | |
156 | 'install_lib_symlink': install_lib_symlink, |
|
156 | 'install_lib_symlink': install_lib_symlink, | |
157 | 'install_scripts_sym': install_scripts_for_symlink, |
|
157 | 'install_scripts_sym': install_scripts_for_symlink, | |
158 | 'unsymlink': unsymlink, |
|
158 | 'unsymlink': unsymlink, | |
159 | } |
|
159 | } | |
160 |
|
160 | |||
161 |
|
161 | |||
162 | #--------------------------------------------------------------------------- |
|
162 | #--------------------------------------------------------------------------- | |
163 | # Handle scripts, dependencies, and setuptools specific things |
|
163 | # Handle scripts, dependencies, and setuptools specific things | |
164 | #--------------------------------------------------------------------------- |
|
164 | #--------------------------------------------------------------------------- | |
165 |
|
165 | |||
166 | # For some commands, use setuptools. Note that we do NOT list install here! |
|
166 | # For some commands, use setuptools. Note that we do NOT list install here! | |
167 | # If you want a setuptools-enhanced install, just run 'setupegg.py install' |
|
167 | # If you want a setuptools-enhanced install, just run 'setupegg.py install' | |
168 | needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm', |
|
168 | needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm', | |
169 | 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel', |
|
169 | 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel', | |
170 | 'egg_info', 'easy_install', 'upload', 'install_egg_info', |
|
170 | 'egg_info', 'easy_install', 'upload', 'install_egg_info', | |
171 | )) |
|
171 | )) | |
172 |
|
172 | |||
173 | if len(needs_setuptools.intersection(sys.argv)) > 0: |
|
173 | if len(needs_setuptools.intersection(sys.argv)) > 0: | |
174 | import setuptools |
|
174 | import setuptools | |
175 | v = tuple(int(x) for x in setuptools.__version__.split('.')) |
|
175 | v = tuple(int(x) for x in setuptools.__version__.split('.')) | |
176 | if v < (18,5): |
|
176 | if v < (18,5): | |
177 | raise ValueError('Setuptools version >=18.5 is required, found: %s'%setuptools.__version__) |
|
177 | raise ValueError('Setuptools version >=18.5 is required, found: %s'%setuptools.__version__) | |
178 |
|
178 | |||
179 | # This dict is used for passing extra arguments that are setuptools |
|
179 | # This dict is used for passing extra arguments that are setuptools | |
180 | # specific to setup |
|
180 | # specific to setup | |
181 | setuptools_extra_args = {} |
|
181 | setuptools_extra_args = {} | |
182 |
|
182 | |||
183 | # setuptools requirements |
|
183 | # setuptools requirements | |
184 |
|
184 | |||
185 | extras_require = dict( |
|
185 | extras_require = dict( | |
186 | parallel = ['ipyparallel'], |
|
186 | parallel = ['ipyparallel'], | |
187 | qtconsole = ['qtconsole'], |
|
187 | qtconsole = ['qtconsole'], | |
188 | doc = ['Sphinx>=1.3'], |
|
188 | doc = ['Sphinx>=1.3'], | |
189 | test = ['nose>=0.10.1', 'requests', 'testpath'], |
|
189 | test = ['nose>=0.10.1', 'requests', 'testpath'], | |
190 | terminal = [], |
|
190 | terminal = [], | |
191 | kernel = ['ipykernel'], |
|
191 | kernel = ['ipykernel'], | |
192 | nbformat = ['nbformat'], |
|
192 | nbformat = ['nbformat'], | |
193 | notebook = ['notebook', 'ipywidgets'], |
|
193 | notebook = ['notebook', 'ipywidgets'], | |
194 | nbconvert = ['nbconvert'], |
|
194 | nbconvert = ['nbconvert'], | |
195 | ) |
|
195 | ) | |
196 | install_requires = [ |
|
196 | install_requires = [ | |
197 | 'setuptools>=18.5' |
|
197 | 'setuptools>=18.5' | |
198 | 'decorator', |
|
198 | 'decorator', | |
199 | 'pickleshare', |
|
199 | 'pickleshare', | |
200 | 'simplegeneric>0.8', |
|
200 | 'simplegeneric>0.8', | |
201 | 'traitlets', |
|
201 | 'traitlets', | |
202 | ] |
|
202 | ] | |
203 |
|
203 | |||
204 | # Platform-specific dependencies: |
|
204 | # Platform-specific dependencies: | |
205 | # This is the correct way to specify these, |
|
205 | # This is the correct way to specify these, | |
206 | # but requires pip >= 6. pip < 6 ignores these. |
|
206 | # but requires pip >= 6. pip < 6 ignores these. | |
207 |
|
207 | |||
208 | extras_require.update({ |
|
208 | extras_require.update({ | |
209 | ':sys_platform != "win32"': ['pexpect'], |
|
209 | ':sys_platform != "win32"': ['pexpect'], | |
210 | ':sys_platform == "darwin"': ['appnope'], |
|
210 | ':sys_platform == "darwin"': ['appnope'], | |
211 | ':sys_platform == "darwin" and platform_python_implementation == "CPython"': ['gnureadline'], |
|
211 | ':sys_platform == "darwin" and platform_python_implementation == "CPython"': ['gnureadline'], | |
212 | 'terminal:sys_platform == "win32"': ['pyreadline>=2'], |
|
212 | 'terminal:sys_platform == "win32"': ['pyreadline>=2'], | |
213 | 'test:python_version == "2.7"': ['mock'], |
|
213 | 'test:python_version == "2.7"': ['mock'], | |
214 | }) |
|
214 | }) | |
215 | # FIXME: re-specify above platform dependencies for pip < 6 |
|
215 | # FIXME: re-specify above platform dependencies for pip < 6 | |
216 | # These would result in non-portable bdists. |
|
216 | # These would result in non-portable bdists. | |
217 | if not any(arg.startswith('bdist') for arg in sys.argv): |
|
217 | if not any(arg.startswith('bdist') for arg in sys.argv): | |
218 | if sys.version_info < (3, 3): |
|
218 | if sys.version_info < (3, 3): | |
219 | extras_require['test'].append('mock') |
|
219 | extras_require['test'].append('mock') | |
220 |
|
220 | |||
221 | if sys.platform == 'darwin': |
|
221 | if sys.platform == 'darwin': | |
222 | install_requires.extend(['appnope']) |
|
222 | install_requires.extend(['appnope']) | |
223 | have_readline = False |
|
223 | have_readline = False | |
224 | try: |
|
224 | try: | |
225 | import readline |
|
225 | import readline | |
226 | except ImportError: |
|
226 | except ImportError: | |
227 | pass |
|
227 | pass | |
228 | else: |
|
228 | else: | |
229 | if 'libedit' not in readline.__doc__: |
|
229 | if 'libedit' not in readline.__doc__: | |
230 | have_readline = True |
|
230 | have_readline = True | |
231 | if not have_readline: |
|
231 | if not have_readline: | |
232 | install_requires.extend(['gnureadline']) |
|
232 | install_requires.extend(['gnureadline']) | |
233 |
|
233 | |||
234 | if sys.platform.startswith('win'): |
|
234 | if sys.platform.startswith('win'): | |
235 | extras_require['terminal'].append('pyreadline>=2.0') |
|
235 | extras_require['terminal'].append('pyreadline>=2.0') | |
236 | else: |
|
236 | else: | |
237 | install_requires.append('pexpect') |
|
237 | install_requires.append('pexpect') | |
238 |
|
238 | |||
239 | # workaround pypa/setuptools#147, where setuptools misspells |
|
239 | # workaround pypa/setuptools#147, where setuptools misspells | |
240 | # platform_python_implementation as python_implementation |
|
240 | # platform_python_implementation as python_implementation | |
241 | if 'setuptools' in sys.modules: |
|
241 | if 'setuptools' in sys.modules: | |
242 | for key in list(extras_require): |
|
242 | for key in list(extras_require): | |
243 | if 'platform_python_implementation' in key: |
|
243 | if 'platform_python_implementation' in key: | |
244 | new_key = key.replace('platform_python_implementation', 'python_implementation') |
|
244 | new_key = key.replace('platform_python_implementation', 'python_implementation') | |
245 | extras_require[new_key] = extras_require.pop(key) |
|
245 | extras_require[new_key] = extras_require.pop(key) | |
246 |
|
246 | |||
247 | everything = set() |
|
247 | everything = set() | |
248 | for key, deps in extras_require.items(): |
|
248 | for key, deps in extras_require.items(): | |
249 | if ':' not in key: |
|
249 | if ':' not in key: | |
250 | everything.update(deps) |
|
250 | everything.update(deps) | |
251 | extras_require['all'] = everything |
|
251 | extras_require['all'] = everything | |
252 |
|
252 | |||
253 | if 'setuptools' in sys.modules: |
|
253 | if 'setuptools' in sys.modules: | |
254 | setuptools_extra_args['zip_safe'] = False |
|
254 | setuptools_extra_args['zip_safe'] = False | |
255 | setuptools_extra_args['entry_points'] = { |
|
255 | setuptools_extra_args['entry_points'] = { | |
256 | 'console_scripts': find_entry_points(), |
|
256 | 'console_scripts': find_entry_points(), | |
257 | 'pygments.lexers': [ |
|
257 | 'pygments.lexers': [ | |
258 | 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer', |
|
258 | 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer', | |
259 | 'ipython = IPython.lib.lexers:IPythonLexer', |
|
259 | 'ipython = IPython.lib.lexers:IPythonLexer', | |
260 | 'ipython3 = IPython.lib.lexers:IPython3Lexer', |
|
260 | 'ipython3 = IPython.lib.lexers:IPython3Lexer', | |
261 | ], |
|
261 | ], | |
262 | } |
|
262 | } | |
263 | setup_args['extras_require'] = extras_require |
|
263 | setup_args['extras_require'] = extras_require | |
264 | requires = setup_args['install_requires'] = install_requires |
|
264 | requires = setup_args['install_requires'] = install_requires | |
265 |
|
265 | |||
266 | # Script to be run by the windows binary installer after the default setup |
|
266 | # Script to be run by the windows binary installer after the default setup | |
267 | # routine, to add shortcuts and similar windows-only things. Windows |
|
267 | # routine, to add shortcuts and similar windows-only things. Windows | |
268 | # post-install scripts MUST reside in the scripts/ dir, otherwise distutils |
|
268 | # post-install scripts MUST reside in the scripts/ dir, otherwise distutils | |
269 | # doesn't find them. |
|
269 | # doesn't find them. | |
270 | if 'bdist_wininst' in sys.argv: |
|
270 | if 'bdist_wininst' in sys.argv: | |
271 | if len(sys.argv) > 2 and \ |
|
271 | if len(sys.argv) > 2 and \ | |
272 | ('sdist' in sys.argv or 'bdist_rpm' in sys.argv): |
|
272 | ('sdist' in sys.argv or 'bdist_rpm' in sys.argv): | |
273 | print("ERROR: bdist_wininst must be run alone. Exiting.", file=sys.stderr) |
|
273 | print("ERROR: bdist_wininst must be run alone. Exiting.", file=sys.stderr) | |
274 | sys.exit(1) |
|
274 | sys.exit(1) | |
275 | setup_args['data_files'].append( |
|
275 | setup_args['data_files'].append( | |
276 | ['Scripts', ('scripts/ipython.ico', 'scripts/ipython_nb.ico')]) |
|
276 | ['Scripts', ('scripts/ipython.ico', 'scripts/ipython_nb.ico')]) | |
277 | setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')] |
|
277 | setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')] | |
278 | setup_args['options'] = {"bdist_wininst": |
|
278 | setup_args['options'] = {"bdist_wininst": | |
279 | {"install_script": |
|
279 | {"install_script": | |
280 | "ipython_win_post_install.py"}} |
|
280 | "ipython_win_post_install.py"}} | |
281 |
|
281 | |||
282 | else: |
|
282 | else: | |
283 | # scripts has to be a non-empty list, or install_scripts isn't called |
|
283 | # scripts has to be a non-empty list, or install_scripts isn't called | |
284 | setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] |
|
284 | setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] | |
285 |
|
285 | |||
286 | setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt |
|
286 | setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt | |
287 |
|
287 | |||
288 | #--------------------------------------------------------------------------- |
|
288 | #--------------------------------------------------------------------------- | |
289 | # Do the actual setup now |
|
289 | # Do the actual setup now | |
290 | #--------------------------------------------------------------------------- |
|
290 | #--------------------------------------------------------------------------- | |
291 |
|
291 | |||
292 | setup_args.update(setuptools_extra_args) |
|
292 | setup_args.update(setuptools_extra_args) | |
293 |
|
293 | |||
|
294 | ||||
|
295 | # loose as `.dev` is suppose to be invalid | |||
|
296 | loose_pep440re = re.compile('^(\d+)\.(\d+)\.(\d+((a|b|rc)\d+)?)(\.post\d+)?(\.dev\d*)?$') | |||
|
297 | ||||
294 | def main(): |
|
298 | def main(): | |
|
299 | import IPython.core.release as r | |||
|
300 | if not loose_pep440re.match(r.version): | |||
|
301 | raise ValueError("Version number '%s' is not valid (should match [N!]N(.N)*[{a|b|rc}N][.postN][.devN])" % r.version) | |||
295 | setup(**setup_args) |
|
302 | setup(**setup_args) | |
296 |
|
303 | |||
297 | if __name__ == '__main__': |
|
304 | if __name__ == '__main__': | |
298 | main() |
|
305 | main() |
General Comments 0
You need to be logged in to leave comments.
Login now