Skip to content

Commit

Permalink
Get ready for release 6.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Dec 23, 2022
1 parent 230e9a2 commit c478ee5
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ jobs:
pip install -r requirements-dev.txt
- name: Test xdis
run: |
make check
# Until workflows CI problems are fixed
make check-pytest
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,26 @@

GIT2CL ?= git2cl
PYTHON ?= python
PYTHON3 ?= python3
RM ?= rm
LINT = flake8

#EXTRA_DIST=ipython/ipy_trepan.py trepan
PHONY=all check clean dist-older dist-newer unittest check-long dist distclean lint flake8 test rmChangeLog clean_pyc
PHONY= \
all \
check \
check-long \
check-pytest \
clean \
clean_pyc \
dist \
dist-newer \
dist-older \
distclean \
flake8 \
lint \
rmChangeLog \
test \
unittest

TEST_TYPES=check-full check-short check-2.7 check-3.4

Expand All @@ -35,9 +49,9 @@ check-full: check
check-short: unittest pytest
$(MAKE) -C test check-short

#: Run unittests tests
unittest:
py.test pytest
#: Run pytest tests
check-pytest unittest:
$(PYTHON) -m pytest pytest

#: Clean up temporary files and .pyc files
clean: clean_pyc
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
6.0.5 2022-12-22
=================

* Detect versions pypy3.8.15, pypy-3.9.15
* Dectect Python 3.{7,8,9}.14 3.10.{5,6,7}
* correct 3.10+ pydisasm -F xasm label
* Revise marshal error handling (Issue #97)
* Improve PyPy 3.7 `CALL_FUNCTION` arg interpretation
* Fix 1.5-2.x bugs in line number encoding
* Fix showing `MAKE_FUNCTION` operand
* Miscellaneous lint, black, and isort changes

6.0.4 2022-05-19 HF+LB-1
========================

Expand Down
4 changes: 2 additions & 2 deletions admin-tools/check-3.1-3.2-versions.sh → admin-tools/check-3.0-3.2-versions.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ owd=$(pwd)
trap finish EXIT

cd $(dirname ${BASH_SOURCE[0]})
if ! source ./pyenv-3.1-3.2-versions ; then
if ! source ./pyenv-3.0-3.2-versions ; then
exit $?
fi
if ! source ./setup-python-3.1.sh ; then
if ! source ./setup-python-3.0.sh ; then
exit $?
fi
cd ..
Expand Down
9 changes: 7 additions & 2 deletions admin-tools/make-dist-3.1-3.2.sh → admin-tools/make-dist-3.0-3.2.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ cd $(dirname ${BASH_SOURCE[0]})
owd=$(pwd)
trap finish EXIT

if ! source ./pyenv-3.1-3.2-versions ; then
if ! source ./pyenv-3.0-3.2-versions ; then
exit $?
fi
if ! source ./setup-python-3.1.sh ; then
if ! source ./setup-python-3.0.sh ; then
exit $?
fi

Expand All @@ -37,3 +37,8 @@ for pyversion in $PYVERSIONS; do
done

python ./setup.py sdist

tarball=dist/${PACKAGE}-${__version__}.tar.gz
if [[ -f $tarball ]]; then
mv -v $tarball dist/${PACKAGE}_31-${__version__}.tar.gz
fi
9 changes: 9 additions & 0 deletions admin-tools/pyenv-3.0-3.2-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- shell-script -*-
# Sets PYVERSIONS to be pyenv versions that
# we can use in the python-3.1-to-3.2 branch.

if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
echo "This script should be *sourced* rather than run directly through bash"
exit 1
fi
export PYVERSIONS='3.0.1 3.1.5 3.2.6'
5 changes: 4 additions & 1 deletion pytest/test_disasm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import pytest
import re

import pytest
from xdis import disassemble_file
from xdis.version_info import PYTHON3, PYTHON_VERSION_TRIPLE

Expand All @@ -22,6 +22,9 @@ def get_srcdir():

if PYTHON_VERSION_TRIPLE >= (3, 2):

@pytest.mark.skipif(
os.name == "nt", reason="Windows differences in output need going over"
)
@pytest.mark.parametrize(
("test_tuple", "function_to_test"),
[
Expand Down
14 changes: 11 additions & 3 deletions pytest/test_load_file.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import os
import os.path as osp

import pytest
from xdis import IS_PYPY
from xdis.load import load_file, check_object_path, load_module
from xdis.codetype import CodeTypeUnionFields

import os.path as osp
from xdis.load import check_object_path, load_file, load_module


def get_srcdir():
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
return osp.realpath(filename)


@pytest.mark.skipif(
os.name == "nt", reason="Windows differences in output need going over"
)
def test_load_file():
srcdir = get_srcdir()
load_py = osp.realpath(osp.join(srcdir, "..", "xdis", "load.py"))
Expand Down Expand Up @@ -40,6 +44,10 @@ def test_load_file():
continue
load_file_field = getattr(co_file, field)
load_module_field = getattr(co_module, field)
if os.name == "windows" and field == "co_filename":
# MS/Windows is letter case insensitive
load_module_field = load_module_field.upper()
load_file_field = load_module_field.upper()
assert (
load_module_field == load_file_field
), "field %s\nmodule:\n\t%s\nfile:\n\t%s" % (
Expand Down
6 changes: 4 additions & 2 deletions xdis/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

from xdis.version_info import IS_PYPY, version_tuple_to_str

IS_PYPY3 = (48, 64, 112, 160, 192, 240, 244, 256)
IS_PYPY3 = (48, 64, 112, 160, 192, 240, 244, 256, 336)


def add_magic_from_int(magic_int, version):
Expand Down Expand Up @@ -342,6 +342,7 @@ def __by_version(magics) -> dict:
add_magic_from_int(224, "3.7pypy") # PyPy 3.7.9-beta0
add_magic_from_int(240, "3.7pypy") # PyPy 3.7.9-beta0
add_magic_from_int(256, "3.8pypy") # PyPy 3.8.15
add_magic_from_int(336, "3.9pypy") # PyPy 3.9.15

# NOTE: This is JVM bytecode not Python bytecode
add_magic_from_int(21150, "3.8.5Graal")
Expand All @@ -351,6 +352,7 @@ def __by_version(magics) -> dict:

magics = __by_version(versions)
magics["3.8.12pypy"] = magics["3.8.0rc1+"]
magics["3.9.15pypy"] = magics["3.9.0alpha1"]

# From a Python version given in sys.info, e.g. 3.6.1,
# what is the "canonic" version number, e.g. '3.6.0rc1'
Expand Down Expand Up @@ -436,7 +438,7 @@ def add_canonic_versions(versions, canonic):
)
add_canonic_versions(
"3.9 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 "
"3.9.14 3.9.15 3.9.16 3.9.10pypy 3.9.11pypy 3.9.12pypy 3.9.0b5+",
"3.9.14 3.9.15 3.9.16 3.9.10pypy 3.9.11pypy 3.9.12pypy 3.9.15pypy 3.9.0b5+",
"3.9.0beta5",
)

Expand Down
1 change: 1 addition & 0 deletions xdis/op_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"3.8.12pypy": opcode_38pypy,
"3.8.13pypy": opcode_38pypy,
"3.9pypy": opcode_39pypy,
"3.9.15pypy": opcode_39pypy,
}

for k, v in canonic_python_version.items():
Expand Down
2 changes: 1 addition & 1 deletion xdis/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# well as importing into Python. That's why there is no
# space around "=" below.
# fmt: off
__version__="6.0.5.dev0" # noqa
__version__="6.0.5" # noqa

0 comments on commit c478ee5

Please sign in to comment.