Skip to content

Commit 09bfbf2

Browse files
authored
Merge pull request #544 from a-detiste/master
Finish removal of six module
2 parents f1b448e + 46d64db commit 09bfbf2

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ init-import=no
517517

518518
# List of qualified module names which can have objects that can redefine
519519
# builtins.
520-
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
520+
redefining-builtins-modules=builtins,io
521521

522522

523523
[CLASSES]

nixio/hdf5/h5dataset.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
# Redistribution and use in source and binary forms, with or without
77
# modification, are permitted under the terms of the BSD License. See
88
# LICENSE file in the root of the Project.
9-
from six import ensure_str
109
import numpy as np
1110
from ..datatype import DataType
1211
from .. import util
1312

13+
def ensure_str(s):
14+
if isinstance(s, bytes):
15+
return s.decode()
16+
else:
17+
return s
18+
1419

1520
class H5DataSet:
1621

nixio/property.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@
1313
from collections import Sequence, Iterable
1414
from enum import Enum
1515
from numbers import Number
16-
from six import ensure_str, ensure_text
1716
import numpy as np
1817

1918
from .datatype import DataType
2019
from .entity import Entity
2120
from . import util
2221

22+
def ensure_str(s):
23+
if isinstance(s, bytes):
24+
return s.decode()
25+
else:
26+
return s
27+
2328

2429
class OdmlType(Enum):
2530
"""
@@ -249,7 +254,7 @@ def values(self):
249254

250255
def data_to_value(dat):
251256
if isinstance(dat, bytes):
252-
dat = ensure_str(dat) # py2compat
257+
dat = dat.decode()
253258
return dat
254259

255260
values = tuple(map(data_to_value, data))
@@ -274,7 +279,7 @@ def values(self, vals):
274279
# Make sure all values are of the same data type
275280
vtype = self._check_new_value_types(vals)
276281
if vtype == DataType.String:
277-
vals = [ensure_text(v) for v in vals] # py2compat
282+
vals = [str(v) for v in vals]
278283
self._h5dataset.shape = np.shape(vals)
279284
data = np.array(vals, dtype=vtype)
280285
self._h5dataset.write_data(data)

scripts/dorelease.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def update_info(newver):
105105
infodict = json.load(infofile)
106106

107107
verstring = infodict["VERSION"]
108-
newverstring = re.sub("[0-9\.a-z]+", newver, verstring)
108+
newverstring = re.sub(r"[0-9\.a-z]+", newver, verstring)
109109

110110
if newverstring == verstring:
111111
print("No changes required in info.json")
@@ -140,7 +140,7 @@ def update_ci_confs(newver):
140140
newconf = []
141141
for line in oldconf:
142142
if "NIX_BRANCH" in line:
143-
line = re.sub("1\.[0-9\.]+[0-9\.a-z]+(dev){0,1}", nixbranch, line)
143+
line = re.sub(r"1\.[0-9\.]+[0-9\.a-z]+(dev){0,1}", nixbranch, line)
144144
line = line.replace("master", nixbranch)
145145
newconf.append(line)
146146

@@ -168,7 +168,7 @@ def update_ci_confs(newver):
168168
# newconf = []
169169
# for line in oldconf:
170170
# if "NIX_VERSION" in line:
171-
# line = re.sub("'[1-9\.a-z]+'", "'" + newver + "'", line)
171+
# line = re.sub(r"'[1-9\.a-z]+'", "'" + newver + "'", line)
172172
# newconf.append(line)
173173

174174
# diff = diff_lines(oldconf, newconf)

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def get_wheel_data():
5353
'Programming Language :: Python',
5454
'Programming Language :: Python :: 3.6',
5555
'Programming Language :: Python :: 3.7',
56+
'Programming Language :: Python :: 3.8',
57+
'Programming Language :: Python :: 3.9',
58+
'Programming Language :: Python :: 3.10',
59+
'Programming Language :: Python :: 3.11',
60+
'Programming Language :: Python :: 3.12',
5661
'Topic :: Scientific/Engineering'
5762
]
5863

@@ -78,7 +83,7 @@ def get_wheel_data():
7883
tests_require=['pytest', 'scipy', 'pillow', 'matplotlib'],
7984
test_suite='pytest',
8085
setup_requires=['pytest-runner'],
81-
install_requires=['numpy', 'h5py', 'six', 'enum34;python_version<"3.4"'],
86+
install_requires=['numpy', 'h5py'],
8287
package_data={'nixio': [license_text, description_text]},
8388
include_package_data=True,
8489
zip_safe=False,

0 commit comments

Comments
 (0)