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

Add support for Python 3.10, drop EOL 3.5 #46

Merged
merged 5 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1000
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -35,9 +35,9 @@ jobs:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with nose
- name: Test
run: |
pip install nose
pip install pytest
ulimit -n 48
ulimit -n
nosetests -v
pytest -v
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ clean-files:
clean: clean-files clean-docs

test:
nosetests
pytest

coverage:
nosetests --with-coverage --cover-package=smmap
pytest --cov smmap --cov-report xml

build:
./setup.py build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ For performance critical 64 bit applications, a simplified version of memory map

## Prerequisites

* Python 3.5+
* Python 3.6+
* OSX, Windows or Linux

The package was tested on all of the previously mentioned configurations.
Expand Down
9 changes: 4 additions & 5 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# smmap documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 8 15:14:25 2011.
Expand Down Expand Up @@ -38,8 +37,8 @@
master_doc = 'index'

# General information about the project.
project = u'smmap'
copyright = u'2011, Sebastian Thiel'
project = 'smmap'
copyright = '2011, Sebastian Thiel'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -173,8 +172,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'smmap.tex', u'smmap Documentation',
u'Sebastian Thiel', 'manual'),
('index', 'smmap.tex', 'smmap Documentation',
'Sebastian Thiel', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
2 changes: 1 addition & 1 deletion doc/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For performance critical 64 bit applications, a simplified version of memory map
#############
Prerequisites
#############
* Python 3.5+
* Python 3.6+
* OSX, Windows or Linux

The package was tested on all of the previously mentioned configurations.
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[bdist_wheel]
universal = 1

[flake8]
exclude = .tox,.venv,build,dist,doc
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import smmap

if os.path.exists("README.md"):
long_description = open('README.md', "r", encoding="utf-8").read().replace('\r\n', '\n')
long_description = open('README.md', encoding="utf-8").read().replace('\r\n', '\n')
else:
long_description = "See https://github.com/gitpython-developers/smmap"

Expand All @@ -26,7 +26,7 @@
license="BSD",
packages=find_packages(),
zip_safe=True,
python_requires=">=3.5",
python_requires=">=3.6",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -38,15 +38,13 @@
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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 :: Only",
],
long_description=long_description,
long_description_content_type='text/markdown',
tests_require=('nose', 'nosexcover'),
test_suite='nose.collector'
)
2 changes: 1 addition & 1 deletion smmap/buf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__all__ = ["SlidingWindowMapBuffer"]


class SlidingWindowMapBuffer(object):
class SlidingWindowMapBuffer:

"""A buffer like object which allows direct byte-wise object and slicing into
memory of a mapped file. The mapping is controlled by the provided cursor.
Expand Down
6 changes: 3 additions & 3 deletions smmap/mman.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#}END utilities


class WindowCursor(object):
class WindowCursor:

"""
Pointer into the mapped region of the memory manager, keeping the map
Expand Down Expand Up @@ -233,7 +233,7 @@ def fd(self):
#} END interface


class StaticWindowMapManager(object):
class StaticWindowMapManager:

"""Provides a manager which will produce single size cursors that are allowed
to always map the whole file.
Expand Down Expand Up @@ -486,7 +486,7 @@ class SlidingWindowMapManager(StaticWindowMapManager):

def __init__(self, window_size=-1, max_memory_size=0, max_open_handles=sys.maxsize):
"""Adjusts the default window size to -1"""
super(SlidingWindowMapManager, self).__init__(window_size, max_memory_size, max_open_handles)
super().__init__(window_size, max_memory_size, max_open_handles)

def _obtain_region(self, a, offset, size, flags, is_recursive):
# bisect to find an existing region. The c++ implementation cannot
Expand Down
2 changes: 1 addition & 1 deletion smmap/test/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#{ Utilities

class FileCreator(object):
class FileCreator:

"""A instance which creates a temporary file with a prefix and a given size
and provides this info to the user.
Expand Down
2 changes: 0 additions & 2 deletions smmap/test/test_buf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

from .lib import TestBase, FileCreator

from smmap.mman import (
Expand Down
2 changes: 0 additions & 2 deletions smmap/test/test_mman.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

from .lib import TestBase, FileCreator

from smmap.mman import (
Expand Down
6 changes: 3 additions & 3 deletions smmap/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def is_64_bit():

#{ Utility Classes

class MapWindow(object):
class MapWindow:

"""Utility type which is used to snap windows towards each other, and to adjust their size"""
__slots__ = (
Expand Down Expand Up @@ -80,7 +80,7 @@ def extend_right_to(self, window, max_size):
self.size = min(self.size + (window.ofs - self.ofs_end()), max_size)


class MapRegion(object):
class MapRegion:

"""Defines a mapped region of memory, aligned to pagesizes

Expand Down Expand Up @@ -198,7 +198,7 @@ class MapRegionList(list):
)

def __new__(cls, path):
return super(MapRegionList, cls).__new__(cls)
return super().__new__(cls)

def __init__(self, path_or_fd):
self._path_or_fd = path_or_fd
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# and then run "tox" from this directory.

[tox]
envlist = flake8, py35, py36, py37, py38, py39
envlist = flake8, py36, py37, py38, py39, py310

[testenv]
commands = nosetests {posargs:--with-coverage --cover-package=smmap}
commands = {envpython} -m pytest --cov smmap --cov-report xml {posargs}
deps =
nose
nosexcover
pytest
pytest-cov

[testenv:flake8]
commands = flake8 {posargs}
Expand Down