[Git][debian-gis-team/python-osmapi][upstream] 2 commits: New upstream version 1.2.0

Bas Couwenberg gitlab at salsa.debian.org
Mon Nov 5 17:06:11 GMT 2018


Bas Couwenberg pushed to branch upstream at Debian GIS Project / python-osmapi


Commits:
12437e8b by Bas Couwenberg at 2018-11-05T16:59:30Z
New upstream version 1.2.0
- - - - -
95347e54 by Bas Couwenberg at 2018-11-05T16:59:40Z
New upstream version 1.2.1
- - - - -


11 changed files:

- .travis.yml
- CHANGELOG.md
- README.md
- osmapi/OsmApi.py
- osmapi/__init__.py
- requirements.txt
- setup.py
- test-requirements.txt
- tests/changeset_tests.py
- tests/osmapi_tests.py
- tox.ini


Changes:

=====================================
.travis.yml
=====================================
@@ -2,18 +2,22 @@ language: python
 
 python:
 - '2.7'
-- '3.3'
 - '3.4'
 - '3.5'
 - '3.6'
 
+matrix:
+  include:
+  - python: '3.7'
+    dist: xenial    # required for Python 3.7 (travis-ci/travis-ci#9069)
+    sudo: required  # required for Python 3.7 (travis-ci/travis-ci#9069)
+
 before_install:
 - sudo apt-get update -qq
 - sudo apt-get install -qq pandoc
 
 install:
-- pip install -r requirements.txt
-- pip install -r test-requirements.txt
+- pip install -r requirements.txt -r test-requirements.txt
 - pip install .
 
 script: ./build.sh
@@ -22,11 +26,12 @@ after_success: coveralls
 
 deploy:
   - provider: pypi
+    twine_version: 1.12.1
     user: odi
     password:
       secure: MU3ZQ4rcpsXo0xIYSWXBfaKTAPn1IrL7AEcH231sseFV1RVmdC96Sfmtc2llvD9Eoc0KJpdW0Vy50azNqAMJwXCt/q3gagfao1PTnAEbklU+g1s2PTqW401E95Qm6w192WzWk/q0dy3SJwxEQt023QR78K+nEcYaCdLWDHjR2hY=
     on:
       tags: true
       all_branches: true
-      python: 2.7
+      python: 3.7
       repo: metaodi/osmapi


=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
 
 ## [Unreleased][unreleased]
 
