##// END OF EJS Templates
pyproject.toml, setup.py: Declare backend-path (#14313)...
M Bussonnier -
r28603:643c75d0 merge
parent child Browse files
Show More
@@ -0,0 +1,2 b''
1 # See https://setuptools.pypa.io/en/latest/build_meta.html#dynamic-build-dependencies-and-other-build-meta-tweaks
2 from setuptools.build_meta import *
@@ -1,47 +1,48 b''
1 include README.rst
1 include README.rst
2 include COPYING.rst
2 include COPYING.rst
3 include LICENSE
3 include LICENSE
4 include setupbase.py
4 include setupbase.py
5 include _build_meta.py
5 include MANIFEST.in
6 include MANIFEST.in
6 include py.typed
7 include py.typed
7 include .mailmap
8 include .mailmap
8 include .flake8
9 include .flake8
9 include .pre-commit-config.yaml
10 include .pre-commit-config.yaml
10 include long_description.rst
11 include long_description.rst
11
12
12 recursive-exclude tools *
13 recursive-exclude tools *
13 exclude tools
14 exclude tools
14 exclude CONTRIBUTING.md
15 exclude CONTRIBUTING.md
15 exclude .editorconfig
16 exclude .editorconfig
16 exclude SECURITY.md
17 exclude SECURITY.md
17 exclude .readthedocs.yaml
18 exclude .readthedocs.yaml
18
19
19 graft scripts
20 graft scripts
20
21
21 # Load main dir but exclude things we don't want in the distro
22 # Load main dir but exclude things we don't want in the distro
22 graft IPython
23 graft IPython
23
24
24 # Documentation
25 # Documentation
25 graft docs
26 graft docs
26 exclude docs/\#*
27 exclude docs/\#*
27 exclude docs/man/*.1.gz
28 exclude docs/man/*.1.gz
28
29
29 exclude .git-blame-ignore-revs
30 exclude .git-blame-ignore-revs
30
31
31 # Examples
32 # Examples
32 graft examples
33 graft examples
33
34
34 # docs subdirs we want to skip
35 # docs subdirs we want to skip
35 prune docs/build
36 prune docs/build
36 prune docs/gh-pages
37 prune docs/gh-pages
37 prune docs/dist
38 prune docs/dist
38
39
39 # Patterns to exclude from any directory
40 # Patterns to exclude from any directory
40 global-exclude *~
41 global-exclude *~
41 global-exclude *.flc
42 global-exclude *.flc
42 global-exclude *.yml
43 global-exclude *.yml
43 global-exclude *.pyc
44 global-exclude *.pyc
44 global-exclude *.pyo
45 global-exclude *.pyo
45 global-exclude .dircopy.log
46 global-exclude .dircopy.log
46 global-exclude .git
47 global-exclude .git
47 global-exclude .ipynb_checkpoints
48 global-exclude .ipynb_checkpoints
@@ -1,84 +1,87 b''
1 [build-system]
1 [build-system]
2 requires = ["setuptools >= 51.0.0"]
2 requires = ["setuptools >= 51.0.0"]
3 build-backend = "setuptools.build_meta"
3 # We need access to the 'setupbase' module at build time.
4 # Hence we declare a custom build backend.
5 build-backend = "_build_meta" # just re-exports setuptools.build_meta definitions
6 backend-path = ["."]
4
7
5 [tool.mypy]
8 [tool.mypy]
6 python_version = "3.10"
9 python_version = "3.10"
7 ignore_missing_imports = true
10 ignore_missing_imports = true
8 follow_imports = 'silent'
11 follow_imports = 'silent'
9 exclude = [
12 exclude = [
10 'test_\.+\.py',
13 'test_\.+\.py',
11 'IPython.utils.tests.test_wildcard',
14 'IPython.utils.tests.test_wildcard',
12 'testing',
15 'testing',
13 'tests',
16 'tests',
14 'PyColorize.py',
17 'PyColorize.py',
15 '_process_win32_controller.py',
18 '_process_win32_controller.py',
16 'IPython/core/application.py',
19 'IPython/core/application.py',
17 'IPython/core/completerlib.py',
20 'IPython/core/completerlib.py',
18 'IPython/core/displaypub.py',
21 'IPython/core/displaypub.py',
19 'IPython/core/historyapp.py',
22 'IPython/core/historyapp.py',
20 #'IPython/core/interactiveshell.py',
23 #'IPython/core/interactiveshell.py',
21 'IPython/core/magic.py',
24 'IPython/core/magic.py',
22 'IPython/core/profileapp.py',
25 'IPython/core/profileapp.py',
23 # 'IPython/core/ultratb.py',
26 # 'IPython/core/ultratb.py',
24 'IPython/lib/deepreload.py',
27 'IPython/lib/deepreload.py',
25 'IPython/lib/pretty.py',
28 'IPython/lib/pretty.py',
26 'IPython/sphinxext/ipython_directive.py',
29 'IPython/sphinxext/ipython_directive.py',
27 'IPython/terminal/ipapp.py',
30 'IPython/terminal/ipapp.py',
28 'IPython/utils/_process_win32.py',
31 'IPython/utils/_process_win32.py',
29 'IPython/utils/path.py',
32 'IPython/utils/path.py',
30 'IPython/utils/timing.py',
33 'IPython/utils/timing.py',
31 'IPython/utils/text.py'
34 'IPython/utils/text.py'
32 ]
35 ]
33
36
34 [tool.pytest.ini_options]
37 [tool.pytest.ini_options]
35 addopts = [
38 addopts = [
36 "--durations=10",
39 "--durations=10",
37 "-pIPython.testing.plugin.pytest_ipdoctest",
40 "-pIPython.testing.plugin.pytest_ipdoctest",
38 "--ipdoctest-modules",
41 "--ipdoctest-modules",
39 "--ignore=docs",
42 "--ignore=docs",
40 "--ignore=examples",
43 "--ignore=examples",
41 "--ignore=htmlcov",
44 "--ignore=htmlcov",
42 "--ignore=ipython_kernel",
45 "--ignore=ipython_kernel",
43 "--ignore=ipython_parallel",
46 "--ignore=ipython_parallel",
44 "--ignore=results",
47 "--ignore=results",
45 "--ignore=tmp",
48 "--ignore=tmp",
46 "--ignore=tools",
49 "--ignore=tools",
47 "--ignore=traitlets",
50 "--ignore=traitlets",
48 "--ignore=IPython/core/tests/daft_extension",
51 "--ignore=IPython/core/tests/daft_extension",
49 "--ignore=IPython/sphinxext",
52 "--ignore=IPython/sphinxext",
50 "--ignore=IPython/terminal/pt_inputhooks",
53 "--ignore=IPython/terminal/pt_inputhooks",
51 "--ignore=IPython/__main__.py",
54 "--ignore=IPython/__main__.py",
52 "--ignore=IPython/external/qt_for_kernel.py",
55 "--ignore=IPython/external/qt_for_kernel.py",
53 "--ignore=IPython/html/widgets/widget_link.py",
56 "--ignore=IPython/html/widgets/widget_link.py",
54 "--ignore=IPython/html/widgets/widget_output.py",
57 "--ignore=IPython/html/widgets/widget_output.py",
55 "--ignore=IPython/terminal/console.py",
58 "--ignore=IPython/terminal/console.py",
56 "--ignore=IPython/utils/_process_cli.py",
59 "--ignore=IPython/utils/_process_cli.py",
57 "--ignore=IPython/utils/_process_posix.py",
60 "--ignore=IPython/utils/_process_posix.py",
58 "--ignore=IPython/utils/_process_win32.py",
61 "--ignore=IPython/utils/_process_win32.py",
59 "--ignore=IPython/utils/_process_win32_controller.py",
62 "--ignore=IPython/utils/_process_win32_controller.py",
60 "--ignore=IPython/utils/daemonize.py",
63 "--ignore=IPython/utils/daemonize.py",
61 "--ignore=IPython/utils/eventful.py",
64 "--ignore=IPython/utils/eventful.py",
62 "--ignore=IPython/kernel",
65 "--ignore=IPython/kernel",
63 "--ignore=IPython/consoleapp.py",
66 "--ignore=IPython/consoleapp.py",
64 "--ignore=IPython/core/inputsplitter.py",
67 "--ignore=IPython/core/inputsplitter.py",
65 "--ignore=IPython/lib/kernel.py",
68 "--ignore=IPython/lib/kernel.py",
66 "--ignore=IPython/utils/jsonutil.py",
69 "--ignore=IPython/utils/jsonutil.py",
67 "--ignore=IPython/utils/localinterfaces.py",
70 "--ignore=IPython/utils/localinterfaces.py",
68 "--ignore=IPython/utils/log.py",
71 "--ignore=IPython/utils/log.py",
69 "--ignore=IPython/utils/signatures.py",
72 "--ignore=IPython/utils/signatures.py",
70 "--ignore=IPython/utils/traitlets.py",
73 "--ignore=IPython/utils/traitlets.py",
71 "--ignore=IPython/utils/version.py"
74 "--ignore=IPython/utils/version.py"
72 ]
75 ]
73 doctest_optionflags = [
76 doctest_optionflags = [
74 "NORMALIZE_WHITESPACE",
77 "NORMALIZE_WHITESPACE",
75 "ELLIPSIS"
78 "ELLIPSIS"
76 ]
79 ]
77 ipdoctest_optionflags = [
80 ipdoctest_optionflags = [
78 "NORMALIZE_WHITESPACE",
81 "NORMALIZE_WHITESPACE",
79 "ELLIPSIS"
82 "ELLIPSIS"
80 ]
83 ]
81 asyncio_mode = "strict"
84 asyncio_mode = "strict"
82
85
83 [tool.pyright]
86 [tool.pyright]
84 pythonPlatform="All"
87 pythonPlatform="All"
@@ -1,159 +1,158 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Setup script for IPython.
2 """Setup script for IPython.
3
3
4 Under Posix environments it works like a typical setup.py script.
4 Under Posix environments it works like a typical setup.py script.
5 Under Windows, the command sdist is not supported, since IPython
5 Under Windows, the command sdist is not supported, since IPython
6 requires utilities which are not available under Windows."""
6 requires utilities which are not available under Windows."""
7
7
8 #-----------------------------------------------------------------------------
8 #-----------------------------------------------------------------------------
9 # Copyright (c) 2008-2011, IPython Development Team.
9 # Copyright (c) 2008-2011, IPython Development Team.
10 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
11 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
12 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
13 #
13 #
14 # Distributed under the terms of the Modified BSD License.
14 # Distributed under the terms of the Modified BSD License.
15 #
15 #
16 # The full license is in the file COPYING.rst, distributed with this software.
16 # The full license is in the file COPYING.rst, distributed with this software.
17 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
18
18
19 import os
19 import os
20 import sys
20 import sys
21
21
22 # **Python version check**
22 # **Python version check**
23 #
23 #
24 # This check is also made in IPython/__init__, don't forget to update both when
24 # This check is also made in IPython/__init__, don't forget to update both when
25 # changing Python version requirements.
25 # changing Python version requirements.
26 if sys.version_info < (3, 10):
26 if sys.version_info < (3, 10):
27 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
27 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
28 try:
28 try:
29 import pip
29 import pip
30 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
30 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
31 if pip_version < (9, 0, 1) :
31 if pip_version < (9, 0, 1) :
32 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
32 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
33 'pip {} detected.'.format(pip.__version__)
33 'pip {} detected.'.format(pip.__version__)
34 else:
34 else:
35 # pip is new enough - it must be something else
35 # pip is new enough - it must be something else
36 pip_message = ''
36 pip_message = ''
37 except Exception:
37 except Exception:
38 pass
38 pass
39
39
40
40
41 error = """
41 error = """
42 IPython 8.19+ supports Python 3.10 and above, following SPEC0
42 IPython 8.19+ supports Python 3.10 and above, following SPEC0
43 IPython 8.13+ supports Python 3.9 and above, following NEP 29.
43 IPython 8.13+ supports Python 3.9 and above, following NEP 29.
44 IPython 8.0-8.12 supports Python 3.8 and above, following NEP 29.
44 IPython 8.0-8.12 supports Python 3.8 and above, following NEP 29.
45 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
45 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
46 Python 3.3 and 3.4 were supported up to IPython 6.x.
46 Python 3.3 and 3.4 were supported up to IPython 6.x.
47 Python 3.5 was supported with IPython 7.0 to 7.9.
47 Python 3.5 was supported with IPython 7.0 to 7.9.
48 Python 3.6 was supported with IPython up to 7.16.
48 Python 3.6 was supported with IPython up to 7.16.
49 Python 3.7 was still supported with the 7.x branch.
49 Python 3.7 was still supported with the 7.x branch.
50
50
51 See IPython `README.rst` file for more information:
51 See IPython `README.rst` file for more information:
52
52
53 https://github.com/ipython/ipython/blob/main/README.rst
53 https://github.com/ipython/ipython/blob/main/README.rst
54
54
55 Python {py} detected.
55 Python {py} detected.
56 {pip}
56 {pip}
57 """.format(
57 """.format(
58 py=sys.version_info, pip=pip_message
58 py=sys.version_info, pip=pip_message
59 )
59 )
60
60
61 print(error, file=sys.stderr)
61 print(error, file=sys.stderr)
62 sys.exit(1)
62 sys.exit(1)
63
63
64 # At least we're on the python version we need, move on.
64 # At least we're on the python version we need, move on.
65
65
66 from setuptools import setup
66 from setuptools import setup
67
67
68 # Our own imports
68 # Our own imports
69 sys.path.insert(0, ".")
70
69
71 from setupbase import target_update, find_entry_points
70 from setupbase import target_update, find_entry_points
72
71
73 from setupbase import (
72 from setupbase import (
74 setup_args,
73 setup_args,
75 check_package_data_first,
74 check_package_data_first,
76 find_data_files,
75 find_data_files,
77 git_prebuild,
76 git_prebuild,
78 install_symlinked,
77 install_symlinked,
79 install_lib_symlink,
78 install_lib_symlink,
80 install_scripts_for_symlink,
79 install_scripts_for_symlink,
81 unsymlink,
80 unsymlink,
82 )
81 )
83
82
84 #-------------------------------------------------------------------------------
83 #-------------------------------------------------------------------------------
85 # Handle OS specific things
84 # Handle OS specific things
86 #-------------------------------------------------------------------------------
85 #-------------------------------------------------------------------------------
87
86
88 if os.name in ('nt','dos'):
87 if os.name in ('nt','dos'):
89 os_name = 'windows'
88 os_name = 'windows'
90 else:
89 else:
91 os_name = os.name
90 os_name = os.name
92
91
93 # Under Windows, 'sdist' has not been supported. Now that the docs build with
92 # Under Windows, 'sdist' has not been supported. Now that the docs build with
94 # Sphinx it might work, but let's not turn it on until someone confirms that it
93 # Sphinx it might work, but let's not turn it on until someone confirms that it
95 # actually works.
94 # actually works.
96 if os_name == 'windows' and 'sdist' in sys.argv:
95 if os_name == 'windows' and 'sdist' in sys.argv:
97 print('The sdist command is not available under Windows. Exiting.')
96 print('The sdist command is not available under Windows. Exiting.')
98 sys.exit(1)
97 sys.exit(1)
99
98
100
99
101 #-------------------------------------------------------------------------------
100 #-------------------------------------------------------------------------------
102 # Things related to the IPython documentation
101 # Things related to the IPython documentation
103 #-------------------------------------------------------------------------------
102 #-------------------------------------------------------------------------------
104
103
105 # update the manuals when building a source dist
104 # update the manuals when building a source dist
106 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
105 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
107
106
108 # List of things to be updated. Each entry is a triplet of args for
107 # List of things to be updated. Each entry is a triplet of args for
109 # target_update()
108 # target_update()
110 to_update = [
109 to_update = [
111 (
110 (
112 "docs/man/ipython.1.gz",
111 "docs/man/ipython.1.gz",
113 ["docs/man/ipython.1"],
112 ["docs/man/ipython.1"],
114 "cd docs/man && python -m gzip --best ipython.1",
113 "cd docs/man && python -m gzip --best ipython.1",
115 ),
114 ),
116 ]
115 ]
117
116
118
117
119 [ target_update(*t) for t in to_update ]
118 [ target_update(*t) for t in to_update ]
120
119
121 #---------------------------------------------------------------------------
120 #---------------------------------------------------------------------------
122 # Find all the packages, package data, and data_files
121 # Find all the packages, package data, and data_files
123 #---------------------------------------------------------------------------
122 #---------------------------------------------------------------------------
124
123
125 data_files = find_data_files()
124 data_files = find_data_files()
126
125
127 setup_args['data_files'] = data_files
126 setup_args['data_files'] = data_files
128
127
129 #---------------------------------------------------------------------------
128 #---------------------------------------------------------------------------
130 # custom distutils commands
129 # custom distutils commands
131 #---------------------------------------------------------------------------
130 #---------------------------------------------------------------------------
132 # imports here, so they are after setuptools import if there was one
131 # imports here, so they are after setuptools import if there was one
133 from setuptools.command.sdist import sdist
132 from setuptools.command.sdist import sdist
134
133
135 setup_args['cmdclass'] = {
134 setup_args['cmdclass'] = {
136 'build_py': \
135 'build_py': \
137 check_package_data_first(git_prebuild('IPython')),
136 check_package_data_first(git_prebuild('IPython')),
138 'sdist' : git_prebuild('IPython', sdist),
137 'sdist' : git_prebuild('IPython', sdist),
139 'symlink': install_symlinked,
138 'symlink': install_symlinked,
140 'install_lib_symlink': install_lib_symlink,
139 'install_lib_symlink': install_lib_symlink,
141 'install_scripts_sym': install_scripts_for_symlink,
140 'install_scripts_sym': install_scripts_for_symlink,
142 'unsymlink': unsymlink,
141 'unsymlink': unsymlink,
143 }
142 }
144
143
145 setup_args["entry_points"] = {
144 setup_args["entry_points"] = {
146 "console_scripts": find_entry_points(),
145 "console_scripts": find_entry_points(),
147 "pygments.lexers": [
146 "pygments.lexers": [
148 "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer",
147 "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer",
149 "ipython = IPython.lib.lexers:IPythonLexer",
148 "ipython = IPython.lib.lexers:IPythonLexer",
150 "ipython3 = IPython.lib.lexers:IPython3Lexer",
149 "ipython3 = IPython.lib.lexers:IPython3Lexer",
151 ],
150 ],
152 }
151 }
153
152
154 #---------------------------------------------------------------------------
153 #---------------------------------------------------------------------------
155 # Do the actual setup now
154 # Do the actual setup now
156 #---------------------------------------------------------------------------
155 #---------------------------------------------------------------------------
157
156
158 if __name__ == "__main__":
157 if __name__ == "__main__":
159 setup(**setup_args)
158 setup(**setup_args)
General Comments 0
You need to be logged in to leave comments. Login now