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