Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: osmcode/pyosmium
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a31cd57272e0e2a1ffbecbdd287d4f71c114c1f4
Choose a base ref
...
head repository: osmcode/pyosmium
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 50e8fc0da7cd21a1c46308c5d96724271ff4bbe1
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Jul 14, 2020

  1. avoid leaking Python handle in timestamp conversion

    Adding UTC to a datetime object creates a new Python object.
    We therefore need to get rid of the original one.
    
    Fixes #139.
    lonvia committed Jul 14, 2020
    Copy the full SHA
    b227215 View commit details

Commits on Jul 16, 2020

  1. Copy the full SHA
    fb9d4b2 View commit details

Commits on Jul 25, 2020

  1. Release v3.0.1

    lonvia committed Jul 25, 2020
    Copy the full SHA
    50e8fc0 View commit details
Showing with 32 additions and 15 deletions.
  1. +14 −0 CHANGELOG.md
  2. +12 −11 lib/cast.h
  3. +3 −1 src/osmium/osm/mutable.py
  4. +3 −3 src/osmium/version.py
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,20 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.0.1] - 2020-07-25

### Added

- allow to set user in mutable object

### Changed

- use current libosmium and protozero

### Fixed

- avoid leaking Python handle in timestamp conversion

## [3.0.0] - 2020-05-03

### Added
23 changes: 12 additions & 11 deletions lib/cast.h
Original file line number Diff line number Diff line change
@@ -41,18 +41,19 @@ namespace pybind11 { namespace detail {

std::time_t tt = src.seconds_since_epoch();
std::tm localtime = *std::gmtime(&tt);

handle pydate = PyDateTime_FromDateAndTime(localtime.tm_year + 1900,
localtime.tm_mon + 1,
localtime.tm_mday,
localtime.tm_hour,
localtime.tm_min,
localtime.tm_sec,
0);

auto utc = pybind11::module::import("datetime").attr("timezone").attr("utc");
using namespace pybind11::literals;
return pydate.attr("replace")("tzinfo"_a=utc).inc_ref();
localtime.tm_mon + 1,
localtime.tm_mday,
localtime.tm_hour,
localtime.tm_min,
localtime.tm_sec,
0);

static auto utc = module::import("datetime").attr("timezone").attr("utc");
using namespace literals;
handle with_utc = pydate.attr("replace")("tzinfo"_a=utc).inc_ref();
pydate.dec_ref();
return with_utc;
}

PYBIND11_TYPE_CASTER(type, _("datetime.datetime"));
4 changes: 3 additions & 1 deletion src/osmium/osm/mutable.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ class OSMObject(object):
"""

def __init__(self, base=None, id=None, version=None, visible=None, changeset=None,
timestamp=None, uid=None, tags=None):
timestamp=None, uid=None, tags=None, user=None):
if base is None:
self.id = id
self.version = version
@@ -19,6 +19,7 @@ def __init__(self, base=None, id=None, version=None, visible=None, changeset=Non
self.timestamp = timestamp
self.uid = uid
self.tags = tags
self.user = user
else:
self.id = base.id if id is None else id
self.version = base.version if version is None else version
@@ -27,6 +28,7 @@ def __init__(self, base=None, id=None, version=None, visible=None, changeset=Non
self.timestamp = base.timestamp if timestamp is None else timestamp
self.uid = base.uid if uid is None else uid
self.tags = base.tags if tags is None else tags
self.user = base.user if user is None else user


class Node(OSMObject):
6 changes: 3 additions & 3 deletions src/osmium/version.py
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@
# the major version
pyosmium_major = '3.0'
# current release (Pip version)
pyosmium_release = '3.0.0'
pyosmium_release = '3.0.1'

# libosmium version shipped with the Pip release
libosmium_version = '2.15.5'
libosmium_version = '2.15.6'
# protozero version shipped with the Pip release
protozero_version = '1.6.8'
protozero_version = '1.7.0'
# pybind11 version shipped with the Pip release
pybind11_version = '2.5.0'