osm2gtfs
osm2gtfs copied to clipboard
Python3 migration
Here is a new version of osm2gtfs for python3 :tada:
The most significant changes are:
-
dict.items()
instead ofdict.iteritems()
- a whole fat bag of encoding changes
- some minor changes on the number of digits of the stop coordinates
- migration from
urllib2
tourllib.request
I've also fixed some python warnings on memory issues about unclosed files and split the tests into several travis jobs so it can be easy to see which one is failing. And they are all green :heavy_check_mark: :heavy_check_mark:
As the transitfeed
lib has not been released yet in python3, I'm using a fork (that needs to be cloned and installed before installing osm2gtfs).
I did not cherry-picked the changes of @xamanu from #153 about the formatting to keep this PR as reviewable as possible (but I do think we should add them as soon as we have a working version of osm2gtfs for python3 on master)
Wow, @nlehuby, this is awesome :tada: Many thanks! Please excuse the slow reply, will have a look on this soon.
@nlehuby :clap: :clap:
I tried the PR and it works great, just requires a little change in two line to add binary mode on read/write operations. Also I made some improvements related with installing the forked transitfeed module from git. I'll made PR with this changes to @Jungle-bus repo for her consideration.
Thanks for these improvements @jamescr , I've updated the PR :+1:
Does anyone want to have a look ?
I've made a quick review, and I don't have any comment :+1: ( but I don't feel relevant enough to approve ) Great work !
I guess it would be nice if this can be reviewed / merged :-)
@xamanu ?
Thanks for the input, @amenk. Unfortunately, I am totally out of the context. Feel free to proceed without me.
Looks good basically :-)
But: No clue if that is related to the Python3 port, but we are using this in a GitHub action which autocommits the GTFS and the fields in the .txt files change their order seemingly randomly on each run. I did not notice this when we were still on Python 2
Example: https://github.com/AddisMap/AddisMapTransit-gtfs/commit/f8666c5fbff865158dcf5ad9c66eaaecbe64e6d3
Can have a totally unrelated reason or maybe it is even like this before the upgrade, but we did not notice it before. Just wanted to mention it. Also it's a very niche issue so it still could be merged :-)
Can this be Merged?