Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 Support #43

Merged
merged 22 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
abf0a51
Initial Python 3.11 support
zhuyifei1999 Oct 3, 2022
d5758af
Trashcan source compatibility with pre-3.11
zhuyifei1999 Jan 30, 2023
d62b5f4
RootState: Add traverse, dir, and getattr for _PyInterpreterFrame
zhuyifei1999 Jan 30, 2023
8e65101
stdtypes.c: frame's f_func -> NYHR_INTERATTR
zhuyifei1999 Feb 13, 2023
8fa5f4e
rootstate: Give in to Python _PyInterpreterFrame shenanigans
zhuyifei1999 May 12, 2023
09a87c9
stdtypes: Fix frame traverse in 3.11
zhuyifei1999 May 12, 2023
ffc27bf
stdtypes.c: Use co_nlocalsplus instead of stacktop for locals
zhuyifei1999 May 13, 2023
e0cd351
Glue.py: Make Share slotted
zhuyifei1999 May 13, 2023
e80cafb
hv_cli_prod.c: Fix producer profile for Python 3.11
zhuyifei1999 May 13, 2023
cf9efa6
test_Path.py: Fix path ordering when both sources are same size
zhuyifei1999 May 13, 2023
6f91e4c
Implement relate for code object and fix its test in test_Path.py
zhuyifei1999 May 13, 2023
435b5d5
Switch back to linked frame traversal
zhuyifei1999 May 13, 2023
f9eeb6e
test_Path.py: Fix expectations on rootstate in Python 3.11
zhuyifei1999 May 13, 2023
d590e3c
hv.c: Materialize managed dict of objects when traversing
zhuyifei1999 May 13, 2023
4af214d
test_RefPat.py: Fix test from size difference
zhuyifei1999 May 13, 2023
74b9299
github/workflows: Expand to 3.11 and update build toolchain
zhuyifei1999 May 13, 2023
aff42f1
Drop Python 3.6 support
zhuyifei1999 May 13, 2023
0285370
Update GH Action action versions
zhuyifei1999 May 13, 2023
1f86a0d
Update docs on Python compatibility
zhuyifei1999 May 13, 2023
ced9470
test_ER.py: Deflake test_6
zhuyifei1999 May 13, 2023
176c6f7
GitHub Workflow: Ignore errors from issue #37
zhuyifei1999 May 13, 2023
7b88284
github/workflows: Rename build_wheels_native -> build_wheels
zhuyifei1999 May 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 19 additions & 40 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

