Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f2f2eb6

Browse files
authored
Merge pull request #46 from hugovk/master
Add support for Python 3.10, drop EOL 3.5
2 parents 30e93fe + f0b322a commit f2f2eb6

File tree

14 files changed

+29
-39
lines changed

14 files changed

+29
-39
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
18+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
1919

2020
steps:
2121
- uses: actions/checkout@v2
2222
with:
2323
fetch-depth: 1000
2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v1
25+
uses: actions/setup-python@v2
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
- name: Install dependencies
@@ -35,9 +35,9 @@ jobs:
3535
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3636
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3737
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38-
- name: Test with nose
38+
- name: Test
3939
run: |
40-
pip install nose
40+
pip install pytest
4141
ulimit -n 48
4242
ulimit -n
43-
nosetests -v
43+
pytest -v

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ clean-files:
2424
clean: clean-files clean-docs
2525

2626
test:
27-
nosetests
27+
pytest
2828

2929
coverage:
30-
nosetests --with-coverage --cover-package=smmap
31-
30+
pytest --cov smmap --cov-report xml
31+
3232
build:
3333
./setup.py build
3434

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For performance critical 64 bit applications, a simplified version of memory map
2727

2828
## Prerequisites
2929

30-
* Python 3.5+
30+
* Python 3.6+
3131
* OSX, Windows or Linux
3232

3333
The package was tested on all of the previously mentioned configurations.

doc/source/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# smmap documentation build configuration file, created by
43
# sphinx-quickstart on Wed Jun 8 15:14:25 2011.
@@ -38,8 +37,8 @@
3837
master_doc = 'index'
3938

4039
# General information about the project.
41-
project = u'smmap'
42-
copyright = u'2011, Sebastian Thiel'
40+
project = 'smmap'
41+
copyright = '2011, Sebastian Thiel'
4342

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

180179
# The name of an image file (relative to this directory) to place at the top of

doc/source/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For performance critical 64 bit applications, a simplified version of memory map
2020
#############
2121
Prerequisites
2222
#############
23-
* Python 3.5+
23+
* Python 3.6+
2424
* OSX, Windows or Linux
2525

2626
The package was tested on all of the previously mentioned configurations.

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
[bdist_wheel]
2-
universal = 1
3-
41
[flake8]
52
exclude = .tox,.venv,build,dist,doc

setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import smmap
1212

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

@@ -26,7 +26,7 @@
2626
license="BSD",
2727
packages=find_packages(),
2828
zip_safe=True,
29-
python_requires=">=3.5",
29+
python_requires=">=3.6",
3030
classifiers=[
3131
"Development Status :: 5 - Production/Stable",
3232
"Environment :: Console",
@@ -38,15 +38,13 @@
3838
"Operating System :: MacOS :: MacOS X",
3939
"Programming Language :: Python",
4040
"Programming Language :: Python :: 3",
41-
"Programming Language :: Python :: 3.5",
4241
"Programming Language :: Python :: 3.6",
4342
"Programming Language :: Python :: 3.7",
4443
"Programming Language :: Python :: 3.8",
4544
"Programming Language :: Python :: 3.9",
45+
"Programming Language :: Python :: 3.10",
4646
"Programming Language :: Python :: 3 :: Only",
4747
],
4848
long_description=long_description,
4949
long_description_content_type='text/markdown',
50-
tests_require=('nose', 'nosexcover'),
51-
test_suite='nose.collector'
5250
)

smmap/buf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
__all__ = ["SlidingWindowMapBuffer"]
55

66

7-
class SlidingWindowMapBuffer(object):
7+
class SlidingWindowMapBuffer:
88

99
"""A buffer like object which allows direct byte-wise object and slicing into
1010
memory of a mapped file. The mapping is controlled by the provided cursor.

smmap/mman.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#}END utilities
1616

1717

18-
class WindowCursor(object):
18+
class WindowCursor:
1919

2020
"""
2121
Pointer into the mapped region of the memory manager, keeping the map
@@ -233,7 +233,7 @@ def fd(self):
233233
#} END interface
234234

235235

236-
class StaticWindowMapManager(object):
236+
class StaticWindowMapManager:
237237

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

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

491491
def _obtain_region(self, a, offset, size, flags, is_recursive):
492492
# bisect to find an existing region. The c++ implementation cannot

smmap/test/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#{ Utilities
1010

11-
class FileCreator(object):
11+
class FileCreator:
1212

1313
"""A instance which creates a temporary file with a prefix and a given size
1414
and provides this info to the user.

smmap/test/test_buf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
from .lib import TestBase, FileCreator
42

53
from smmap.mman import (

smmap/test/test_mman.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
from .lib import TestBase, FileCreator
42

53
from smmap.mman import (

smmap/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def is_64_bit():
3434

3535
#{ Utility Classes
3636

37-
class MapWindow(object):
37+
class MapWindow:
3838

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

8282

83-
class MapRegion(object):
83+
class MapRegion:
8484

8585
"""Defines a mapped region of memory, aligned to pagesizes
8686
@@ -198,7 +198,7 @@ class MapRegionList(list):
198198
)
199199

200200
def __new__(cls, path):
201-
return super(MapRegionList, cls).__new__(cls)
201+
return super().__new__(cls)
202202

203203
def __init__(self, path_or_fd):
204204
self._path_or_fd = path_or_fd

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = flake8, py35, py36, py37, py38, py39
7+
envlist = flake8, py36, py37, py38, py39, py310
88

99
[testenv]
10-
commands = nosetests {posargs:--with-coverage --cover-package=smmap}
10+
commands = {envpython} -m pytest --cov smmap --cov-report xml {posargs}
1111
deps =
12-
nose
13-
nosexcover
12+
pytest
13+
pytest-cov
1414

1515
[testenv:flake8]
1616
commands = flake8 {posargs}

0 commit comments

Comments
 (0)