+## 1.2.1 - 2018-11-05
+### Fixed
+- Deployment to PyPI with Travis
+
+## 1.2.0 - 2018-11-05
+### Added
+- Support Python 3.7 (thanks a lot [cclauss](https://github.com/cclauss))
+
+### Removed
+- Python 3.3 is no longer supported (EOL) 
+
+### Changed
+- Updated dependencies for Python 3.7
+- Adapt README to use Python 3 syntax (thanks [cclauss](https://github.com/cclauss))
+
 ## 1.1.0 - 2017-10-11
 ### Added
 - Raise new `XmlResponseInvalidError` if XML response from the OpenStreetMap API is invalid


=====================================
README.md
=====================================
@@ -4,7 +4,6 @@ osmapi
 [![Build](https://img.shields.io/travis/metaodi/osmapi/develop.svg)](https://travis-ci.org/metaodi/osmapi)
 [![Coverage](https://img.shields.io/coveralls/metaodi/osmapi/develop.svg)](https://coveralls.io/r/metaodi/osmapi?branch=develop)
 [![Version](https://img.shields.io/pypi/v/osmapi.svg)](https://pypi.python.org/pypi/osmapi/)
-[![Downloads](https://img.shields.io/pypi/dm/osmapi.svg)](https://pypi.python.org/pypi/osmapi/)
 [![License](https://img.shields.io/pypi/l/osmapi.svg)](https://github.com/metaodi/osmapi/blob/master/LICENSE.txt)
 
 Python wrapper for the OSM API
@@ -35,7 +34,7 @@ To test this library, please create an account on the [development server of Ope
 ```python
 import osmapi
 api = osmapi.OsmApi()
-print api.NodeGet(123)
+print(api.NodeGet(123))
 # {u'changeset': 532907, u'uid': 14298,
 # u'timestamp': u'2007-09-29T09:19:17Z',
 # u'lon': 10.790009299999999, u'visible': True,
@@ -60,7 +59,7 @@ Note: Each line in the password file should have the format _user:password_
 import osmapi
 api = osmapi.OsmApi(api="https://api06.dev.openstreetmap.org", username = u"metaodi", password = u"*******")
 api.ChangesetCreate({u"comment": u"My first test"})
-print api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}})
+print(api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}}))
 # {u'changeset': 532907, u'lon': 1, u'version': 1, u'lat': 1, u'tag': {}, u'id': 164684}
 api.ChangesetClose()
 ```
@@ -88,7 +87,7 @@ To run the tests use the following command:
 
     nosetests --verbose
 
-By using tox you can even run the tests against different versions of python (2.7, 3.3, 3.4, 3.5 and 3.6):
+By using tox you can even run the tests against different versions of python (2.7, 3.4, 3.5, 3.6 and 3.7):
 
     tox
 


=====================================
osmapi/OsmApi.py
=====================================
@@ -213,10 +213,10 @@ class OsmApi:
         if password:
             self._password = password
         elif passwordfile:
-            for l in open(passwordfile).readlines():
-                l = l.strip().split(":")
-                if l[0] == self._username:
-                    self._password = l[1]
+            for line in open(passwordfile).readlines():
+                line = line.strip().split(":")
+                if line[0] == self._username:
+                    self._password = line[1]
 
         # Changest informations
         # auto create and close changesets
@@ -308,7 +308,7 @@ class OsmApi:
             for k, v in elem.attributes.items():
                 try:
                     result[elem.nodeName][k] = float(v)
-                except:
+                except Exception:
                     result[elem.nodeName][k] = v
         return result
 
@@ -2223,10 +2223,10 @@ class OsmApi:
         result = DateString
         try:
             result = datetime.strptime(DateString, "%Y-%m-%d %H:%M:%S UTC")
-        except:
+        except Exception:
             try:
                 result = datetime.strptime(DateString, "%Y-%m-%dT%H:%M:%SZ")
-            except:
+            except Exception:
                 pass
 
         return result
@@ -2296,5 +2296,5 @@ class OsmApi:
         try:
             elem = DomElement.getElementsByTagName(tag)[0]
             return elem.firstChild.nodeValue
-        except:
+        except Exception:
             return None


=====================================
osmapi/__init__.py
=====================================
@@ -1,5 +1,5 @@
 from __future__ import (absolute_import, print_function, unicode_literals)
 
-__version__ = '1.1.0'
+__version__ = '1.2.1'
 
 from .OsmApi import *  # noqa


=====================================
requirements.txt
=====================================
@@ -1,7 +1,7 @@
 # This file lists the dependencies of this extension.
 # Install with a command like: pip install -r pip-requirements.txt
-pypandoc==0.7.0
-Unidecode==0.04.14
-pdoc==0.3.1
-Pygments==1.6
-requests==2.8.0
+pdoc==0.3.2
+Pygments==2.2.0
+pypandoc==1.4
+requests==2.20.0
+Unidecode==1.0.22


=====================================
setup.py
=====================================
@@ -48,5 +48,6 @@ setup(
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
     ],
 )


=====================================
test-requirements.txt
=====================================
@@ -1,11 +1,10 @@
 # This file lists the dependencies of this extension.
 # Install with a command like: pip install -r pip-requirements.txt
-flake8==3.0.4; python_version >= '2.7'
-flake8==2.1.0; python_version == '2.6'
-nose==1.3.0
-tox==2.8.1
-coverage==3.7.1
-coveralls==0.4.1
-mock==1.0.1
-xmltodict==0.9.0
-virtualenv==15.1.0
+coverage==4.5.1
+coveralls==1.5.1
+flake8==3.6.0
+mock==2.0.0
+nose==1.3.7
+tox==3.5.3
+virtualenv==16.1.0
+xmltodict==0.11.0


=====================================
tests/changeset_tests.py
=====================================
@@ -6,7 +6,7 @@ import xmltodict
 import datetime
 try:
     import urlparse
-except:
+except Exception:
     import urllib
     urlparse = urllib.parse
 
@@ -23,7 +23,7 @@ def recursive_sort(col):  # noqa
                 col = sorted(col)
             except TypeError:  # in Python 3.x: lists of dicts are not sortable
                 col = sorted(col, key=lambda k: hash(frozenset(k.items())))
-            except:
+            except Exception:
                 pass
 
             for idx, elem in enumerate(col):
@@ -92,10 +92,10 @@ class TestOsmApiChangeset(osmapi_tests.TestOsmApi):
             xmltosorteddict(kwargs['data']),
             xmltosorteddict(
                 b'<?xml version="1.0" encoding="UTF-8"?>\n'
-                b'<osm version="0.6" generator="osmapi/1.1.0">\n'
+                b'<osm version="0.6" generator="osmapi/1.2.1">\n'
                 b'  <changeset visible="true">\n'
                 b'    <tag k="test" v="foobar"/>\n'
-                b'    <tag k="created_by" v="osmapi/1.1.0"/>\n'
+                b'    <tag k="created_by" v="osmapi/1.2.1"/>\n'
                 b'  </changeset>\n'
                 b'</osm>\n'
             )
@@ -125,7 +125,7 @@ class TestOsmApiChangeset(osmapi_tests.TestOsmApi):
             xmltosorteddict(kwargs['data']),
             xmltosorteddict(
                 b'<?xml version="1.0" encoding="UTF-8"?>\n'
-                b'<osm version="0.6" generator="osmapi/1.1.0">\n'
+                b'<osm version="0.6" generator="osmapi/1.2.1">\n'
                 b'  <changeset visible="true">\n'
                 b'    <tag k="test" v="foobar"/>\n'
                 b'    <tag k="created_by" v="MyTestOSMApp"/>\n'
@@ -163,10 +163,10 @@ class TestOsmApiChangeset(osmapi_tests.TestOsmApi):
             xmltosorteddict(kwargs['data']),
             xmltosorteddict(
                 b'<?xml version="1.0" encoding="UTF-8"?>\n'
-                b'<osm version="0.6" generator="osmapi/1.1.0">\n'
+                b'<osm version="0.6" generator="osmapi/1.2.1">\n'
                 b'  <changeset visible="true">\n'
                 b'    <tag k="foobar" v="A new test changeset"/>\n'
-                b'    <tag k="created_by" v="osmapi/1.1.0"/>\n'
+                b'    <tag k="created_by" v="osmapi/1.2.1"/>\n'
                 b'  </changeset>\n'
                 b'</osm>\n'
             )
@@ -190,7 +190,7 @@ class TestOsmApiChangeset(osmapi_tests.TestOsmApi):
             xmltosorteddict(kwargs['data']),
             xmltosorteddict(
                 b'<?xml version="1.0" encoding="UTF-8"?>\n'
-                b'<osm version="0.6" generator="osmapi/1.1.0">\n'
+                b'<osm version="0.6" generator="osmapi/1.2.1">\n'
                 b'  <changeset visible="true">\n'
                 b'    <tag k="foobar" v="A new test changeset"/>\n'
                 b'    <tag k="created_by" v="CoolTestApp"/>\n'
@@ -276,7 +276,7 @@ class TestOsmApiChangeset(osmapi_tests.TestOsmApi):
             xmltosorteddict(kwargs['data']),
             xmltosorteddict(
                 b'<?xml version="1.0" encoding="UTF-8"?>\n'
-                b'<osmChange version="0.6" generator="osmapi/1.1.0">\n'
+                b'<osmChange version="0.6" generator="osmapi/1.2.1">\n'
                 b'<create>\n'
                 b'  <node lat="47.123" lon="8.555" visible="true" '
                 b'changeset="4444">\n'
@@ -350,7 +350,7 @@ class TestOsmApiChangeset(osmapi_tests.TestOsmApi):
             xmltosorteddict(kwargs['data']),
             xmltosorteddict(
                 b'<?xml version="1.0" encoding="UTF-8"?>\n'
-                b'<osmChange version="0.6" generator="osmapi/1.1.0">\n'
+                b'<osmChange version="0.6" generator="osmapi/1.2.1">\n'
                 b'<modify>\n'
                 b'  <way id="4294967296" version="2" visible="true" '
                 b'changeset="4444">\n'
@@ -434,7 +434,7 @@ class TestOsmApiChangeset(osmapi_tests.TestOsmApi):
             xmltosorteddict(kwargs['data']),
             xmltosorteddict(
                 b'<?xml version="1.0" encoding="UTF-8"?>\n'
-                b'<osmChange version="0.6" generator="osmapi/1.1.0">\n'
+                b'<osmChange version="0.6" generator="osmapi/1.2.1">\n'
                 b'<delete>\n'
                 b'  <relation id="676" version="2" visible="true" '
                 b'changeset="4444">\n'


=====================================
tests/osmapi_tests.py
=====================================
@@ -64,7 +64,7 @@ class TestOsmApi(unittest.TestCase):
             try:
                 with open(path) as file:
                     return_values.append(file.read())
-            except:
+            except Exception:
                 pass
         return return_values
 


=====================================
tox.ini
=====================================
@@ -1,5 +1,5 @@
 [tox]
-envlist = py27,py33,py34,py35,py36
+envlist = py27,py34,py35,py36,py37
 [testenv]
 commands=nosetests --verbose
 deps =



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-osmapi/compare/04db7011279cb62fa2db8a723de407554663f99f...95347e542de6a33c4ffe1a706902cb2a789864c8

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-osmapi/compare/04db7011279cb62fa2db8a723de407554663f99f...95347e542de6a33c4ffe1a706902cb2a789864c8
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20181105/927290bb/attachment-0001.html>


More information about the Pkg-grass-devel mailing list