From nobody Fri Mar 25 13:50:37 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 F1B6D1A3443E; Fri, 25 Mar 2022 13:50:39 +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 4KQ3Q66VJ5z3RFf; Fri, 25 Mar 2022 13:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216239; 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=5BASNK2a82INBOw38UrAsaQbd2wscKZyVINI+XNTTMc=; b=x6KT9OiGKd3G//OTft1o++iDdBCyu6uRSYQ3BqajnW8hDc4bQieHIkUjKbYCQ4yQacR8dc Qf7TNqUVre3QouBPaI89Vs6Vos4/mWyzrDBGOF4nJ0E88mNIrlhkQUfxgmKI1U965MlLXt vUllCND6NBzioqPfCqFST8LHeZoLbXiy6jQfi+6zPXbIDTKY818vYt4Lhrl0tNwFQuEXv7 z733nZIxxBoNMDibQlCwEPIens3vI2+Lijtzk7y+/HsXzOZl7bt1VMEB/34XsU4W09+qeD y69oPjDGyteQfHA8RATdzf+PxYGEO4lc3YWCCsyM/U1RKz+DbcVuD6YQal8bxg== 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 8A4EB56B5; Fri, 25 Mar 2022 13:50:37 +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 22PDobg3037189; Fri, 25 Mar 2022 13:50:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22PDob5r037188; Fri, 25 Mar 2022 13:50:37 GMT (envelope-from git) Date: Fri, 25 Mar 2022 13:50:37 GMT Message-Id: <202203251350.22PDob5r037188@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: 40c11ec8efd3 - main - misc/py-kartograph: 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: 40c11ec8efd3e8ebf36a469e1498306eb373b240 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216239; 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=5BASNK2a82INBOw38UrAsaQbd2wscKZyVINI+XNTTMc=; b=LlYEiXIrjEutc/D4uWn0IQMurc3car54a16Tq0NSzx4/NqZD6M2Ho0relQTV3OPTdtCIdQ 6gPGWUm9XtFqR8BMblXKOIKm3+82ZOrTaFiH0DRjswVfrnm9XnZle1l4xgq32X2cUhw455 A5EbC3iGodXkhk7rZsOkZAHmsxbmCQciWpZTNTScQnbpcvuabZrVieaHRewvMmbPkqnXnn YYSEnfmbmOFEZZUQ5yxU4hncZA7WLcjdCAMqX5l1xYpl3KpZUcoXq17yxkrdcFIYastrGw 02PyzkZxRECp7hTSF8XcCEJO3bPKvgZWfUJLeGW5aXakMAdi/Ir//Rfoupff8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648216239; a=rsa-sha256; cv=none; b=TO+IWBwHQQunnUnjvDNOUWX6ha7w2FKIIX3rhaPc5DvDp2/2CygdyGDcQfyO1OH0j2lz+h WQbEp/iN0+7D3sdkCUrvlyQwI84BoPGJzQupvE4HDPD3vGuqTpXauAXBgXWBXwDofVGFgG XM7dQYR178T1Dnha1fWQ+H2HU9Qd0sYkeJs/yOpTkMe4wXU4zHdfUdxm82k9fZUUv7prDA FGPsTID09sFgUsy5v743T2F9B3gKkRsu5ct8yNgpKHC2zhn7qXcspoaxlN8P7dfQK9QvnT PjPz4lbzv66UAkr8dKdwyo27TDLR+U++kdSsS61bCa+CQ0t2PGlIR4wIu/a+tw== 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=40c11ec8efd3e8ebf36a469e1498306eb373b240 commit 40c11ec8efd3e8ebf36a469e1498306eb373b240 Author: Po-Chuan Hsieh AuthorDate: 2022-03-25 13:32:57 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-03-25 13:38:17 +0000 misc/py-kartograph: Fix build with setuptools 58.0.0+ With hat: python --- misc/py-kartograph/files/patch-2to3 | 379 ++++++++++++++++++++++++++++++++++++ 1 file changed, 379 insertions(+) diff --git a/misc/py-kartograph/files/patch-2to3 b/misc/py-kartograph/files/patch-2to3 new file mode 100644 index 000000000000..ea79cd778eda --- /dev/null +++ b/misc/py-kartograph/files/patch-2to3 @@ -0,0 +1,379 @@ +--- kartograph/cli.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/cli.py +@@ -6,7 +6,7 @@ command line interface for kartograph + import argparse + import os + import os.path +-from options import read_map_config ++from .options import read_map_config + import sys + + +@@ -37,7 +37,7 @@ parser.add_argument('--format', '-f', metavar='svg', h + parser.add_argument('--preview', '-p', nargs='?', metavar='', const=True, help='opens the generated svg for preview') + parser.add_argument('--pretty-print', '-P', dest='pretty_print', action='store_true', help='pretty print the svg file') + +-from kartograph import Kartograph ++from .kartograph import Kartograph + import time + import os + +@@ -74,7 +74,7 @@ def render_map(args): + # print str(r) + pass + +- except Exception, e: ++ except Exception as e: + print_error(e) + exit(-1) + +@@ -98,17 +98,17 @@ def main(): + + try: + args = parser.parse_args() +- except IOError, e: ++ except IOError as e: + # parser.print_help() + sys.stderr.write('\n' + str(e) + '\n') +- except Exception, e: ++ except Exception as e: + parser.print_help() +- print '\nError:', e ++ print('\nError:', e) + else: + args.func(args) + elapsed = (time.time() - start) + if args.output != '-': +- print 'execution time: %.3f secs' % elapsed ++ print('execution time: %.3f secs' % elapsed) + + sys.exit(0) + +--- kartograph/kartograph.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/kartograph.py +@@ -1,11 +1,11 @@ + +-from options import parse_options ++from .options import parse_options + from shapely.geometry import Polygon, LineString, MultiPolygon +-from errors import * ++from .errors import * + from copy import deepcopy +-from renderer import SvgRenderer +-from mapstyle import MapStyle +-from map import Map ++from .renderer import SvgRenderer ++from .mapstyle import MapStyle ++from .map import Map + import os + + +@@ -64,14 +64,14 @@ class Kartograph(object): + command = commands[sys.platform] + else: + sys.stderr.write('don\'t know how to preview SVGs on your system. Try setting the KARTOGRAPH_PREVIEW environment variable.') +- print renderer ++ print(renderer) + return + renderer.preview(command) + # Write the map to a file or return the renderer instance. + if outfile is None: + return renderer + elif outfile == '-': +- print renderer ++ print(renderer) + else: + renderer.write(outfile) + else: +--- kartograph/layersource/postgislayer.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/layersource/postgislayer.py +@@ -1,5 +1,5 @@ + +-from layersource import LayerSource ++from .layersource import LayerSource + from kartograph.errors import * + from kartograph.geometry import create_feature + import shapely.wkb +@@ -72,11 +72,11 @@ class PostGISLayer(LayerSource): + if fields[f] != self.geom_col: + # but ignore null values + if rec[f]: +- if isinstance(rec[f], (str, unicode)): ++ if isinstance(rec[f], str): + try: + meta[fields[f]] = rec[f].decode('utf-8') + except: +- print 'decoding error', fields[f], rec[f] ++ print('decoding error', fields[f], rec[f]) + meta[fields[f]] = '--decoding error--' + else: + meta[fields[f]] = rec[f] +@@ -84,7 +84,7 @@ class PostGISLayer(LayerSource): + # Store geometry + geom_wkb = rec[f] + +- if filter is None or filter(meta): ++ if filter is None or list(filter(meta)): + # construct geometry + geom = shapely.wkb.loads(geom_wkb.decode('hex')) + # Finally we construct the map feature and append it to the +--- kartograph/layersource/shplayer.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/layersource/shplayer.py +@@ -1,11 +1,11 @@ + +-from layersource import LayerSource ++from .layersource import LayerSource + from kartograph.errors import * + from kartograph.geometry import BBox, create_feature + from os.path import exists + from osgeo.osr import SpatialReference + import pyproj +-import shapefile ++from . import shapefile + + + verbose = False +@@ -20,7 +20,7 @@ class ShapefileLayer(LayerSource): + """ + initialize shapefile reader + """ +- if isinstance(src, unicode): ++ if isinstance(src, str): + src = src.encode('ascii', 'ignore') + src = self.find_source(src) + self.shpSrc = src +@@ -93,7 +93,7 @@ class ShapefileLayer(LayerSource): + for j in range(len(self.attributes)): + drec[self.attributes[j]] = self.recs[i][j] + # For each record that is not filtered.. +- if filter is None or filter(drec): ++ if filter is None or list(filter(drec)): + props = {} + # ..we try to decode the attributes (shapefile charsets are arbitrary) + for j in range(len(self.attributes)): +@@ -107,10 +107,10 @@ class ShapefileLayer(LayerSource): + break + except: + if verbose: +- print 'warning: could not decode "%s" to %s' % (val, enc) ++ print('warning: could not decode "%s" to %s' % (val, enc)) + if not decoded: + raise KartographError('having problems to decode the input data "%s"' % val) +- if isinstance(val, (str, unicode)): ++ if isinstance(val, str): + val = val.strip() + props[self.attributes[j]] = val + +@@ -129,7 +129,7 @@ class ShapefileLayer(LayerSource): + feature = create_feature(geom, props) + res.append(feature) + if bbox is not None and ignored > 0 and verbose: +- print "-ignoring %d shapes (not in bounds %s )" % (ignored, bbox) ++ print("-ignoring %d shapes (not in bounds %s )" % (ignored, bbox)) + return res + + # # shape2geometry +--- kartograph/map.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/map.py +@@ -1,11 +1,11 @@ + from shapely.geometry import Polygon + from shapely.geometry.base import BaseGeometry +-from maplayer import MapLayer +-from geometry.utils import geom_to_bbox +-from geometry import BBox, View +-from proj import projections +-from filter import filter_record +-from errors import KartographError ++from .maplayer import MapLayer ++from .geometry.utils import geom_to_bbox ++from .geometry import BBox, View ++from .proj import projections ++from .filter import filter_record ++from .errors import KartographError + import sys + + # Map +@@ -154,7 +154,7 @@ class Map(object): + ### Initialize bounding polygons and bounding box + ### Compute the projected bounding box + """ +- from geometry.utils import bbox_to_polygon ++ from .geometry.utils import bbox_to_polygon + + opts = self.options + proj = self.proj +@@ -306,7 +306,7 @@ class Map(object): + """ + ### Simplify geometries + """ +- from simplify import create_point_store, simplify_lines ++ from .simplify import create_point_store, simplify_lines + + # We will use a glocal point cache for all layers. If the + # same point appears in more than one layer, it will be +@@ -421,7 +421,7 @@ class Map(object): + a single feature. Kartograph uses the geometry.union() method of shapely + to do that. + """ +- from geometry.utils import join_features ++ from .geometry.utils import join_features + + for layer in self.layers: + if layer.options['join'] is not False: +@@ -517,7 +517,7 @@ class Map(object): + for feat in groupFeatures[g_id]: + exp[g_id].append(feat.props[join['export-ids']]) + import json +- print json.dumps(exp) ++ print(json.dumps(exp)) + + layer.features = res + +--- kartograph/proj/__init__.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/proj/__init__.py +@@ -18,8 +18,8 @@ + + projections = dict() + +-from base import Proj +-from cylindrical import * ++from .base import Proj ++from .cylindrical import * + + projections['lonlat'] = Equirectangular + projections['cea'] = CEA +@@ -30,7 +30,7 @@ projections['balthasart'] = Balthasart + projections['mercator'] = Mercator + projections['ll'] = LonLat + +-from pseudocylindrical import * ++from .pseudocylindrical import * + + projections['naturalearth'] = NaturalEarth + projections['robinson'] = Robinson +@@ -47,7 +47,7 @@ projections['aitoff'] = Aitoff + projections['winkel3'] = Winkel3 + projections['nicolosi'] = Nicolosi + +-from azimuthal import * ++from .azimuthal import * + + projections['ortho'] = Orthographic + projections['laea'] = LAEA +@@ -58,11 +58,11 @@ projections['satellite'] = Satellite + projections['eda'] = EquidistantAzimuthal + projections['aitoff'] = Aitoff + +-from conic import * ++from .conic import * + + projections['lcc'] = LCC + +-from proj4 import Proj4 ++from .proj4 import Proj4 + + projections['proj4'] = Proj4 + +@@ -78,7 +78,7 @@ if __name__ == '__main__': + #assert (round(x,2),round(y,2)) == (3962799.45, -2999718.85), 'LAEA proj error' + from kartograph.geometry import BBox + +- print Proj.fromXML(Robinson(lat0=3, lon0=4).toXML(), projections) ++ print(Proj.fromXML(Robinson(lat0=3, lon0=4).toXML(), projections)) + + Robinson(lat0=3, lon0=4) + +@@ -87,10 +87,10 @@ if __name__ == '__main__': + bbox = BBox() + try: + proj = Proj(lon0=60) +- print proj.project(0, 0) +- print proj.world_bounds(bbox) +- print proj.toXML() ++ print(proj.project(0, 0)) ++ print(proj.world_bounds(bbox)) ++ print(proj.toXML()) + except: +- print 'Error', pj +- print sys.exc_info()[0] ++ print('Error', pj) ++ print(sys.exc_info()[0]) + raise +--- kartograph/proj/azimuthal/azimuthal.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/proj/azimuthal/azimuthal.py +@@ -62,7 +62,7 @@ class Azimuthal(Proj): + def sea_shape(self, llbbox=(-180, -90, 180, 90)): + out = [] + if llbbox == (-180, -90, 180, 90) or llbbox == [-180, -90, 180, 90]: +- print "-> full extend" ++ print("-> full extend") + for phi in range(0, 360): + x = self.r + math.cos(math.radians(phi)) * self.r + y = self.r + math.sin(math.radians(phi)) * self.r +--- kartograph/renderer/svg.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/renderer/svg.py +@@ -239,7 +239,7 @@ class SvgRenderer(MapRenderer): + + key = labelOpts['key'] + if not key: +- key = feature.props.keys()[0] ++ key = list(feature.props.keys())[0] + if key not in feature.props: + #sys.stderr.write('could not find feature property "%s" for labeling\n' % key) + return +@@ -411,7 +411,7 @@ class SvgDocument(object): + # Here we finally write the SVG file, and we're brave enough + # to try to write it in Unicode. + def write(self, outfile, pretty_print=False): +- if isinstance(outfile, (str, unicode)): ++ if isinstance(outfile, str): + outfile = open(outfile, 'w') + if pretty_print: + raw = self.doc.toprettyxml('utf-8') +@@ -420,7 +420,7 @@ class SvgDocument(object): + try: + raw = raw.encode('utf-8') + except: +- print 'warning: could not encode to unicode' ++ print('warning: could not encode to unicode') + + outfile.write(raw) + outfile.close() +@@ -431,7 +431,7 @@ class SvgDocument(object): + import tempfile + tmpfile = tempfile.NamedTemporaryFile(suffix='.svg', delete=False) + self.write(tmpfile, pretty_print) +- print 'map stored to', tmpfile.name ++ print('map stored to', tmpfile.name) + from subprocess import call + call([command, tmpfile.name]) + +--- kartograph/yaml_ordered_dict.py.orig 2014-03-27 03:57:55 UTC ++++ kartograph/yaml_ordered_dict.py +@@ -19,8 +19,8 @@ class OrderedDictYAMLLoader(yaml.Loader): + def __init__(self, *args, **kwargs): + yaml.Loader.__init__(self, *args, **kwargs) + +- self.add_constructor(u'tag:yaml.org,2002:map', type(self).construct_yaml_map) +- self.add_constructor(u'tag:yaml.org,2002:omap', type(self).construct_yaml_map) ++ self.add_constructor('tag:yaml.org,2002:map', type(self).construct_yaml_map) ++ self.add_constructor('tag:yaml.org,2002:omap', type(self).construct_yaml_map) + + def construct_yaml_map(self, node): + data = OrderedDict() +@@ -40,7 +40,7 @@ class OrderedDictYAMLLoader(yaml.Loader): + key = self.construct_object(key_node, deep=deep) + try: + hash(key) +- except TypeError, exc: ++ except TypeError as exc: + raise yaml.constructor.ConstructorError('while constructing a mapping', + node.start_mark, 'found unacceptable key (%s)' % exc, key_node.start_mark) + value = self.construct_object(value_node, deep=deep) +@@ -63,4 +63,4 @@ two: + + data = yaml.load(textwrap.dedent(sample), OrderedDictYAMLLoader) + assert type(data) is OrderedDict +- print data +\ No newline at end of file ++ print(data)