Skip to content

Expand writer API to also allow serialization to streams / file objects #700

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

Merged
merged 3 commits into from
Jun 20, 2023

Conversation

fholger
Copy link
Collaborator

@fholger fholger commented Jun 20, 2023

As of now, our writers always expect a file name to be provided and then open an output file to write to the given name. This PR adds a set of function that instead allow to pass in a stream / file object, instead. This allows us to pass other types of streams (e.g. in-memory streams) rather than just files and thus makes the API more flexible.

…n always expecting a file name

Signed-off-by: Holger Frydrych <holger.frydrych@tngtech.com>
@fholger fholger force-pushed the write_to_streams branch from 80798ee to 9f5638e Compare June 20, 2023 09:28
Copy link
Collaborator

@armintaenzertng armintaenzertng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for the addition :)

@fholger fholger force-pushed the write_to_streams branch 2 times, most recently from 478a80a to 8d1659a Compare June 20, 2023 10:49
…writers

Signed-off-by: Holger Frydrych <holger.frydrych@tngtech.com>
@fholger fholger force-pushed the write_to_streams branch from 8d1659a to 50299bd Compare June 20, 2023 12:12
@fholger fholger force-pushed the write_to_streams branch 8 times, most recently from 9c4a26e to a9d5313 Compare June 20, 2023 14:14
than a separate step in the pipeline.

Background: there is currently an issue with newer patch versions of
Python 3.7 on macos, which are missing bz2 support, thus leading to a
failure to include the optional networkx package. This in turn results
in that particular test being skipped. But if it runs as a separate step
in the pipeline, this means that no tests will execute at all in that
step and it will then be marked as an overall failure.

See actions/setup-python#682

Signed-off-by: Holger Frydrych <holger.frydrych@tngtech.com>
Copy link
Collaborator

@armintaenzertng armintaenzertng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hard work! :)

@fholger fholger force-pushed the write_to_streams branch from a9d5313 to dcc3f5c Compare June 20, 2023 14:27
@armintaenzertng armintaenzertng merged commit 00c355d into spdx:main Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants