-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] output in ZIP format if extension is '.zip' #788
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
it's a pity that the zip file is not done using directly a zip archive writer but it's fine for me to do this in a separate PR 😁
Compared to writing to a temporary folder, then into an archive, it sure would be better. But not sure that it'd be as simple to do because it would force us to call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved but -1 for the "pouet" in the fixtures.
a6ef370
First commit is only about setting up some tests.
Second commit is about the new feature.
The new feature is to detect if
--output
contains.zip
in the name. If no, the previous behavior is done: writing files to a folder. If yes, then we write the output files to a temporary folder, then ZIP all these files into the--output
path.🔍 Help for reviewing:
gtfs2ntfs
gtfs2ntfs
if output path has extension.zip
write()
andwrite_to_zip()
functions on the API oftransit_model::netex_france
and (2) create a ZIP file ingtfs2netexfr
andntfs2netexfr
if output path has extension.zip
ntfs2ntfs
if output path has extension.zip
ntfs2gtfs
if output path has extension.zip
and add awrite_to_zip()
function totransit_model::gtfs
🏗️ All the steps that have to be implemented
gtfs2ntfs
supports ZIP export (7540763)gtfs2netexfr
supports ZIP export (a6ef370)ntfs2netexfr
supports ZIP export (a6ef370)ntfs2ntfs
supports ZIP export (e8743b1)ntfs2gtfs
supports ZIP export (f79827b)Cargo.toml
everywhere (1e57620)❓ Unresolved questions
gtfs2netexfr
andntfs2netexfr
are covering more than what is intests/write_netex_france.rs
. Should I remove them fromtests/write_netex_france.rs
? -> On the binary tests, only test that output files are produced (not the entire output fixture) and extend to all the other similar tests (f2af969, 0ee7806, 0ee7806, b7e7f58)transit_model::netex_france::Exporter
from the public API? -> MakeExporter
private and possibly document the migration to the newwrite()
function (1e57620)ntfs::write(model: &Model, ...)
andgtfs::write(model: Model, ...)
(some with reference and some other with ownership)? -> To be done in another PR--output
with an extension that is not.zip
(585b37e)