From nobody Fri Mar 25 13:50:49 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1A0F31A3464E; Fri, 25 Mar 2022 13:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KQ3QL6VFwz3h52; Fri, 25 Mar 2022 13:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbOT/95jwfl2+atZokzEZPC5LTfZkSREsnOSP3ta3zU=; b=vN6Ie/UNIk2fintfGwjlUA1emXECPPTulvSBrG6/PqYlcAVb49d9CwhARrBKydbHhVlav3 EzozqWT+CowmcNNcYF+LVSekEpxfZL2TDIzyxtULt3/PSLgzaisC3l4FlQpY9jKuVFwIEi nLt2yRxJXZjHmLRmMeIsRwhNqryu5NdO+REXCS6ZVBWjp0Hrv3jaYbvdzFxzVWPYwARkW0 ibW4g98qLzf4Its1yhuJXq8TKPCXfgZuUBA5B38beR/3CiIVh8rQLakcymHrTcuOoYMZqe F/W3gAGmDBubZfVbBQSF7XjYf3svLk2vEXH5WmW44747Z8U7Ho2JaROKpxiU5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF5E15550; Fri, 25 Mar 2022 13:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22PDon9f037465; Fri, 25 Mar 2022 13:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22PDon9c037464; Fri, 25 Mar 2022 13:50:49 GMT (envelope-from git) Date: Fri, 25 Mar 2022 13:50:49 GMT Message-Id: <202203251350.22PDon9c037464@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 1fe901964063 - main - science/py-segyio: Fix build with setuptools 58.0.0+ List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fe9019640633bef302e1e0f582ea87a08440821 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbOT/95jwfl2+atZokzEZPC5LTfZkSREsnOSP3ta3zU=; b=PVit8t/feWyEByRWg5mqhxBzONU1gBxntd667mmuHtzXW3aI+ZALfSjwjQpMZKAppRWCcW bogHNzQNT7pSlGHyNz7oaBdRC2sIaepF023+Q+9XjEC7r83OZ9Bda7sf3pS8GRC+AJnch+ MY+zSlnlELhuKLSZChV5rk57jImjcyBEL/VEi2UA2dPJBwpvL93YjrrFs2W7puWHusNwmd /aP8YtcojtLjcwmhFhchniD7LWW7e/kLzQ17ug/qezjWR0aFKbWAzH9Lb0Cqhrz9htKKZJ o2CFPJ+x67PSgwTONojplyaFLQz4e9ENzjPR72kNaJG3ZqMInPwzuZLjqcOh/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648216251; a=rsa-sha256; cv=none; b=Dp3spyd2v4IPOx3BaHqNJr0rIOMyE5DI78fbKVUcCytolnItKfQS8O1x6R64bz6fc5OcR2 6nqkOl/QjAfDpvWWptA8YK/2dG2oI+mUYeX5TFQ+LAj5LSdxYXc7vI5odEXGFMsD/yXUlu +berw+oYdQg92Zv/cagya8cfYEAqr31RAwjCGZgPBkBvbRPUWssR0xYUYrvuHskTTGy7q2 OmCWA68k4P6L1v6eB0Eyo3p0DYAOj/cekSbRtAAq0YdhXU1sM3MdcbQ/BcMNKlM1an7eWI NswD/VEPgPuYfvZxrJylNA1GTfuTIamh6tqosYtXLqw7wjVLWtldyks/1kjFeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=1fe9019640633bef302e1e0f582ea87a08440821 commit 1fe9019640633bef302e1e0f582ea87a08440821 Author: Po-Chuan Hsieh AuthorDate: 2022-03-25 13:33:39 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-03-25 13:38:19 +0000 science/py-segyio: Fix build with setuptools 58.0.0+ With hat: python --- science/py-segyio/Makefile | 2 + science/py-segyio/files/patch-2to3 | 302 +++++++++++++++++++++++++++++++++++++ 2 files changed, 304 insertions(+) diff --git a/science/py-segyio/Makefile b/science/py-segyio/Makefile index 7c16fa42e7cf..22ff57c30ff5 100644 --- a/science/py-segyio/Makefile +++ b/science/py-segyio/Makefile @@ -28,6 +28,8 @@ WRKSRC_SUBDIR= python post-install: @${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/segyio/_segyio*.so + ${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} + ${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} do-test: # tests fail: https://github.com/equinor/segyio/issues/511 @cd ${WRKSRC} && \ diff --git a/science/py-segyio/files/patch-2to3 b/science/py-segyio/files/patch-2to3 new file mode 100644 index 000000000000..5e35d56f2dc5 --- /dev/null +++ b/science/py-segyio/files/patch-2to3 @@ -0,0 +1,302 @@ +--- segyio/__init__.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/__init__.py +@@ -51,7 +51,7 @@ class Enum(object): + return int(self._value) + + def __str__(self): +- for k, v in self.__class__.__dict__.items(): ++ for k, v in list(self.__class__.__dict__.items()): + if isinstance(v, int) and self._value == v: + return k + return "Unknown Enum" +@@ -76,7 +76,7 @@ class Enum(object): + @classmethod + def enums(cls): + result = [] +- for v in cls.__dict__.values(): ++ for v in list(cls.__dict__.values()): + if isinstance(v, int): + result.append(cls(v)) + +--- segyio/create.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/create.py +@@ -200,7 +200,7 @@ def create(filename, spec): + + if endian not in endians: + problem = 'unknown endianness {}, expected one of: ' +- opts = ' '.join(endians.keys()) ++ opts = ' '.join(list(endians.keys())) + raise ValueError(problem.format(endian) + opts) + + fd = _segyio.segyiofd(str(filename), 'w+', endians[endian]) +--- segyio/depth.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/depth.py +@@ -172,7 +172,7 @@ class Depth(Sequence): + >>> depth[::2] = other + """ + if isinstance(depth, slice): +- for i, x in zip(range(*depth.indices(len(self))), val): ++ for i, x in zip(list(range(*depth.indices(len(self)))), val): + self[i] = x + return + +--- segyio/field.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/field.py +@@ -456,7 +456,7 @@ class Field(MutableMapping): + return False + + def intkeys(d): +- return { int(k): v for k, v in d.items() } ++ return { int(k): v for k, v in list(d.items()) } + + return intkeys(self) == intkeys(other) + +@@ -513,13 +513,13 @@ class Field(MutableMapping): + for key in other: + self.putfield(buf, int(key), other[key]) + elif hasattr(other, "keys"): +- for key in other.keys(): ++ for key in list(other.keys()): + self.putfield(buf, int(key), other[key]) + else: + for key, value in other: + self.putfield(buf, int(key), value) + +- for key, value in kwargs.items(): ++ for key, value in list(kwargs.items()): + self.putfield(buf, int(self._kwargs[key]), value) + + self.buf = buf +@@ -543,4 +543,4 @@ class Field(MutableMapping): + ).reload() + + def __repr__(self): +- return repr(self[self.keys()]) ++ return repr(self[list(self.keys())]) +--- segyio/gather.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/gather.py +@@ -119,7 +119,7 @@ class Gather(object): + offs = slice(off, off + 1, 1) + + xs = list(filter(self.offsets.__contains__, +- range(*offs.indices(self.offsets[-1]+1)))) ++ list(range(*offs.indices(self.offsets[-1]+1))))) + + empty = np.empty(0, dtype = self.trace.dtype) + # gather[int,int,:] +@@ -138,8 +138,8 @@ class Gather(object): + # buffered, and traces can be read from the iline. This is the + # least efficient when there are very few traces read per inline, + # but huge savings with larger subcubes +- last_il = self.iline.keys()[-1] + 1 +- last_xl = self.xline.keys()[-1] + 1 ++ last_il = list(self.iline.keys())[-1] + 1 ++ last_xl = list(self.xline.keys())[-1] + 1 + + il_slice = il if isslice(il) else slice(il, il+1) + xl_slice = xl if isslice(xl) else slice(xl, xl+1) +@@ -149,15 +149,15 @@ class Gather(object): + # but it's unnecessary to chck all keys up until the first xline + # because that will never be a hit anyway + if il_slice.start is None: +- start = self.iline.keys()[0] ++ start = list(self.iline.keys())[0] + il_slice = slice(start, il_slice.stop, il_slice.step) + + if xl_slice.start is None: +- start = self.xline.keys()[0] ++ start = list(self.xline.keys())[0] + xl_slice = slice(start, xl_slice.stop, xl_slice.step) + +- il_range = range(*il_slice.indices(last_il)) +- xl_range = range(*xl_slice.indices(last_xl)) ++ il_range = list(range(*il_slice.indices(last_il))) ++ xl_range = list(range(*xl_slice.indices(last_xl))) + + # the try-except-else is essentially a filter on in/xl keys, but + # delegates the work (and decision) to the iline and xline modes +@@ -372,7 +372,7 @@ class Groups(Mapping): + pass + + try: +- items = key.items() ++ items = list(key.items()) + except AttributeError: + items = iter(key) + +@@ -420,15 +420,15 @@ class Groups(Mapping): + return Group(key, self, self.bins[key]) + + def values(self): +- for key, index in self.bins.items(): ++ for key, index in list(self.bins.items()): + yield Group(key, self, index) + + def items(self): +- for key, index in self.bins.items(): ++ for key, index in list(self.bins.items()): + yield key, Group(key, self, index) + + def __iter__(self): +- return self.bins.keys() ++ return list(self.bins.keys()) + + def sort(self, fields): + """ +@@ -436,7 +436,7 @@ class Groups(Mapping): + """ + bins = collections.OrderedDict() + +- for key, index in self.bins.items(): ++ for key, index in list(self.bins.items()): + g = Group(key, self, index) + g.sort(fields) + bins[key] = g.index +--- segyio/line.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/line.py +@@ -91,12 +91,12 @@ class Line(Mapping): + if not isinstance(offset, slice): + offset = slice(offset, offset + 1) + +- index = sanitize_slice(index, self.heads.keys()) +- offset = sanitize_slice(offset, self.offsets.keys()) +- irange = range(*index.indices(max(self.heads.keys()) + 1)) +- orange = range(*offset.indices(max(self.offsets.keys()) + 1)) +- irange = filter(self.heads.__contains__, irange) +- orange = filter(self.offsets.__contains__, orange) ++ index = sanitize_slice(index, list(self.heads.keys())) ++ offset = sanitize_slice(offset, list(self.offsets.keys())) ++ irange = list(range(*index.indices(max(self.heads.keys()) + 1))) ++ orange = list(range(*offset.indices(max(self.offsets.keys()) + 1))) ++ irange = list(filter(self.heads.__contains__, irange)) ++ orange = list(filter(self.offsets.__contains__, orange)) + # offset-range is used in inner loops, so make it a list for + # reusability. offsets are usually few, so no real punishment by using + # non-generators here +@@ -344,7 +344,7 @@ class Line(Mapping): + + def items(self): + """D.values() -> generator of D's (key,values), as 2-tuples""" +- return zip(self.keys(), self[:]) ++ return zip(list(self.keys()), self[:]) + + class HeaderLine(Line): + """ +--- segyio/open.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/open.py +@@ -155,7 +155,7 @@ def open(filename, mode="r", iline = 189, + + if endian not in endians: + problem = 'unknown endianness {}, expected one of: ' +- opts = ' '.join(endians.keys()) ++ opts = ' '.join(list(endians.keys())) + raise ValueError(problem.format(endian) + opts) + + from . import _segyio +--- segyio/segy.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/segy.py +@@ -910,7 +910,7 @@ class SegyFile(object): + + if sorting not in valid_sortings: + error = "Invalid sorting" +- solution = "valid sorting options are: {}".format(valid_sortings.keys()) ++ solution = "valid sorting options are: {}".format(list(valid_sortings.keys())) + raise ValueError('{}, {}'.format(error, solution)) + + if offsets is None: +--- segyio/su/file.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/su/file.py +@@ -89,7 +89,7 @@ def open(filename, mode = 'r', iline = 189, + + if endian not in endians: + problem = 'unknown endianness, must be one of: ' +- candidates = ' '.join(endians.keys()) ++ candidates = ' '.join(list(endians.keys())) + raise ValueError(problem + candidates) + + from .. import _segyio +--- segyio/tools.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/tools.py +@@ -289,7 +289,7 @@ def rotation(f, line = 'fast'): + + if line not in lines: + error = "Unknown line {}".format(line) +- solution = "Must be any of: {}".format(' '.join(lines.keys())) ++ solution = "Must be any of: {}".format(' '.join(list(lines.keys()))) + raise ValueError('{} {}'.format(error, solution)) + + l = lines[line] +@@ -299,7 +299,7 @@ def rotation(f, line = 'fast'): + rot = f.xfd.rotation( len(l), + l.stride, + len(f.offsets), +- np.fromiter(l.keys(), dtype = np.intc) ) ++ np.fromiter(list(l.keys()), dtype = np.intc) ) + return rot, cdpx, cdpy + + def metadata(f): +@@ -466,7 +466,7 @@ def from_array(filename, data, iline=189, + data = np.asarray(data) + dimensions = len(data.shape) + +- if dimensions not in range(2, 5): ++ if dimensions not in list(range(2, 5)): + problem = "Expected 2, 3, or 4 dimensions, {} was given".format(dimensions) + raise ValueError(problem) + +--- segyio/trace.py.orig 2022-02-18 06:49:44 UTC ++++ segyio/trace.py +@@ -198,7 +198,7 @@ class Trace(Sequence): + step = 1 + single = True + +- n_elements = len(range(start, stop, step)) ++ n_elements = len(list(range(start, stop, step))) + + try: + i = self.wrapindex(i) +@@ -278,7 +278,7 @@ class Trace(Sequence): + + """ + if isinstance(i, slice): +- for j, x in zip(range(*i.indices(len(self))), val): ++ for j, x in zip(list(range(*i.indices(len(self)))), val): + self[j] = x + + return +@@ -388,7 +388,7 @@ class RawTrace(Trace): + msg = 'trace indices must be integers or slices, not {}' + raise TypeError(msg.format(type(i).__name__)) + start, _, step = indices +- length = len(range(*indices)) ++ length = len(list(range(*indices))) + buf = np.empty((length, self.shape), dtype = self.dtype) + return self.filehandle.gettr(buf, start, step, length, 0, self.shape, 1, self.shape) + +@@ -435,7 +435,7 @@ class RefTrace(Trace): + be useful in certain contexts to provide stronger guarantees. + """ + garbage = [] +- for i, (x, signature) in self.refs.items(): ++ for i, (x, signature) in list(self.refs.items()): + if sys.getrefcount(x) == 3: + garbage.append(i) + +@@ -841,7 +841,7 @@ class Attributes(Sequence): + field = self.field + + start, stop, step = i.indices(traces) +- indices = range(start, stop, step) ++ indices = list(range(start, stop, step)) + attrs = np.empty(len(indices), dtype = self.dtype) + return filehandle.field_forall(attrs, start, stop, step, field) + +@@ -955,7 +955,7 @@ class Text(Sequence): + msg = 'trace indices must be integers or slices, not {}' + raise TypeError(msg.format(type(i).__name__)) + +- for i, text in zip(range(*indices), val): ++ for i, text in zip(list(range(*indices)), val): + if isinstance(text, Text): + text = text[0] + self.filehandle.puttext(i, text)