commit python-cligj for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-cligj for openSUSE:Factory checked in at 2022-04-28 23:07:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cligj (Old) and /work/SRC/openSUSE:Factory/.python-cligj.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-cligj" Thu Apr 28 23:07:52 2022 rev:2 rq:973538 version:0.7.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cligj/python-cligj.changes 2019-03-10 09:36:21.436162133 +0100 +++ /work/SRC/openSUSE:Factory/.python-cligj.new.1538/python-cligj.changes 2022-04-28 23:07:56.736686031 +0200 @@ -1,0 +2,17 @@ +Mon Apr 25 13:47:41 UTC 2022 - Stefan Br��ns <stefan.bruens@rwth-aachen.de> + +- Update to 0.7.2: + * Permit use with click versions 8 and higher. +- Update to 0.7.1: + * Future deprecation warning added in 0.7.0 has been changed. + Cligj version 1.0.0 will support Python versions >= 3.6. +- Update to 0.7.0: + * Warn about deprecation of support for Python versions < 3.7 + in 1.0.0 (#33). + * Warn about future change in --sequence default when the option + is used (#31). +- Update to 0.6.0: + * Always use `encoding='utf-8'` when opening input GeoJSON (#27). + * Improve docstrings (#22). + +------------------------------------------------------------------- Old: ---- cligj-0.5.0.tar.gz New: ---- cligj-0.7.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cligj.spec ++++++ --- /var/tmp/diff_new_pack.nCHSqc/_old 2022-04-28 23:07:57.216686554 +0200 +++ /var/tmp/diff_new_pack.nCHSqc/_new 2022-04-28 23:07:57.220686558 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-cligj # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -13,15 +13,16 @@ # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ +# %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-cligj -Version: 0.5.0 +Version: 0.7.2 Release: 0 License: BSD-3-Clause Summary: Click params for commmand line interfaces to GeoJSON -Url: https://github.com/mapbox/cligj +URL: https://github.com/mapbox/cligj Group: Development/Languages/Python # pypi source lack license and tests Source: https://github.com/mapbox/cligj/archive/%{version}.tar.gz#/cligj-%{version}.tar.gz @@ -35,7 +36,6 @@ Requires: python-click BuildArch: noarch - %python_subpackages %description ++++++ cligj-0.5.0.tar.gz -> cligj-0.7.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/.travis.yml new/cligj-0.7.2/.travis.yml --- old/cligj-0.5.0/.travis.yml 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/.travis.yml 2021-05-28 23:21:08.000000000 +0200 @@ -1,10 +1,9 @@ sudo: false language: python python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" + - "3.6" + - "3.7" + - "3.8" install: - "pip install coveralls" - "pip install -e .[test]" @@ -17,4 +16,4 @@ tags: true provider: pypi distributions: "sdist bdist_wheel" - user: mapboxci + user: __token__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/CHANGES.txt new/cligj-0.7.2/CHANGES.txt --- old/cligj-0.5.0/CHANGES.txt 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/CHANGES.txt 2021-05-28 23:21:08.000000000 +0200 @@ -1,6 +1,36 @@ Changes ======= +0.7.1 (2010-11-20) +------------------ + +- Future deprecation warning added in 0.7.0 has been changed. Cligj version + 1.0.0 will support Python versions >= 3.6. + +0.7.0 (2010-10-21) +------------------ + +- Warn about deprecation of support for Python versions < 3.7 in 1.0.0 (#33). +- Warn about future change in --sequence default when the option is used (#31). + +0.6.0 (2020-10-19) +------------------ + +No changes since 0.6b1. + +0.6b1 (2020-10-14) +------------------ + +Future changes: + +- Feature sequences, not collections, will be the default form of output in + version 1.0 (#20). + +Bug fixes: + +- Always use `encoding='utf-8'` when opening input GeoJSON (#27). +- Improve docstrings (#22). + 0.5.0 (2018-09-26) ------------------ @@ -20,7 +50,7 @@ 0.3.0 (2015-08-12) ------------------ -- Deprecation of the cligj.plugins module (#6). Please switch to the +- Deprecation of the cligj.plugins module (#6). Please switch to the click-plugins module: https://github.com/click-contrib/click-plugins. The cligj.plugins module will be removed from cligj at version 1.0. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/MANIFEST.in new/cligj-0.7.2/MANIFEST.in --- old/cligj-0.5.0/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100 +++ new/cligj-0.7.2/MANIFEST.in 2021-05-28 23:21:08.000000000 +0200 @@ -0,0 +1,4 @@ +include CHANGES.txt +include LICENSE + +graft tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/README.rst new/cligj-0.7.2/README.rst --- old/cligj-0.5.0/README.rst 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/README.rst 2021-05-28 23:21:08.000000000 +0200 @@ -1,8 +1,8 @@ cligj ====== -.. image:: https://travis-ci.org/mapbox/cligj.svg - :target: https://travis-ci.org/mapbox/cligj +.. image:: https://travis-ci.com/mapbox/cligj.svg + :target: https://travis-ci.com/mapbox/cligj .. image:: https://coveralls.io/repos/mapbox/cligj/badge.png?branch=master :target: https://coveralls.io/r/mapbox/cligj?branch=master @@ -10,7 +10,7 @@ Common arguments and options for GeoJSON processing commands, using Click. `cligj` is for Python developers who create command line interfaces for geospatial data. -`cligj` allows you to quickly build consistent, well-tested and interoperable CLIs for handling GeoJSON. +`cligj` allows you to quickly build consistent, well-tested and interoperable CLIs for handling GeoJSON. Arguments @@ -76,11 +76,15 @@ reads and writes GeoJSON expects a text containing a single feature collection, that's the default, and a LF-delimited sequence of texts containing one GeoJSON feature each is a feature that is turned on using the ``--sequence`` option. -To write sequences of feature texts that conform to the `JSON Text Sequences -proposed standard -<http://tools.ietf.org/html/draft-ietf-json-text-sequence-13>`__ (and might -contain pretty-printed JSON) with the ASCII Record Separator (0x1e) as -a delimiter, use the ``--rs`` option +To write sequences of feature texts that conform to the `GeoJSON Text Sequences +standard <https://tools.ietf.org/html/rfc8142>`__ (and might contain +pretty-printed JSON) with the ASCII Record Separator (0x1e) as a delimiter, use +the ``--rs`` option + +.. warning:: Future change warning + GeoJSON sequences (`--sequence`), not collections (`--no-sequence`), will be + the default in version 1.0.0. + .. code-block:: python @@ -125,7 +129,6 @@ False). --help Show this message and exit. - And can be used like this .. code-block:: console diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/cligj/__init__.py new/cligj-0.7.2/cligj/__init__.py --- old/cligj-0.5.0/cligj/__init__.py 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/cligj/__init__.py 2021-05-28 23:21:08.000000000 +0200 @@ -1,12 +1,21 @@ -# cligj +"""cligj -# Shared arguments and options. +A package of arguments, options, and parsers for the Python GeoJSON +ecosystem. +""" + +import sys +from warnings import warn import click from .features import normalize_feature_inputs -# Arguments. +__version__ = "0.7.2" + +if sys.version_info < (3, 6): + warn("cligj 1.0.0 will require Python >= 3.6", FutureWarning) + # Multiple input files. files_in_arg = click.argument( @@ -97,8 +106,14 @@ '--sequence/--no-sequence', default=False, help="Write a LF-delimited sequence of texts containing individual " - "objects or write a single JSON text containing a feature " - "collection object (the default).") + "objects or write a single JSON text containing a feature " + "collection object (the default).", + callback=lambda ctx, param, value: warn( + "Sequences of Features, not FeatureCollections, will be the default in version 1.0.0", + FutureWarning, + ) + or value, +) use_rs_opt = click.option( '--rs/--no-rs', @@ -109,8 +124,8 @@ "(default is False).") -# GeoJSON output mode option. def geojson_type_collection_opt(default=False): + """GeoJSON FeatureCollection output mode""" return click.option( '--collection', 'geojson_type', @@ -120,6 +135,7 @@ def geojson_type_feature_opt(default=False): + """GeoJSON Feature or Feature sequence output mode""" return click.option( '--feature', 'geojson_type', @@ -129,6 +145,7 @@ def geojson_type_bbox_opt(default=False): + """GeoJSON bbox output mode""" return click.option( '--bbox', 'geojson_type', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/cligj/features.py new/cligj-0.7.2/cligj/features.py --- old/cligj-0.5.0/cligj/features.py 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/cligj/features.py 2021-05-28 23:21:08.000000000 +0200 @@ -1,3 +1,5 @@ +"""Feature parsing and normalization""" + from itertools import chain import json import re @@ -23,10 +25,16 @@ "[lng, lat]", or "lng, lat", or "lng lat". If no value is provided, features will be read from stdin. + + Yields + ------ + Mapping + A GeoJSON Feature represented by a Python mapping + """ for feature_like in value or ('-',): try: - with click.open_file(feature_like) as src: + with click.open_file(feature_like, encoding="utf-8") as src: for feature in iter_features(iter(src)): yield feature except IOError: @@ -55,6 +63,12 @@ A function that will be applied to each extracted feature. It takes a feature object and may return a replacement feature or None -- in which case iter_features does not yield. + + Yields + ------ + Mapping + A GeoJSON Feature represented by a Python mapping + """ func = func or (lambda x: x) first_line = next(geojsonfile) @@ -136,9 +150,20 @@ def to_feature(obj): - """Takes a feature or a geometry - returns feature verbatim or - wraps geom in a feature with empty properties + """Converts an object to a GeoJSON Feature + + Returns feature verbatim or wraps geom in a feature with empty + properties. + + Raises + ------ + ValueError + + Returns + ------- + Mapping + A GeoJSON Feature represented by a Python mapping + """ if obj['type'] == 'Feature': return obj @@ -177,13 +202,13 @@ an iterable of objects with a geo interface and normalizes it to the former.""" for obj in feature_objs: - if hasattr(obj, "__geo_interface__") and \ - 'type' in obj.__geo_interface__.keys() and \ - obj.__geo_interface__['type'] == 'Feature': + if ( + hasattr(obj, "__geo_interface__") + and "type" in obj.__geo_interface__.keys() + and obj.__geo_interface__["type"] == "Feature" + ): yield obj.__geo_interface__ - elif isinstance(obj, dict) and 'type' in obj and \ - obj['type'] == 'Feature': + elif isinstance(obj, dict) and "type" in obj and obj["type"] == "Feature": yield obj else: - raise ValueError("Did not recognize object {0}" - "as GeoJSON Feature".format(obj)) + raise ValueError("Did not recognize object as GeoJSON Feature") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/setup.cfg new/cligj-0.7.2/setup.cfg --- old/cligj-0.5.0/setup.cfg 1970-01-01 01:00:00.000000000 +0100 +++ new/cligj-0.7.2/setup.cfg 2021-05-28 23:21:08.000000000 +0200 @@ -0,0 +1,2 @@ +[metadata] +license_file = LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/setup.py new/cligj-0.7.2/setup.py --- old/cligj-0.5.0/setup.py 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/setup.py 2021-05-28 23:21:08.000000000 +0200 @@ -1,28 +1,32 @@ from codecs import open as codecs_open + from setuptools import setup, find_packages +with open("cligj/__init__.py") as f: + for line in f: + if "__version__" in line: + version = line.split("=")[1].strip().strip('"').strip("'") + continue -# Get the long description from the relevant file with codecs_open('README.rst', encoding='utf-8') as f: long_description = f.read() -setup(name='cligj', - version='0.5.0', - description=u"Click params for commmand line interfaces to GeoJSON", - long_description=long_description, - classifiers=[], - keywords='', - author=u"Sean Gillies", - author_email='sean@mapbox.com', - url='https://github.com/mapbox/cligj', - license='BSD', - packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), - include_package_data=True, - zip_safe=False, - install_requires=[ - 'click >= 4.0, < 8' - ], - extras_require={ - 'test': ['pytest-cov'], - }) +setup( + name="cligj", + version=version, + description=u"Click params for commmand line interfaces to GeoJSON", + long_description=long_description, + classifiers=[], + keywords="", + author=u"Sean Gillies", + author_email="sean@mapbox.com", + url="https://github.com/mapbox/cligj", + license="BSD", + packages=find_packages(exclude=["ez_setup", "examples", "tests"]), + include_package_data=True, + zip_safe=False, + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", + install_requires=["click >= 4.0"], + extras_require={"test": ["pytest-cov"],}, +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/tests/test_cli.py new/cligj-0.7.2/tests/test_cli.py --- old/cligj-0.5.0/tests/test_cli.py 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/tests/test_cli.py 2021-05-28 23:21:08.000000000 +0200 @@ -1,7 +1,9 @@ import os import os.path +import sys import click +import pytest import cligj @@ -155,62 +157,67 @@ assert result.output.splitlines() == ['geographic'] -def test_sequence(runner): +@pytest.mark.filterwarnings("ignore") +@pytest.mark.parametrize( + ("opt", "val"), + [ + ("--sequence", True), + ("--no-sequence", False), + (None, cligj.__version__.startswith("1.0")), + ], +) +def test_sequence(runner, opt, val): + """True becomes the default in 1.0""" @click.command() @cligj.sequence_opt def cmd(sequence): - click.echo("%s" % sequence) + click.echo(str(sequence)) - result = runner.invoke(cmd) + result = runner.invoke(cmd, [opt] if opt is not None else []) assert not result.exception - assert result.output.splitlines() == ['False'] + assert result.output.splitlines() == [str(val)] - result = runner.invoke(cmd, ['--sequence']) - assert not result.exception - assert result.output.splitlines() == ['True'] - result = runner.invoke(cmd, ['--no-sequence']) - assert not result.exception - assert result.output.splitlines() == ['False'] +@pytest.mark.skipif(sys.version_info < (3,), reason="Requires Python 3") +@pytest.mark.xfail(cligj.__version__.startswith("1.0"), reason="No warning in 1.0") +def test_sequence_warns(runner): + """Warn about --sequence until 1.0""" + @click.command() + @cligj.sequence_opt + def cmd(sequence): + click.echo(str(sequence)) + + with pytest.warns(FutureWarning): + result = runner.invoke(cmd, ["--sequence"]) -def test_sequence_rs(runner): +@pytest.mark.filterwarnings("ignore") +@pytest.mark.parametrize(("opt", "val"), [("--rs", True), (None, False)]) +def test_sequence_rs(runner, opt, val): @click.command() @cligj.sequence_opt @cligj.use_rs_opt def cmd(sequence, use_rs): - click.echo("%s" % sequence) - click.echo("%s" % use_rs) + click.echo(str(sequence)) + click.echo(str(use_rs)) - result = runner.invoke(cmd, ['--sequence', '--rs']) + result = runner.invoke(cmd, ["--sequence"] + ([opt] if opt is not None else [])) assert not result.exception - assert result.output.splitlines() == ['True', 'True'] - - result = runner.invoke(cmd, ['--sequence']) - assert not result.exception - assert result.output.splitlines() == ['True', 'False'] + assert result.output.splitlines() == ["True", str(val)] -def test_geojson_type(runner): +@pytest.mark.parametrize( + ("opt", "val"), + [("--collection", "collection"), ("--feature", "feature"), ("--bbox", "bbox")], +) +def test_geojson_type(runner, opt, val): @click.command() @cligj.geojson_type_collection_opt(True) @cligj.geojson_type_feature_opt(False) @cligj.geojson_type_bbox_opt(False) def cmd(geojson_type): - click.echo("%s" % geojson_type) - - result = runner.invoke(cmd) - assert not result.exception - assert result.output.splitlines() == ['collection'] - - result = runner.invoke(cmd, ['--collection']) - assert not result.exception - assert result.output.splitlines() == ['collection'] - - result = runner.invoke(cmd, ['--feature']) - assert not result.exception - assert result.output.splitlines() == ['feature'] + click.echo(str(geojson_type)) - result = runner.invoke(cmd, ['--bbox']) + result = runner.invoke(cmd, [opt]) assert not result.exception - assert result.output.splitlines() == ['bbox'] + assert result.output.splitlines() == [val] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cligj-0.5.0/tests/twopoints.geojson new/cligj-0.7.2/tests/twopoints.geojson --- old/cligj-0.5.0/tests/twopoints.geojson 2018-09-26 17:58:55.000000000 +0200 +++ new/cligj-0.7.2/tests/twopoints.geojson 2021-05-28 23:21:08.000000000 +0200 @@ -1 +1 @@ -{"features": [{"bbox": [-122.9292140099711, 45.37948199034149, -122.44106199104115, 45.858097009742835], "center": [-122.7282, 45.5801], "context": [{"id": "postcode.2503633822", "text": "97203"}, {"id": "region.3470299826", "text": "Oregon"}, {"id": "country.4150104525", "short_code": "us", "text": "United States"}], "geometry": {"coordinates": [-122.7282, 45.5801], "type": "Point"}, "id": "place.42767", "place_name": "Portland, Oregon, United States", "properties": {}, "relevance": 0.999, "text": "Portland", "type": "Feature"}, {"bbox": [-121.9779540096568, 43.74737999114854, -120.74788099000016, 44.32812500969035], "center": [-121.3153, 44.0582], "context": [{"id": "postcode.3332732485", "text": "97701"}, {"id": "region.3470299826", "text": "Oregon"}, {"id": "country.4150104525", "short_code": "us", "text": "United States"}], "geometry": {"coordinates": [-121.3153, 44.0582], "type": "Point"}, "id": "place.3965", "place_name": "Bend, Oregon, United States", "properties": {}, "rele vance": 0.999, "text": "Bend", "type": "Feature"}], "type": "FeatureCollection"} +{"features": [{"bbox": [-122.9292140099711, 45.37948199034149, -122.44106199104115, 45.858097009742835], "center": [-122.7282, 45.5801], "context": [{"id": "postcode.2503633822", "text": "97203"}, {"id": "region.3470299826", "text": "Oregon"}, {"id": "country.4150104525", "short_code": "us", "text": "United States"}], "geometry": {"coordinates": [-122.7282, 45.5801], "type": "Point"}, "id": "place.42767", "place_name": "Portland, Oregon, United States", "properties": {}, "relevance": 0.999, "text": "Portland", "type": "Feature"}, {"bbox": [-121.9779540096568, 43.74737999114854, -120.74788099000016, 44.32812500969035], "center": [-121.3153, 44.0582], "context": [{"id": "postcode.3332732485", "text": "97701"}, {"id": "region.3470299826", "text": "Oregon"}, {"id": "country.4150104525", "short_code": "us", "text": "United States"}], "geometry": {"coordinates": [-121.3153, 44.0582], "type": "Point"}, "id": "place.3965", "place_name": "Bend, ����regon, United States", "properties": {}, "r elevance": 0.999, "text": "Bend", "type": "Feature"}], "type": "FeatureCollection"}
Wow. Thanks for sharing this code. I have been looking for the code for a long time but could not find it. Now having the code has helped me fix the product error slope game https://slopegameonline.org a lot.
participants (2)
-
kimberlysisk647@gmail.com
-
Source-Sync