Expand All @@ -27,13 +27,13 @@ jobs:
needs: build_sdist
runs-on: ${{ matrix.os }}
# https://github.com/zhuyifei1999/guppy3/issues/37
continue-on-error: ${{ matrix.os == 'windows-2019' && matrix.python-version == '3.9' }}
continue-on-error: ${{ (matrix.os == 'windows-latest' || matrix.os == 'macos-latest') && matrix.python-version == '3.10' && matrix.codecov }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
tracemalloc: [true, false]
codecov: [true, false]
sdist: [true, false]
Expand All @@ -45,16 +45,16 @@ jobs:
steps:
- name: Checkout
if: ${{ !matrix.sdist }}
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Download sdist
if: ${{ matrix.sdist }}
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -103,64 +103,43 @@ jobs:
shell: bash
run: bash <(curl -s https://codecov.io/bash)

build_wheels_native:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'push'
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp3{[6789],10}-*

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

build_wheels_emulated:
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'push'
strategy:
matrix:
os: [ubuntu-20.04]
arch: [aarch64, ppc64le, s390x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
uses: pypa/cibuildwheel@v2.12.3
env:
CIBW_BUILD: cp3{[6789],10}-*
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BUILD: cp3{[789],10,11}-*
CIBW_ARCHS: all

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

upload_pypi:
needs: [test_matrix, build_wheels_native, build_wheels_emulated, build_sdist]
needs: [test_matrix, build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Guppy 3 is a fork of Guppy-PE, created by Sverker Nilsson for Python 2.

## Requirements

You should have Python 3.6, 3.7, 3.8, 3.9, or 3.10. This package is CPython
You should have Python 3.7, 3.8, 3.9, 3.10, or 3.11. This package is CPython
only; PyPy and other Python implementations are not supported. Python 2 support
can be obtained from [guppy-pe](http://guppy-pe.sourceforge.net/) by
Sverker Nilsson, from which this package is forked.
Expand Down
2 changes: 1 addition & 1 deletion docs/ProfileBrowser.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,4 @@ <h3>Table Pane</h3></dt>
This pane shows a table based on the configuration set
in the Table menu. The sample number and time stamp
show in the header.</dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:13 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:12 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/docexample.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ <h2>Attribute</h2></dt>
<dd>
An attribute named a_nokind, with unspecified kind.
</dd></dl></dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/docexample.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tests generated by: guppy.gsl.Tester
# Date: Sat Jan 23 02:08:08 2021
# Date: Sat May 13 06:37:09 2023
class Tester:
tests = {}
def test_example_kind(self, arg):
Expand Down
2 changes: 1 addition & 1 deletion docs/gsl.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ <h3> Emacs mode</h3></a>
Entering GSL mode calls with no arguments the value of the variable
`gsl-mode-hook', if that value exists and is not nil; see the `Hooks'
section of the Elisp manual for details.</pre>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
4 changes: 2 additions & 2 deletions docs/gslexample.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ <h2> Source Code</h2></a>
<h2> Generated Test Class</h2></a>
<pre>
# Tests generated by: guppy.gsl.Tester
# Date: Sat Jan 23 02:08:08 2021
# Date: Sat May 13 06:37:09 2023
class Tester:
tests = {}
def test_example_kind(self, arg):
Expand Down Expand Up @@ -258,4 +258,4 @@ <h2> Generated Test Class</h2></a>
t52 = arg.m_alt('abc')
tests['.tgt.docexample.example_kind'] = test_example_kind
</pre>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/guppy.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ <h2>Methods</h2></dt>
There is currently no arguments to this constructor, I may think
of adding some options in the future, but it has not yet been needed.
</p></dd></dl></dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/heapy_RootState.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ <h3> &lt;frame number&gt;</h3>
started frame is 0, and in general the most recent frame has a number
that is the number of frames it has before it in call order.
</p></dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/heapy_UniSet.html
Original file line number Diff line number Diff line change
Expand Up @@ -1484,4 +1484,4 @@ <h2>Mapping</h2></dt><a name='heapy_ER.EquivalenceRelationByDictOwner.-60-3-62-'
associated with the owner classification of x, though this is not
currently checked.
</small></dd></dl></dd></dl></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/heapy_Use.html
Original file line number Diff line number Diff line change
Expand Up @@ -822,4 +822,4 @@ <h2>Attributes</h2></dt>
<pre>
&gt;&gt;&gt; hp.doc.heap[0]
</pre></dd></dl></dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/heapy_tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ <h3>
&gt;&gt;&gt; hp.iso(x).sp
0: hp.Root.i0_modules['__main__'].__dict__['x']
&gt;&gt;&gt; </pre>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/heapyc.html
Original file line number Diff line number Diff line change
Expand Up @@ -765,4 +765,4 @@ <h2>Attributes</h2></dt>
the nodegraph has been used at least once after update, so that it
will not be cleared too early.
</dd></dl></dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:08 2023</div></body></html>
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h3> Portability aspects</h3>
<div>
<ul>
<li>
Can be used with an unmodified C Python, back to version 3.6
Can be used with an unmodified C Python, back to version 3.7
AFAIK. Does not depend on any external unix-specific or other
utilities.
</li>
Expand Down Expand Up @@ -408,4 +408,4 @@ <h2>
<dd><a href='https://github.com/zhuyifei1999/guppy3/issues'> https://github.com/zhuyifei1999/guppy3/issues</a></dd>
<dt> The GitHub project page is:</dt>
<dd><a href='https://github.com/zhuyifei1999/guppy3/'> https://github.com/zhuyifei1999/guppy3/</a></dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:09 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/sets.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,4 +500,4 @@ <h2>Operator</h2></dt>
a hash value based on the addresses of the elements.

</dt></dl></dd></dl></dd></dl>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat Jan 23 02:08:08 2021</div></body></html>
<hr>Generated by <a href="https://zhuyifei1999.github.io/guppy3/gsl.html">GSL-HTML 3.0.1</a> on Sat May 13 06:37:08 2023</div></body></html>
2 changes: 1 addition & 1 deletion docs/test_guppy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tests generated by: guppy.gsl.Tester
# Date: Sat Jan 23 02:08:08 2021
# Date: Sat May 13 06:37:09 2023
class Tester:
tests = {}
def test_guppy(self, arg):
Expand Down
2 changes: 1 addition & 1 deletion docs/test_heapy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tests generated by: guppy.gsl.Tester
# Date: Sat Jan 23 02:08:08 2021
# Date: Sat May 13 06:37:09 2023
class Tester:
tests = {}
def get_ex_1(self):
Expand Down
2 changes: 1 addition & 1 deletion docs/test_heapyc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tests generated by: guppy.gsl.Tester
# Date: Sat Jan 23 02:08:08 2021
# Date: Sat May 13 06:37:08 2023
class Tester:
tests = {}
def get_ex_1(self):
Expand Down
8 changes: 4 additions & 4 deletions guppy/etc/Glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ def pp(self, out=None, short=0):


class Share:
__slots__ = ('module', 'parent', 'name', 'Clamp', 'setable', 'chgable',
'importedfrom', 'nowrap', 'wrapattr', 'wrapping', 'data',
'owners', 'ispackage', 'recursion', 'preload')
has_getattr_logging_enabled = False
Clamp = None

def __init__(self, module, parent, name, Clamp):
if parent is None:
Expand All @@ -109,8 +111,7 @@ def __init__(self, module, parent, name, Clamp):
self.module = module
self.parent = parent
self.name = name
if Clamp is not None:
self.Clamp = Clamp
self.Clamp = Clamp

self.setable = getattr(Clamp, '_setable_', ())
if not isinstance(self.setable, tuple):
Expand Down Expand Up @@ -423,5 +424,4 @@ def Root():
"""
share = Share(None, None, '', None)
r = Owner('').makeInterface({'_name': ''}, share, '')
share.root_interface = r
return r
4 changes: 2 additions & 2 deletions guppy/heapy/pbhelp.py

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions guppy/heapy/test/test_ER.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ class C:
hp = self.heapy.Use
hp.reprefix = 'hp.'

import sys
s = hp.iso(C.__dict__, C, c, c.__dict__, d, sys)
s = hp.iso(C.__dict__, C, c, c.__dict__, d, inspect)

for pre in (
'Unity',
Expand Down
Loading