Skip to content

Commit 365feb1

Browse files
authored
Merge pull request #246 from pyutils/dev/support-cp312
Support 3.12
2 parents 075b5c4 + dd29898 commit 365feb1

14 files changed

Lines changed: 189 additions & 59 deletions

File tree

.github/workflows/tests.yml

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout source
24-
uses: actions/checkout@v3
25-
- name: Set up Python 3.11 for linting
26-
uses: actions/setup-python@v4.6.1
24+
uses: actions/checkout@v4
25+
- name: Set up Python 3.12 for linting
26+
uses: actions/setup-python@v4.7.1
2727
with:
28-
python-version: '3.11'
28+
python-version: '3.12'
2929
- name: Install dependencies
3030
run: |-
3131
python -m pip install --upgrade pip
@@ -48,11 +48,11 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Checkout source
51-
uses: actions/checkout@v3
52-
- name: Set up Python 3.11
53-
uses: actions/setup-python@v4.6.1
51+
uses: actions/checkout@v4
52+
- name: Set up Python 3.12
53+
uses: actions/setup-python@v4.7.1
5454
with:
55-
python-version: '3.11'
55+
python-version: '3.12'
5656
- name: Upgrade pip
5757
run: |-
5858
python -m pip install --upgrade pip
@@ -127,17 +127,17 @@ jobs:
127127
- auto
128128
steps:
129129
- name: Checkout source
130-
uses: actions/checkout@v3
130+
uses: actions/checkout@v4
131131
- name: Enable MSVC 64bit
132132
uses: ilammy/msvc-dev-cmd@v1
133133
if: matrix.os == 'windows-latest' && ${{ contains(matrix.cibw_skip, '*-win32') }}
134134
- name: Set up QEMU
135-
uses: docker/setup-qemu-action@v2
135+
uses: docker/setup-qemu-action@v3
136136
if: runner.os == 'Linux' && matrix.arch != 'auto'
137137
with:
138138
platforms: all
139139
- name: Build binary wheels
140-
uses: pypa/cibuildwheel@v2.13.1
140+
uses: pypa/cibuildwheel@v2.16.2
141141
with:
142142
output-dir: wheelhouse
143143
config-file: pyproject.toml
@@ -147,11 +147,11 @@ jobs:
147147
- name: Show built files
148148
shell: bash
149149
run: ls -la wheelhouse
150-
- name: Set up Python 3.11 to combine coverage
151-
uses: actions/setup-python@v4.6.1
150+
- name: Set up Python 3.12 to combine coverage
151+
uses: actions/setup-python@v4.7.1
152152
if: runner.os == 'Linux'
153153
with:
154-
python-version: '3.11'
154+
python-version: '3.12'
155155
- name: Combine coverage Linux
156156
if: runner.os == 'Linux'
157157
run: |-
@@ -203,23 +203,23 @@ jobs:
203203
install-extras: tests-strict,runtime-strict
204204
os: windows-latest
205205
arch: auto
206-
- python-version: '3.11'
206+
- python-version: '3.12'
207207
install-extras: tests-strict,runtime-strict,optional-strict
208208
os: ubuntu-latest
209209
arch: auto
210-
- python-version: '3.11'
210+
- python-version: '3.12'
211211
install-extras: tests-strict,runtime-strict,optional-strict
212212
os: macOS-latest
213213
arch: auto
214-
- python-version: '3.11'
214+
- python-version: '3.12'
215215
install-extras: tests-strict,runtime-strict,optional-strict
216216
os: windows-latest
217217
arch: auto
218-
- python-version: '3.11'
218+
- python-version: '3.12'
219219
install-extras: tests
220220
os: windows-latest
221221
arch: auto
222-
- python-version: '3.11'
222+
- python-version: '3.12'
223223
install-extras: tests
224224
os: windows-latest
225225
arch: auto
@@ -247,6 +247,10 @@ jobs:
247247
install-extras: tests,optional
248248
os: windows-latest
249249
arch: auto
250+
- python-version: '3.12'
251+
install-extras: tests,optional
252+
os: windows-latest
253+
arch: auto
250254
- python-version: '3.6'
251255
install-extras: tests,optional
252256
os: windows-latest
@@ -271,6 +275,10 @@ jobs:
271275
install-extras: tests,optional
272276
os: windows-latest
273277
arch: auto
278+
- python-version: '3.12'
279+
install-extras: tests,optional
280+
os: windows-latest
281+
arch: auto
274282
- python-version: '3.6'
275283
install-extras: tests,optional
276284
os: windows-latest
@@ -295,19 +303,23 @@ jobs:
295303
install-extras: tests,optional
296304
os: windows-latest
297305
arch: auto
306+
- python-version: '3.12'
307+
install-extras: tests,optional
308+
os: windows-latest
309+
arch: auto
298310
steps:
299311
- name: Checkout source
300-
uses: actions/checkout@v3
312+
uses: actions/checkout@v4
301313
- name: Enable MSVC 64bit
302314
uses: ilammy/msvc-dev-cmd@v1
303315
if: matrix.os == 'windows-latest'
304316
- name: Set up QEMU
305-
uses: docker/setup-qemu-action@v2
317+
uses: docker/setup-qemu-action@v3
306318
if: runner.os == 'Linux' && matrix.arch != 'auto'
307319
with:
308320
platforms: all
309321
- name: Setup Python
310-
uses: actions/setup-python@v4.6.1
322+
uses: actions/setup-python@v4.7.1
311323
with:
312324
python-version: ${{ matrix.python-version }}
313325
- uses: actions/download-artifact@v3
@@ -388,7 +400,7 @@ jobs:
388400
- test_binpy_wheels
389401
steps:
390402
- name: Checkout source
391-
uses: actions/checkout@v3
403+
uses: actions/checkout@v4
392404
- uses: actions/download-artifact@v3
393405
name: Download wheels and sdist
394406
with:
@@ -432,7 +444,7 @@ jobs:
432444
- test_binpy_wheels
433445
steps:
434446
- name: Checkout source
435-
uses: actions/checkout@v3
447+
uses: actions/checkout@v4
436448
- uses: actions/download-artifact@v3
437449
name: Download wheels and sdist
438450
with:

.readthedocs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77

88
# Required
99
version: 2
10+
build:
11+
os: "ubuntu-22.04"
12+
tools:
13+
python: "3.11"
1014
sphinx:
1115
configuration: docs/source/conf.py
1216
formats: all
1317
python:
14-
version: 3.7
1518
install:
1619
- requirements: requirements/docs.txt
1720
- method: pip

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changes
22
=======
33

4+
4.1.2
5+
~~~~
6+
* ENH: Add support for Python 3.12 #246
7+
48
4.1.1
59
~~~~
610
* FIX: ``get_stats`` is no longer slowed down when profiling many code sections #236

docs/source/conf.py

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
2828
https://docs.readthedocs.io/en/stable/guides/autobuild-docs-for-pull-requests.html
2929
30-
https://readthedocs.org/dashboard/kernprof/advanced/
30+
https://readthedocs.org/dashboard/line-profiler/advanced/
3131
3232
ensure your github account is connected to readthedocs
3333
https://readthedocs.org/accounts/social/connections/
@@ -45,11 +45,13 @@
4545
Set the Repository NAME: line_profiler
4646
Set the Repository URL: https://github.com/pyutils/line_profiler
4747
48-
For gitlab you also need to setup an integrations and add gitlab
49-
incoming webhook
48+
For gitlab you also need to setup an integrations. Navigate to:
5049
5150
https://readthedocs.org/dashboard/line-profiler/integrations/create/
5251
52+
Then add gitlab incoming webhook and copy the URL (make sure
53+
you copy the real url and not the text so https is included).
54+
5355
Then go to
5456
5557
https://github.com/pyutils/line_profiler/hooks
@@ -112,7 +114,7 @@ def visit_Assign(self, node):
112114
author = 'Robert Kern'
113115
modname = 'line_profiler'
114116

115-
modpath = join(dirname(dirname(dirname(__file__))), modname, '__init__.py')
117+
modpath = join(dirname(dirname(dirname(__file__))), 'line_profiler', '__init__.py')
116118
release = parse_version(modpath)
117119
version = '.'.join(release.split('.')[0:2])
118120

