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

Extend python versions testing runs against #654

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', 'pypy3']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.7']

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

Expand Down
29 changes: 7 additions & 22 deletions dpkt/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
from struct import pack, unpack
import sys

if sys.version_info < (3,):
compat_ord = ord
else:
def compat_ord(char):
return char
def compat_ord(char):
return char

try:
from itertools import izip
compat_izip = izip
except ImportError:
compat_izip = zip
compat_izip = zip

try:
from cStringIO import StringIO
Expand All @@ -25,19 +18,11 @@ def compat_ord(char):
except ImportError:
from io import BytesIO

if sys.version_info < (3,):
def iteritems(d, **kw):
return d.iteritems(**kw)

def intround(num):
return int(round(num))

else:
def iteritems(d, **kw):
return iter(d.items(**kw))
def iteritems(d, **kw):
return iter(d.items(**kw))

# python3 will return an int if you round to 0 decimal places
intround = round
# python3 will return an int if you round to 0 decimal places
intround = round


def ntole(v):
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
])
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py35, py36, py37, py38
envlist = py37, py38, py39, py310, py311

[testenv]
install_command =
Expand Down