Show More
@@ -1,118 +1,123 b'' | |||||
1 | # http://travis-ci.org/#!/ipython/ipython |
|
1 | # http://travis-ci.org/#!/ipython/ipython | |
2 | language: python |
|
2 | language: python | |
3 | os: linux |
|
3 | os: linux | |
4 |
|
4 | |||
5 | addons: |
|
5 | addons: | |
6 | apt: |
|
6 | apt: | |
7 | packages: |
|
7 | packages: | |
8 | - graphviz |
|
8 | - graphviz | |
9 |
|
9 | |||
10 | python: |
|
10 | python: | |
11 | - 3.6 |
|
11 | - 3.6 | |
12 |
|
12 | |||
13 | sudo: false |
|
13 | sudo: false | |
14 |
|
14 | |||
15 | env: |
|
15 | env: | |
16 | global: |
|
16 | global: | |
17 | - PATH=$TRAVIS_BUILD_DIR/pandoc:$PATH |
|
17 | - PATH=$TRAVIS_BUILD_DIR/pandoc:$PATH | |
18 |
|
18 | |||
19 | group: edge |
|
19 | group: edge | |
20 |
|
20 | |||
21 | before_install: |
|
21 | before_install: | |
22 | - | |
|
22 | - | | |
23 | # install Python on macOS |
|
23 | # install Python on macOS | |
24 | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then |
|
24 | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then | |
25 | env | sort |
|
25 | env | sort | |
26 | if ! which python$TRAVIS_PYTHON_VERSION; then |
|
26 | if ! which python$TRAVIS_PYTHON_VERSION; then | |
27 | HOMEBREW_NO_AUTO_UPDATE=1 brew tap minrk/homebrew-python-frameworks |
|
27 | HOMEBREW_NO_AUTO_UPDATE=1 brew tap minrk/homebrew-python-frameworks | |
28 | HOMEBREW_NO_AUTO_UPDATE=1 brew cask install python-framework-${TRAVIS_PYTHON_VERSION/./} |
|
28 | HOMEBREW_NO_AUTO_UPDATE=1 brew cask install python-framework-${TRAVIS_PYTHON_VERSION/./} | |
29 | fi |
|
29 | fi | |
30 | python3 -m pip install virtualenv |
|
30 | python3 -m pip install virtualenv | |
31 | python3 -m virtualenv -p $(which python$TRAVIS_PYTHON_VERSION) ~/travis-env |
|
31 | python3 -m virtualenv -p $(which python$TRAVIS_PYTHON_VERSION) ~/travis-env | |
32 | source ~/travis-env/bin/activate |
|
32 | source ~/travis-env/bin/activate | |
33 | fi |
|
33 | fi | |
34 | - python --version |
|
34 | - python --version | |
35 |
|
35 | |||
36 | install: |
|
36 | install: | |
37 | - pip install pip --upgrade |
|
37 | - pip install pip --upgrade | |
38 | - pip install setuptools --upgrade |
|
38 | - pip install setuptools --upgrade | |
|
39 | - if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then | |||
|
40 | echo "for the tiem being still test on 3.6"; | |||
|
41 | sed -i bkp s/7/6/g setup.py; | |||
|
42 | git diff; | |||
|
43 | fi | |||
39 | - pip install -e file://$PWD#egg=ipython[test] --upgrade |
|
44 | - pip install -e file://$PWD#egg=ipython[test] --upgrade | |
40 | - pip install trio curio --upgrade --upgrade-strategy eager |
|
45 | - pip install trio curio --upgrade --upgrade-strategy eager | |
41 | - pip install pytest 'matplotlib !=3.2.0' mypy |
|
46 | - pip install pytest 'matplotlib !=3.2.0' mypy | |
42 | - pip install codecov check-manifest --upgrade |
|
47 | - pip install codecov check-manifest --upgrade | |
43 |
|
48 | |||
44 | script: |
|
49 | script: | |
45 | - check-manifest |
|
50 | - check-manifest | |
46 | - | |
|
51 | - | | |
47 | if [[ "$TRAVIS_PYTHON_VERSION" == "nightly" ]]; then |
|
52 | if [[ "$TRAVIS_PYTHON_VERSION" == "nightly" ]]; then | |
48 | # on nightly fake parso known the grammar |
|
53 | # on nightly fake parso known the grammar | |
49 | cp /home/travis/virtualenv/python3.9-dev/lib/python3.9/site-packages/parso/python/grammar38.txt /home/travis/virtualenv/python3.9-dev/lib/python3.9/site-packages/parso/python/grammar39.txt |
|
54 | cp /home/travis/virtualenv/python3.9-dev/lib/python3.9/site-packages/parso/python/grammar38.txt /home/travis/virtualenv/python3.9-dev/lib/python3.9/site-packages/parso/python/grammar39.txt | |
50 | fi |
|
55 | fi | |
51 | - cd /tmp && iptest --coverage xml && cd - |
|
56 | - cd /tmp && iptest --coverage xml && cd - | |
52 | - pytest IPython |
|
57 | - pytest IPython | |
53 | - mypy --ignore-missing-imports -m IPython.terminal.ptutils |
|
58 | - mypy --ignore-missing-imports -m IPython.terminal.ptutils | |
54 | # On the latest Python (on Linux) only, make sure that the docs build. |
|
59 | # On the latest Python (on Linux) only, make sure that the docs build. | |
55 | - | |
|
60 | - | | |
56 | if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then |
|
61 | if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | |
57 | pip install -r docs/requirements.txt |
|
62 | pip install -r docs/requirements.txt | |
58 | python tools/fixup_whats_new_pr.py |
|
63 | python tools/fixup_whats_new_pr.py | |
59 | make -C docs/ html SPHINXOPTS="-W" |
|
64 | make -C docs/ html SPHINXOPTS="-W" | |
60 | fi |
|
65 | fi | |
61 |
|
66 | |||
62 | after_success: |
|
67 | after_success: | |
63 | - cp /tmp/ipy_coverage.xml ./ |
|
68 | - cp /tmp/ipy_coverage.xml ./ | |
64 | - cp /tmp/.coverage ./ |
|
69 | - cp /tmp/.coverage ./ | |
65 | - codecov |
|
70 | - codecov | |
66 |
|
71 | |||
67 | matrix: |
|
72 | matrix: | |
68 | include: |
|
73 | include: | |
69 | - arch: amd64 |
|
74 | - arch: amd64 | |
70 | python: "3.7" |
|
75 | python: "3.7" | |
71 | dist: xenial |
|
76 | dist: xenial | |
72 | sudo: true |
|
77 | sudo: true | |
73 | - arch: amd64 |
|
78 | - arch: amd64 | |
74 | python: "3.8-dev" |
|
79 | python: "3.8-dev" | |
75 | dist: xenial |
|
80 | dist: xenial | |
76 | sudo: true |
|
81 | sudo: true | |
77 | - arch: amd64 |
|
82 | - arch: amd64 | |
78 | python: "3.7-dev" |
|
83 | python: "3.7-dev" | |
79 | dist: xenial |
|
84 | dist: xenial | |
80 | sudo: true |
|
85 | sudo: true | |
81 | - arch: amd64 |
|
86 | - arch: amd64 | |
82 | python: "nightly" |
|
87 | python: "nightly" | |
83 | dist: xenial |
|
88 | dist: xenial | |
84 | sudo: true |
|
89 | sudo: true | |
85 | - arch: arm64 |
|
90 | - arch: arm64 | |
86 | python: "nightly" |
|
91 | python: "nightly" | |
87 | dist: bionic |
|
92 | dist: bionic | |
88 | env: ARM64=True |
|
93 | env: ARM64=True | |
89 | sudo: true |
|
94 | sudo: true | |
90 | - os: osx |
|
95 | - os: osx | |
91 | language: generic |
|
96 | language: generic | |
92 | python: 3.6 |
|
97 | python: 3.6 | |
93 | env: TRAVIS_PYTHON_VERSION=3.6 |
|
98 | env: TRAVIS_PYTHON_VERSION=3.6 | |
94 | - os: osx |
|
99 | - os: osx | |
95 | language: generic |
|
100 | language: generic | |
96 | python: 3.7 |
|
101 | python: 3.7 | |
97 | env: TRAVIS_PYTHON_VERSION=3.7 |
|
102 | env: TRAVIS_PYTHON_VERSION=3.7 | |
98 | allow_failures: |
|
103 | allow_failures: | |
99 | - python: nightly |
|
104 | - python: nightly | |
100 |
|
105 | |||
101 | before_deploy: |
|
106 | before_deploy: | |
102 | - rm -rf dist/ |
|
107 | - rm -rf dist/ | |
103 | - python setup.py sdist |
|
108 | - python setup.py sdist | |
104 | - python setup.py bdist_wheel |
|
109 | - python setup.py bdist_wheel | |
105 |
|
110 | |||
106 | deploy: |
|
111 | deploy: | |
107 | provider: releases |
|
112 | provider: releases | |
108 | api_key: |
|
113 | api_key: | |
109 | secure: Y/Ae9tYs5aoBU8bDjN2YrwGG6tCbezj/h3Lcmtx8HQavSbBgXnhnZVRb2snOKD7auqnqjfT/7QMm4ZyKvaOEgyggGktKqEKYHC8KOZ7yp8I5/UMDtk6j9TnXpSqqBxPiud4MDV76SfRYEQiaDoG4tGGvSfPJ9KcNjKrNvSyyxns= |
|
114 | secure: Y/Ae9tYs5aoBU8bDjN2YrwGG6tCbezj/h3Lcmtx8HQavSbBgXnhnZVRb2snOKD7auqnqjfT/7QMm4ZyKvaOEgyggGktKqEKYHC8KOZ7yp8I5/UMDtk6j9TnXpSqqBxPiud4MDV76SfRYEQiaDoG4tGGvSfPJ9KcNjKrNvSyyxns= | |
110 | file: dist/* |
|
115 | file: dist/* | |
111 | file_glob: true |
|
116 | file_glob: true | |
112 | skip_cleanup: true |
|
117 | skip_cleanup: true | |
113 | on: |
|
118 | on: | |
114 | repo: ipython/ipython |
|
119 | repo: ipython/ipython | |
115 | all_branches: true # Backports are released from e.g. 5.x branch |
|
120 | all_branches: true # Backports are released from e.g. 5.x branch | |
116 | tags: true |
|
121 | tags: true | |
117 | python: 3.6 # Any version should work, but we only need one |
|
122 | python: 3.6 # Any version should work, but we only need one | |
118 | condition: $TRAVIS_OS_NAME = "linux" |
|
123 | condition: $TRAVIS_OS_NAME = "linux" |
@@ -1,262 +1,263 b'' | |||||
1 | #!/usr/bin/env python3 |
|
1 | #!/usr/bin/env python3 | |
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 | from __future__ import print_function |
|
20 | from __future__ import print_function | |
21 |
|
21 | |||
22 | import os |
|
22 | import os | |
23 | import sys |
|
23 | import sys | |
24 |
|
24 | |||
25 | # **Python version check** |
|
25 | # **Python version check** | |
26 | # |
|
26 | # | |
27 | # This check is also made in IPython/__init__, don't forget to update both when |
|
27 | # This check is also made in IPython/__init__, don't forget to update both when | |
28 | # changing Python version requirements. |
|
28 | # changing Python version requirements. | |
29 |
if sys.version_info < (3, |
|
29 | if sys.version_info < (3, 7): | |
30 | pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.' |
|
30 | pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.' | |
31 | try: |
|
31 | try: | |
32 | import pip |
|
32 | import pip | |
33 | pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]]) |
|
33 | pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]]) | |
34 | if pip_version < (9, 0, 1) : |
|
34 | if pip_version < (9, 0, 1) : | |
35 | pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\ |
|
35 | pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\ | |
36 | 'pip {} detected.'.format(pip.__version__) |
|
36 | 'pip {} detected.'.format(pip.__version__) | |
37 | else: |
|
37 | else: | |
38 | # pip is new enough - it must be something else |
|
38 | # pip is new enough - it must be something else | |
39 | pip_message = '' |
|
39 | pip_message = '' | |
40 | except Exception: |
|
40 | except Exception: | |
41 | pass |
|
41 | pass | |
42 |
|
42 | |||
43 |
|
43 | |||
44 | error = """ |
|
44 | error = """ | |
45 |
IPython 7.1 |
|
45 | IPython 7.17+ supports Python 3.7 and above, following NEP 29. | |
46 | When using Python 2.7, please install IPython 5.x LTS Long Term Support version. |
|
46 | When using Python 2.7, please install IPython 5.x LTS Long Term Support version. | |
47 | Python 3.3 and 3.4 were supported up to IPython 6.x. |
|
47 | Python 3.3 and 3.4 were supported up to IPython 6.x. | |
48 | Python 3.5 was supported with IPython 7.0 to 7.9. |
|
48 | Python 3.5 was supported with IPython 7.0 to 7.9. | |
|
49 | Python 3.6 was supported with IPython up to 7.16. | |||
49 |
|
50 | |||
50 | See IPython `README.rst` file for more information: |
|
51 | See IPython `README.rst` file for more information: | |
51 |
|
52 | |||
52 | https://github.com/ipython/ipython/blob/master/README.rst |
|
53 | https://github.com/ipython/ipython/blob/master/README.rst | |
53 |
|
54 | |||
54 | Python {py} detected. |
|
55 | Python {py} detected. | |
55 | {pip} |
|
56 | {pip} | |
56 | """.format(py=sys.version_info, pip=pip_message ) |
|
57 | """.format(py=sys.version_info, pip=pip_message ) | |
57 |
|
58 | |||
58 | print(error, file=sys.stderr) |
|
59 | print(error, file=sys.stderr) | |
59 | sys.exit(1) |
|
60 | sys.exit(1) | |
60 |
|
61 | |||
61 | # At least we're on the python version we need, move on. |
|
62 | # At least we're on the python version we need, move on. | |
62 |
|
63 | |||
63 | # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly |
|
64 | # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly | |
64 | # update it when the contents of directories change. |
|
65 | # update it when the contents of directories change. | |
65 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') |
|
66 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') | |
66 |
|
67 | |||
67 | from distutils.core import setup |
|
68 | from distutils.core import setup | |
68 |
|
69 | |||
69 | # Our own imports |
|
70 | # Our own imports | |
70 | from setupbase import target_update |
|
71 | from setupbase import target_update | |
71 |
|
72 | |||
72 | from setupbase import ( |
|
73 | from setupbase import ( | |
73 | setup_args, |
|
74 | setup_args, | |
74 | find_packages, |
|
75 | find_packages, | |
75 | find_package_data, |
|
76 | find_package_data, | |
76 | check_package_data_first, |
|
77 | check_package_data_first, | |
77 | find_entry_points, |
|
78 | find_entry_points, | |
78 | build_scripts_entrypt, |
|
79 | build_scripts_entrypt, | |
79 | find_data_files, |
|
80 | find_data_files, | |
80 | git_prebuild, |
|
81 | git_prebuild, | |
81 | install_symlinked, |
|
82 | install_symlinked, | |
82 | install_lib_symlink, |
|
83 | install_lib_symlink, | |
83 | install_scripts_for_symlink, |
|
84 | install_scripts_for_symlink, | |
84 | unsymlink, |
|
85 | unsymlink, | |
85 | ) |
|
86 | ) | |
86 |
|
87 | |||
87 | isfile = os.path.isfile |
|
88 | isfile = os.path.isfile | |
88 | pjoin = os.path.join |
|
89 | pjoin = os.path.join | |
89 |
|
90 | |||
90 | #------------------------------------------------------------------------------- |
|
91 | #------------------------------------------------------------------------------- | |
91 | # Handle OS specific things |
|
92 | # Handle OS specific things | |
92 | #------------------------------------------------------------------------------- |
|
93 | #------------------------------------------------------------------------------- | |
93 |
|
94 | |||
94 | if os.name in ('nt','dos'): |
|
95 | if os.name in ('nt','dos'): | |
95 | os_name = 'windows' |
|
96 | os_name = 'windows' | |
96 | else: |
|
97 | else: | |
97 | os_name = os.name |
|
98 | os_name = os.name | |
98 |
|
99 | |||
99 | # Under Windows, 'sdist' has not been supported. Now that the docs build with |
|
100 | # Under Windows, 'sdist' has not been supported. Now that the docs build with | |
100 | # Sphinx it might work, but let's not turn it on until someone confirms that it |
|
101 | # Sphinx it might work, but let's not turn it on until someone confirms that it | |
101 | # actually works. |
|
102 | # actually works. | |
102 | if os_name == 'windows' and 'sdist' in sys.argv: |
|
103 | if os_name == 'windows' and 'sdist' in sys.argv: | |
103 | print('The sdist command is not available under Windows. Exiting.') |
|
104 | print('The sdist command is not available under Windows. Exiting.') | |
104 | sys.exit(1) |
|
105 | sys.exit(1) | |
105 |
|
106 | |||
106 |
|
107 | |||
107 | #------------------------------------------------------------------------------- |
|
108 | #------------------------------------------------------------------------------- | |
108 | # Things related to the IPython documentation |
|
109 | # Things related to the IPython documentation | |
109 | #------------------------------------------------------------------------------- |
|
110 | #------------------------------------------------------------------------------- | |
110 |
|
111 | |||
111 | # update the manuals when building a source dist |
|
112 | # update the manuals when building a source dist | |
112 | if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): |
|
113 | if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): | |
113 |
|
114 | |||
114 | # List of things to be updated. Each entry is a triplet of args for |
|
115 | # List of things to be updated. Each entry is a triplet of args for | |
115 | # target_update() |
|
116 | # target_update() | |
116 | to_update = [ |
|
117 | to_update = [ | |
117 | ('docs/man/ipython.1.gz', |
|
118 | ('docs/man/ipython.1.gz', | |
118 | ['docs/man/ipython.1'], |
|
119 | ['docs/man/ipython.1'], | |
119 | 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'), |
|
120 | 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'), | |
120 | ] |
|
121 | ] | |
121 |
|
122 | |||
122 |
|
123 | |||
123 | [ target_update(*t) for t in to_update ] |
|
124 | [ target_update(*t) for t in to_update ] | |
124 |
|
125 | |||
125 | #--------------------------------------------------------------------------- |
|
126 | #--------------------------------------------------------------------------- | |
126 | # Find all the packages, package data, and data_files |
|
127 | # Find all the packages, package data, and data_files | |
127 | #--------------------------------------------------------------------------- |
|
128 | #--------------------------------------------------------------------------- | |
128 |
|
129 | |||
129 | packages = find_packages() |
|
130 | packages = find_packages() | |
130 | package_data = find_package_data() |
|
131 | package_data = find_package_data() | |
131 |
|
132 | |||
132 | data_files = find_data_files() |
|
133 | data_files = find_data_files() | |
133 |
|
134 | |||
134 | setup_args['packages'] = packages |
|
135 | setup_args['packages'] = packages | |
135 | setup_args['package_data'] = package_data |
|
136 | setup_args['package_data'] = package_data | |
136 | setup_args['data_files'] = data_files |
|
137 | setup_args['data_files'] = data_files | |
137 |
|
138 | |||
138 | #--------------------------------------------------------------------------- |
|
139 | #--------------------------------------------------------------------------- | |
139 | # custom distutils commands |
|
140 | # custom distutils commands | |
140 | #--------------------------------------------------------------------------- |
|
141 | #--------------------------------------------------------------------------- | |
141 | # imports here, so they are after setuptools import if there was one |
|
142 | # imports here, so they are after setuptools import if there was one | |
142 | from distutils.command.sdist import sdist |
|
143 | from distutils.command.sdist import sdist | |
143 |
|
144 | |||
144 | setup_args['cmdclass'] = { |
|
145 | setup_args['cmdclass'] = { | |
145 | 'build_py': \ |
|
146 | 'build_py': \ | |
146 | check_package_data_first(git_prebuild('IPython')), |
|
147 | check_package_data_first(git_prebuild('IPython')), | |
147 | 'sdist' : git_prebuild('IPython', sdist), |
|
148 | 'sdist' : git_prebuild('IPython', sdist), | |
148 | 'symlink': install_symlinked, |
|
149 | 'symlink': install_symlinked, | |
149 | 'install_lib_symlink': install_lib_symlink, |
|
150 | 'install_lib_symlink': install_lib_symlink, | |
150 | 'install_scripts_sym': install_scripts_for_symlink, |
|
151 | 'install_scripts_sym': install_scripts_for_symlink, | |
151 | 'unsymlink': unsymlink, |
|
152 | 'unsymlink': unsymlink, | |
152 | } |
|
153 | } | |
153 |
|
154 | |||
154 |
|
155 | |||
155 | #--------------------------------------------------------------------------- |
|
156 | #--------------------------------------------------------------------------- | |
156 | # Handle scripts, dependencies, and setuptools specific things |
|
157 | # Handle scripts, dependencies, and setuptools specific things | |
157 | #--------------------------------------------------------------------------- |
|
158 | #--------------------------------------------------------------------------- | |
158 |
|
159 | |||
159 | # For some commands, use setuptools. Note that we do NOT list install here! |
|
160 | # For some commands, use setuptools. Note that we do NOT list install here! | |
160 | # If you want a setuptools-enhanced install, just run 'setupegg.py install' |
|
161 | # If you want a setuptools-enhanced install, just run 'setupegg.py install' | |
161 | needs_setuptools = {'develop', 'release', 'bdist_egg', 'bdist_rpm', |
|
162 | needs_setuptools = {'develop', 'release', 'bdist_egg', 'bdist_rpm', | |
162 | 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel', |
|
163 | 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel', | |
163 | 'egg_info', 'easy_install', 'upload', 'install_egg_info', |
|
164 | 'egg_info', 'easy_install', 'upload', 'install_egg_info', | |
164 | } |
|
165 | } | |
165 |
|
166 | |||
166 | if len(needs_setuptools.intersection(sys.argv)) > 0: |
|
167 | if len(needs_setuptools.intersection(sys.argv)) > 0: | |
167 | import setuptools |
|
168 | import setuptools | |
168 |
|
169 | |||
169 | # This dict is used for passing extra arguments that are setuptools |
|
170 | # This dict is used for passing extra arguments that are setuptools | |
170 | # specific to setup |
|
171 | # specific to setup | |
171 | setuptools_extra_args = {} |
|
172 | setuptools_extra_args = {} | |
172 |
|
173 | |||
173 | # setuptools requirements |
|
174 | # setuptools requirements | |
174 |
|
175 | |||
175 | extras_require = dict( |
|
176 | extras_require = dict( | |
176 | parallel = ['ipyparallel'], |
|
177 | parallel = ['ipyparallel'], | |
177 | qtconsole = ['qtconsole'], |
|
178 | qtconsole = ['qtconsole'], | |
178 | doc = ['Sphinx>=1.3'], |
|
179 | doc = ['Sphinx>=1.3'], | |
179 | test = ['nose>=0.10.1', 'requests', 'testpath', 'pygments', 'nbformat', 'ipykernel', 'numpy>=1.14'], |
|
180 | test = ['nose>=0.10.1', 'requests', 'testpath', 'pygments', 'nbformat', 'ipykernel', 'numpy>=1.14'], | |
180 | terminal = [], |
|
181 | terminal = [], | |
181 | kernel = ['ipykernel'], |
|
182 | kernel = ['ipykernel'], | |
182 | nbformat = ['nbformat'], |
|
183 | nbformat = ['nbformat'], | |
183 | notebook = ['notebook', 'ipywidgets'], |
|
184 | notebook = ['notebook', 'ipywidgets'], | |
184 | nbconvert = ['nbconvert'], |
|
185 | nbconvert = ['nbconvert'], | |
185 | ) |
|
186 | ) | |
186 |
|
187 | |||
187 | install_requires = [ |
|
188 | install_requires = [ | |
188 | 'setuptools>=18.5', |
|
189 | 'setuptools>=18.5', | |
189 | 'jedi>=0.10', |
|
190 | 'jedi>=0.10', | |
190 | 'decorator', |
|
191 | 'decorator', | |
191 | 'pickleshare', |
|
192 | 'pickleshare', | |
192 | 'traitlets>=4.2', |
|
193 | 'traitlets>=4.2', | |
193 | 'prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1', |
|
194 | 'prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1', | |
194 | 'pygments', |
|
195 | 'pygments', | |
195 | 'backcall', |
|
196 | 'backcall', | |
196 | ] |
|
197 | ] | |
197 |
|
198 | |||
198 | # Platform-specific dependencies: |
|
199 | # Platform-specific dependencies: | |
199 | # This is the correct way to specify these, |
|
200 | # This is the correct way to specify these, | |
200 | # but requires pip >= 6. pip < 6 ignores these. |
|
201 | # but requires pip >= 6. pip < 6 ignores these. | |
201 |
|
202 | |||
202 | extras_require.update({ |
|
203 | extras_require.update({ | |
203 | ':sys_platform != "win32"': ['pexpect'], |
|
204 | ':sys_platform != "win32"': ['pexpect'], | |
204 | ':sys_platform == "darwin"': ['appnope'], |
|
205 | ':sys_platform == "darwin"': ['appnope'], | |
205 | ':sys_platform == "win32"': ['colorama'], |
|
206 | ':sys_platform == "win32"': ['colorama'], | |
206 | }) |
|
207 | }) | |
207 | # FIXME: re-specify above platform dependencies for pip < 6 |
|
208 | # FIXME: re-specify above platform dependencies for pip < 6 | |
208 | # These would result in non-portable bdists. |
|
209 | # These would result in non-portable bdists. | |
209 | if not any(arg.startswith('bdist') for arg in sys.argv): |
|
210 | if not any(arg.startswith('bdist') for arg in sys.argv): | |
210 | if sys.platform == 'darwin': |
|
211 | if sys.platform == 'darwin': | |
211 | install_requires.extend(['appnope']) |
|
212 | install_requires.extend(['appnope']) | |
212 |
|
213 | |||
213 | if not sys.platform.startswith('win'): |
|
214 | if not sys.platform.startswith('win'): | |
214 | install_requires.append('pexpect') |
|
215 | install_requires.append('pexpect') | |
215 |
|
216 | |||
216 | # workaround pypa/setuptools#147, where setuptools misspells |
|
217 | # workaround pypa/setuptools#147, where setuptools misspells | |
217 | # platform_python_implementation as python_implementation |
|
218 | # platform_python_implementation as python_implementation | |
218 | if 'setuptools' in sys.modules: |
|
219 | if 'setuptools' in sys.modules: | |
219 | for key in list(extras_require): |
|
220 | for key in list(extras_require): | |
220 | if 'platform_python_implementation' in key: |
|
221 | if 'platform_python_implementation' in key: | |
221 | new_key = key.replace('platform_python_implementation', 'python_implementation') |
|
222 | new_key = key.replace('platform_python_implementation', 'python_implementation') | |
222 | extras_require[new_key] = extras_require.pop(key) |
|
223 | extras_require[new_key] = extras_require.pop(key) | |
223 |
|
224 | |||
224 | everything = set() |
|
225 | everything = set() | |
225 | for key, deps in extras_require.items(): |
|
226 | for key, deps in extras_require.items(): | |
226 | if ':' not in key: |
|
227 | if ':' not in key: | |
227 | everything.update(deps) |
|
228 | everything.update(deps) | |
228 | extras_require['all'] = list(sorted(everything)) |
|
229 | extras_require['all'] = list(sorted(everything)) | |
229 |
|
230 | |||
230 | if 'setuptools' in sys.modules: |
|
231 | if 'setuptools' in sys.modules: | |
231 |
setuptools_extra_args['python_requires'] = '>=3. |
|
232 | setuptools_extra_args['python_requires'] = '>=3.7' | |
232 | setuptools_extra_args['zip_safe'] = False |
|
233 | setuptools_extra_args['zip_safe'] = False | |
233 | setuptools_extra_args['entry_points'] = { |
|
234 | setuptools_extra_args['entry_points'] = { | |
234 | 'console_scripts': find_entry_points(), |
|
235 | 'console_scripts': find_entry_points(), | |
235 | 'pygments.lexers': [ |
|
236 | 'pygments.lexers': [ | |
236 | 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer', |
|
237 | 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer', | |
237 | 'ipython = IPython.lib.lexers:IPythonLexer', |
|
238 | 'ipython = IPython.lib.lexers:IPythonLexer', | |
238 | 'ipython3 = IPython.lib.lexers:IPython3Lexer', |
|
239 | 'ipython3 = IPython.lib.lexers:IPython3Lexer', | |
239 | ], |
|
240 | ], | |
240 | } |
|
241 | } | |
241 | setup_args['extras_require'] = extras_require |
|
242 | setup_args['extras_require'] = extras_require | |
242 | setup_args['install_requires'] = install_requires |
|
243 | setup_args['install_requires'] = install_requires | |
243 |
|
244 | |||
244 | else: |
|
245 | else: | |
245 | # scripts has to be a non-empty list, or install_scripts isn't called |
|
246 | # scripts has to be a non-empty list, or install_scripts isn't called | |
246 | setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] |
|
247 | setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] | |
247 |
|
248 | |||
248 | setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt |
|
249 | setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt | |
249 |
|
250 | |||
250 | #--------------------------------------------------------------------------- |
|
251 | #--------------------------------------------------------------------------- | |
251 | # Do the actual setup now |
|
252 | # Do the actual setup now | |
252 | #--------------------------------------------------------------------------- |
|
253 | #--------------------------------------------------------------------------- | |
253 |
|
254 | |||
254 | setup_args.update(setuptools_extra_args) |
|
255 | setup_args.update(setuptools_extra_args) | |
255 |
|
256 | |||
256 |
|
257 | |||
257 |
|
258 | |||
258 | def main(): |
|
259 | def main(): | |
259 | setup(**setup_args) |
|
260 | setup(**setup_args) | |
260 |
|
261 | |||
261 | if __name__ == '__main__': |
|
262 | if __name__ == '__main__': | |
262 | main() |
|
263 | main() |
General Comments 0
You need to be logged in to leave comments.
Login now