@@ -127,13 +129,18 @@ def visit_Assign(self, node):
127129
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
128130
# ones.
129131
extensions = [
132+
# 'autoapi.extension',
130133
'sphinx.ext.autodoc',
131134
'sphinx.ext.autosummary',
132135
'sphinx.ext.intersphinx',
133136
'sphinx.ext.napoleon',
134137
'sphinx.ext.todo',
135138
'sphinx.ext.viewcode',
136139
# 'myst_parser', # TODO
140+
141+
'sphinx.ext.githubpages',
142+
# 'sphinxcontrib.redirects',
143+
'sphinx_reredirects',
137144
]
138145

139146
todo_include_todos = True
@@ -147,6 +154,15 @@ def visit_Assign(self, node):
147154
autoclass_content = 'both'
148155
# autodoc_mock_imports = ['torch', 'torchvision', 'visdom']
149156

157+
# autoapi_modules = {
158+
# modname: {
159+
# 'override': False,
160+
# 'output': 'auto'
161+
# }
162+
# }
163+
# autoapi_dirs = [f'../../src/{modname}']
164+
# autoapi_keep_files = True
165+
150166
intersphinx_mapping = {
151167
# 'pytorch': ('http://pytorch.org/docs/master/', None),
152168
'python': ('https://docs.python.org/3', None),
@@ -163,9 +179,14 @@ def visit_Assign(self, node):
163179
'xdoctest': ('https://xdoctest.readthedocs.io/en/latest/', None),
164180
'networkx': ('https://networkx.org/documentation/stable/', None),
165181
'scriptconfig': ('https://scriptconfig.readthedocs.io/en/latest/', None),
166-
'xdev': ('https://xdev.readthedocs.io/en/latest/', None),
167182
'rich': ('https://rich.readthedocs.io/en/latest/', None),
168183

184+
'pytest': ('https://docs.pytest.org/en/latest/', None),
185+
# 'pytest._pytest.doctest': ('https://docs.pytest.org/en/latest/_modules/_pytest/doctest.html', None),
186+
# 'colorama': ('https://pypi.org/project/colorama/', None),
187+
# 'numpy': ('http://docs.scipy.org/doc/numpy/', None),
188+
# 'cv2' : ('http://docs.opencv.org/2.4/', None),
189+
# 'h5py' : ('http://docs.h5py.org/en/latest/', None)
169190
}
170191
__dev_note__ = """
171192
python -m sphinx.ext.intersphinx https://docs.python.org/3/objects.inv
@@ -175,6 +196,11 @@ def visit_Assign(self, node):
175196
python -m sphinx.ext.intersphinx https://kwimage.readthedocs.io/en/latest/objects.inv
176197
python -m sphinx.ext.intersphinx https://ubelt.readthedocs.io/en/latest/objects.inv
177198
python -m sphinx.ext.intersphinx https://networkx.org/documentation/stable/objects.inv
199+
200+
sphobjinv suggest -t 90 -u https://readthedocs.org/projects/pytest/reference/objects.inv
201+
"signal.convolve2d"
202+
203+
python -m sphinx.ext.intersphinx https://pygments-doc.readthedocs.io/en/latest/objects.inv
178204
"""
179205

180206

@@ -244,7 +270,7 @@ def visit_Assign(self, node):
244270
# -- Options for HTMLHelp output ---------------------------------------------
245271

246272
# Output file base name for HTML help builder.
247-
htmlhelp_basename = 'line_profilerdoc'
273+
htmlhelp_basename = project + 'doc'
248274

249275

250276
# -- Options for LaTeX output ------------------------------------------------

kernprof.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def main():
9191

9292
# NOTE: This version needs to be manually maintained in
9393
# line_profiler/line_profiler.py and line_profiler/__init__.py as well
94-
__version__ = '4.1.1'
94+
__version__ = '4.1.2'
9595

9696
# Guard the import of cProfile such that 3.x people
9797
# without lsprof can still use this script.

line_profiler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def main():
159159
# from .line_profiler import __version__
160160

161161
# NOTE: This needs to be in sync with ../kernprof.py and line_profiler.py
162-
__version__ = '4.1.1'
162+
__version__ = '4.1.2'
163163

164164
from .line_profiler import (LineProfiler,
165165
load_ipython_extension, load_stats, main,

0 commit comments

Comments
 (0)