##// END OF EJS Templates
setup pip cache
Matthias Bussonnier -
Show More
@@ -1,75 +1,76 b''
1 name: Run tests
1 name: Run tests
2
2
3 on:
3 on:
4 push:
4 push:
5 pull_request:
5 pull_request:
6 # Run weekly on Monday at 1:23 UTC
6 # Run weekly on Monday at 1:23 UTC
7 schedule:
7 schedule:
8 - cron: '23 1 * * 1'
8 - cron: '23 1 * * 1'
9 workflow_dispatch:
9 workflow_dispatch:
10
10
11
11
12 jobs:
12 jobs:
13 test:
13 test:
14 runs-on: ${{ matrix.os }}
14 runs-on: ${{ matrix.os }}
15 strategy:
15 strategy:
16 matrix:
16 matrix:
17 os: [ubuntu-latest, windows-latest]
17 os: [ubuntu-latest, windows-latest]
18 python-version: ["3.8", "3.9", "3.10"]
18 python-version: ["3.8", "3.9", "3.10"]
19 deps: [test_extra]
19 deps: [test_extra]
20 # Test all on ubuntu, test ends on macos
20 # Test all on ubuntu, test ends on macos
21 include:
21 include:
22 - os: macos-latest
22 - os: macos-latest
23 python-version: "3.8"
23 python-version: "3.8"
24 deps: test_extra
24 deps: test_extra
25 - os: macos-latest
25 - os: macos-latest
26 python-version: "3.10"
26 python-version: "3.10"
27 deps: test_extra
27 deps: test_extra
28 # Tests minimal dependencies set
28 # Tests minimal dependencies set
29 - os: ubuntu-latest
29 - os: ubuntu-latest
30 python-version: "3.10"
30 python-version: "3.10"
31 deps: test
31 deps: test
32 # Tests latest development Python version
32 # Tests latest development Python version
33 - os: ubuntu-latest
33 - os: ubuntu-latest
34 python-version: "3.11-dev"
34 python-version: "3.11-dev"
35 deps: test
35 deps: test
36 # Installing optional dependencies stuff takes ages on PyPy
36 # Installing optional dependencies stuff takes ages on PyPy
37 - os: ubuntu-latest
37 - os: ubuntu-latest
38 python-version: "pypy-3.8"
38 python-version: "pypy-3.8"
39 deps: test
39 deps: test
40 - os: windows-latest
40 - os: windows-latest
41 python-version: "pypy-3.8"
41 python-version: "pypy-3.8"
42 deps: test
42 deps: test
43 - os: macos-latest
43 - os: macos-latest
44 python-version: "pypy-3.8"
44 python-version: "pypy-3.8"
45 deps: test
45 deps: test
46
46
47 steps:
47 steps:
48 - uses: actions/checkout@v2
48 - uses: actions/checkout@v2
49 - name: Set up Python ${{ matrix.python-version }}
49 - name: Set up Python ${{ matrix.python-version }}
50 uses: actions/setup-python@v2
50 uses: actions/setup-python@v2
51 with:
51 with:
52 python-version: ${{ matrix.python-version }}
52 python-version: ${{ matrix.python-version }}
53 cache: pip
53 - name: Install latex
54 - name: Install latex
54 if: runner.os == 'Linux' && matrix.deps == 'test_extra'
55 if: runner.os == 'Linux' && matrix.deps == 'test_extra'
55 run: sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng
56 run: sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng
56 - name: Install and update Python dependencies
57 - name: Install and update Python dependencies
57 run: |
58 run: |
58 python -m pip install --upgrade pip setuptools wheel build
59 python -m pip install --upgrade pip setuptools wheel build
59 python -m pip install --upgrade -e .[${{ matrix.deps }}]
60 python -m pip install --upgrade -e .[${{ matrix.deps }}]
60 python -m pip install --upgrade check-manifest pytest-cov
61 python -m pip install --upgrade check-manifest pytest-cov
61 - name: Try building with Python build
62 - name: Try building with Python build
62 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
63 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
63 run: |
64 run: |
64 python -m build
65 python -m build
65 shasum -a 256 dist/*
66 shasum -a 256 dist/*
66 - name: Check manifest
67 - name: Check manifest
67 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
68 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
68 run: check-manifest
69 run: check-manifest
69 - name: pytest
70 - name: pytest
70 env:
71 env:
71 COLUMNS: 120
72 COLUMNS: 120
72 run: |
73 run: |
73 pytest --color=yes -raXxs --cov --cov-report=xml
74 pytest --color=yes -raXxs --cov --cov-report=xml
74 - name: Upload coverage to Codecov
75 - name: Upload coverage to Codecov
75 uses: codecov/codecov-action@v2
76 uses: codecov/codecov-action@v2
@@ -1,123 +1,122 b''
1 # encoding: utf-8
1 # encoding: utf-8
2 """
2 """
3 Utilities for timing code execution.
3 Utilities for timing code execution.
4 """
4 """
5
5
6 #-----------------------------------------------------------------------------
6 #-----------------------------------------------------------------------------
7 # Copyright (C) 2008-2011 The IPython Development Team
7 # Copyright (C) 2008-2011 The IPython Development Team
8 #
8 #
9 # Distributed under the terms of the BSD License. The full license is in
9 # Distributed under the terms of the BSD License. The full license is in
10 # the file COPYING, distributed as part of this software.
10 # the file COPYING, distributed as part of this software.
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12
12
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14 # Imports
14 # Imports
15 #-----------------------------------------------------------------------------
15 #-----------------------------------------------------------------------------
16
16
17 import time
17 import time
18
18
19 #-----------------------------------------------------------------------------
19 #-----------------------------------------------------------------------------
20 # Code
20 # Code
21 #-----------------------------------------------------------------------------
21 #-----------------------------------------------------------------------------
22
22
23 # If possible (Unix), use the resource module instead of time.clock()
23 # If possible (Unix), use the resource module instead of time.clock()
24 try:
24 try:
25 import resource
25 import resource
26 except ImportError:
26 except ImportError:
27 resource = None
27 resource = None
28
28
29 # Some implementations (like jyputerlite) don't have getrusage
29 # Some implementations (like jyputerlite) don't have getrusage
30 if resource is not None and hasattr(resource, "getrusage"):
30 if resource is not None and hasattr(resource, "getrusage"):
31 def clocku():
31 def clocku():
32 """clocku() -> floating point number
32 """clocku() -> floating point number
33
33
34 Return the *USER* CPU time in seconds since the start of the process.
34 Return the *USER* CPU time in seconds since the start of the process.
35 This is done via a call to resource.getrusage, so it avoids the
35 This is done via a call to resource.getrusage, so it avoids the
36 wraparound problems in time.clock()."""
36 wraparound problems in time.clock()."""
37
37
38 return resource.getrusage(resource.RUSAGE_SELF)[0]
38 return resource.getrusage(resource.RUSAGE_SELF)[0]
39
39
40 def clocks():
40 def clocks():
41 """clocks() -> floating point number
41 """clocks() -> floating point number
42
42
43 Return the *SYSTEM* CPU time in seconds since the start of the process.
43 Return the *SYSTEM* CPU time in seconds since the start of the process.
44 This is done via a call to resource.getrusage, so it avoids the
44 This is done via a call to resource.getrusage, so it avoids the
45 wraparound problems in time.clock()."""
45 wraparound problems in time.clock()."""
46
46
47 return resource.getrusage(resource.RUSAGE_SELF)[1]
47 return resource.getrusage(resource.RUSAGE_SELF)[1]
48
48
49 def clock():
49 def clock():
50 """clock() -> floating point number
50 """clock() -> floating point number
51
51
52 Return the *TOTAL USER+SYSTEM* CPU time in seconds since the start of
52 Return the *TOTAL USER+SYSTEM* CPU time in seconds since the start of
53 the process. This is done via a call to resource.getrusage, so it
53 the process. This is done via a call to resource.getrusage, so it
54 avoids the wraparound problems in time.clock()."""
54 avoids the wraparound problems in time.clock()."""
55
55
56 u,s = resource.getrusage(resource.RUSAGE_SELF)[:2]
56 u,s = resource.getrusage(resource.RUSAGE_SELF)[:2]
57 return u+s
57 return u+s
58
58
59 def clock2():
59 def clock2():
60 """clock2() -> (t_user,t_system)
60 """clock2() -> (t_user,t_system)
61
61
62 Similar to clock(), but return a tuple of user/system times."""
62 Similar to clock(), but return a tuple of user/system times."""
63 return resource.getrusage(resource.RUSAGE_SELF)[:2]
63 return resource.getrusage(resource.RUSAGE_SELF)[:2]
64
64
65
66 else:
65 else:
67 # There is no distinction of user/system time under windows, so we just use
66 # There is no distinction of user/system time under windows, so we just use
68 # time.perff_counter() for everything...
67 # time.perff_counter() for everything...
69 clocku = clocks = clock = time.perf_counter
68 clocku = clocks = clock = time.perf_counter
70 def clock2():
69 def clock2():
71 """Under windows, system CPU time can't be measured.
70 """Under windows, system CPU time can't be measured.
72
71
73 This just returns perf_counter() and zero."""
72 This just returns perf_counter() and zero."""
74 return time.perf_counter(),0.0
73 return time.perf_counter(),0.0
75
74
76
75
77 def timings_out(reps,func,*args,**kw):
76 def timings_out(reps,func,*args,**kw):
78 """timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
77 """timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
79
78
80 Execute a function reps times, return a tuple with the elapsed total
79 Execute a function reps times, return a tuple with the elapsed total
81 CPU time in seconds, the time per call and the function's output.
80 CPU time in seconds, the time per call and the function's output.
82
81
83 Under Unix, the return value is the sum of user+system time consumed by
82 Under Unix, the return value is the sum of user+system time consumed by
84 the process, computed via the resource module. This prevents problems
83 the process, computed via the resource module. This prevents problems
85 related to the wraparound effect which the time.clock() function has.
84 related to the wraparound effect which the time.clock() function has.
86
85
87 Under Windows the return value is in wall clock seconds. See the
86 Under Windows the return value is in wall clock seconds. See the
88 documentation for the time module for more details."""
87 documentation for the time module for more details."""
89
88
90 reps = int(reps)
89 reps = int(reps)
91 assert reps >=1, 'reps must be >= 1'
90 assert reps >=1, 'reps must be >= 1'
92 if reps==1:
91 if reps==1:
93 start = clock()
92 start = clock()
94 out = func(*args,**kw)
93 out = func(*args,**kw)
95 tot_time = clock()-start
94 tot_time = clock()-start
96 else:
95 else:
97 rng = range(reps-1) # the last time is executed separately to store output
96 rng = range(reps-1) # the last time is executed separately to store output
98 start = clock()
97 start = clock()
99 for dummy in rng: func(*args,**kw)
98 for dummy in rng: func(*args,**kw)
100 out = func(*args,**kw) # one last time
99 out = func(*args,**kw) # one last time
101 tot_time = clock()-start
100 tot_time = clock()-start
102 av_time = tot_time / reps
101 av_time = tot_time / reps
103 return tot_time,av_time,out
102 return tot_time,av_time,out
104
103
105
104
106 def timings(reps,func,*args,**kw):
105 def timings(reps,func,*args,**kw):
107 """timings(reps,func,*args,**kw) -> (t_total,t_per_call)
106 """timings(reps,func,*args,**kw) -> (t_total,t_per_call)
108
107
109 Execute a function reps times, return a tuple with the elapsed total CPU
108 Execute a function reps times, return a tuple with the elapsed total CPU
110 time in seconds and the time per call. These are just the first two values
109 time in seconds and the time per call. These are just the first two values
111 in timings_out()."""
110 in timings_out()."""
112
111
113 return timings_out(reps,func,*args,**kw)[0:2]
112 return timings_out(reps,func,*args,**kw)[0:2]
114
113
115
114
116 def timing(func,*args,**kw):
115 def timing(func,*args,**kw):
117 """timing(func,*args,**kw) -> t_total
116 """timing(func,*args,**kw) -> t_total
118
117
119 Execute a function once, return the elapsed total CPU time in
118 Execute a function once, return the elapsed total CPU time in
120 seconds. This is just the first value in timings_out()."""
119 seconds. This is just the first value in timings_out()."""
121
120
122 return timings_out(1,func,*args,**kw)[0]
121 return timings_out(1,func,*args,**kw)[0]
123
122
@@ -1,105 +1,108 b''
1 [metadata]
1 [metadata]
2 name = ipython
2 name = ipython
3 version = attr: IPython.core.release.__version__
3 version = attr: IPython.core.release.__version__
4 url = https://ipython.org
4 url = https://ipython.org
5 description = IPython: Productive Interactive Computing
5 description = IPython: Productive Interactive Computing
6 long_description_content_type = text/x-rst
6 long_description_content_type = text/x-rst
7 long_description = IPython provides a rich toolkit to help you make the most out of using Python
7 long_description = IPython provides a rich toolkit to help you make the most out of using Python
8 interactively. Its main components are:
8 interactively. Its main components are:
9
9
10 * A powerful interactive Python shell
10 * A powerful interactive Python shell
11 * A `Jupyter <https://jupyter.org/>`_ kernel to work with Python code in Jupyter
11 * A `Jupyter <https://jupyter.org/>`_ kernel to work with Python code in Jupyter
12 notebooks and other interactive frontends.
12 notebooks and other interactive frontends.
13
13
14 The enhanced interactive Python shells have the following main features:
14 The enhanced interactive Python shells have the following main features:
15
15
16 * Comprehensive object introspection.
16 * Comprehensive object introspection.
17
17
18 * Input history, persistent across sessions.
18 * Input history, persistent across sessions.
19
19
20 * Caching of output results during a session with automatically generated
20 * Caching of output results during a session with automatically generated
21 references.
21 references.
22
22
23 * Extensible tab completion, with support by default for completion of python
23 * Extensible tab completion, with support by default for completion of python
24 variables and keywords, filenames and function keywords.
24 variables and keywords, filenames and function keywords.
25
25
26 * Extensible system of 'magic' commands for controlling the environment and
26 * Extensible system of 'magic' commands for controlling the environment and
27 performing many tasks related either to IPython or the operating system.
27 performing many tasks related either to IPython or the operating system.
28
28
29 * A rich configuration system with easy switching between different setups
29 * A rich configuration system with easy switching between different setups
30 (simpler than changing $PYTHONSTARTUP environment variables every time).
30 (simpler than changing $PYTHONSTARTUP environment variables every time).
31
31
32 * Session logging and reloading.
32 * Session logging and reloading.
33
33
34 * Extensible syntax processing for special purpose situations.
34 * Extensible syntax processing for special purpose situations.
35
35
36 * Access to the system shell with user-extensible alias system.
36 * Access to the system shell with user-extensible alias system.
37
37
38 * Easily embeddable in other Python programs and GUIs.
38 * Easily embeddable in other Python programs and GUIs.
39
39
40 * Integrated access to the pdb debugger and the Python profiler.
40 * Integrated access to the pdb debugger and the Python profiler.
41
41
42 The latest development version is always available from IPython's `GitHub
42 The latest development version is always available from IPython's `GitHub
43 site <http://github.com/ipython>`_.
43 site <http://github.com/ipython>`_.
44
44
45 license_file = LICENSE
45 license_file = LICENSE
46 project_urls =
46 project_urls =
47 Documentation = https://ipython.readthedocs.io/
47 Documentation = https://ipython.readthedocs.io/
48 Funding = https://numfocus.org/
48 Funding = https://numfocus.org/
49 Source = https://github.com/ipython/ipython
49 Source = https://github.com/ipython/ipython
50 Tracker = https://github.com/ipython/ipython/issues
50 Tracker = https://github.com/ipython/ipython/issues
51 keywords = Interactive, Interpreter, Shell, Embedding
51 keywords = Interactive, Interpreter, Shell, Embedding
52 platforms = Linux, Mac OSX, Windows
52 platforms = Linux, Mac OSX, Windows
53 classifiers =
53 classifiers =
54 Framework :: IPython
54 Framework :: IPython
55 Intended Audience :: Developers
55 Intended Audience :: Developers
56 Intended Audience :: Science/Research
56 Intended Audience :: Science/Research
57 License :: OSI Approved :: BSD License
57 License :: OSI Approved :: BSD License
58 Programming Language :: Python
58 Programming Language :: Python
59 Programming Language :: Python :: 3
59 Programming Language :: Python :: 3
60 Programming Language :: Python :: 3 :: Only
60 Programming Language :: Python :: 3 :: Only
61 Topic :: System :: Shell
61 Topic :: System :: Shell
62
62
63
63
64 [options]
64 [options]
65 packages = find:
65 packages = find:
66 python_requires = >=3.8
66 python_requires = >=3.8
67 zip_safe = False
67 zip_safe = False
68 install_requires =
68 install_requires =
69 setuptools>=18.5
69 setuptools>=18.5
70 jedi>=0.16
70 jedi>=0.16
71 decorator
71 decorator
72 pickleshare
72 pickleshare
73 traitlets>=5
73 traitlets>=5
74 prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1
74 prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1
75 pygments
75 pygments
76 backcall
76 backcall
77 stack_data
77 stack_data
78 matplotlib-inline
78 matplotlib-inline
79 pexpect>4.3; sys_platform != "win32"
79 pexpect>4.3; sys_platform != "win32"
80 appnope; sys_platform == "darwin"
80 appnope; sys_platform == "darwin"
81 colorama; sys_platform == "win32"
81 colorama; sys_platform == "win32"
82
82
83 [options.packages.find]
83 [options.packages.find]
84 exclude =
84 exclude =
85 setupext
85 setupext
86
86
87 [options.package_data]
87 [options.package_data]
88 IPython.core = profile/README*
88 IPython.core = profile/README*
89 IPython.core.tests = *.png, *.jpg, daft_extension/*.py
89 IPython.core.tests = *.png, *.jpg, daft_extension/*.py
90 IPython.lib.tests = *.wav
90 IPython.lib.tests = *.wav
91 IPython.testing.plugin = *.txt
91 IPython.testing.plugin = *.txt
92
92
93 [options.entry_points]
93 [options.entry_points]
94 console_scripts =
94 console_scripts =
95 ipython = IPython:start_ipython
95 ipython = IPython:start_ipython
96 ipython3 = IPython:start_ipython
96 ipython3 = IPython:start_ipython
97 pygments.lexers =
97 pygments.lexers =
98 ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer
98 ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer
99 ipython = IPython.lib.lexers:IPythonLexer
99 ipython = IPython.lib.lexers:IPythonLexer
100 ipython3 = IPython.lib.lexers:IPython3Lexer
100 ipython3 = IPython.lib.lexers:IPython3Lexer
101
101
102 [velin]
102 [velin]
103 ignore_patterns =
103 ignore_patterns =
104 IPython/core/tests,
104 IPython/core/tests,
105 IPython/testing
105 IPython/testing
106
107 [tool.black]
108 exclude = 'timing\.py'
General Comments 0
You need to be logged in to leave comments. Login now