8000 Is the dependency set in whl.py deterministic? · Issue #289 · bazel-contrib/rules_python · GitHub
[go: up one dir, main page]

Skip to content
Is the dependency set in whl.py deterministic? #289
Closed
@guillaumep

Description

@guillaumep

I might be wrong, but I'm wondering if the dependency_set declared here:
https://github.com/bazelbuild/rules_python/blob/94677401bc56ed5d756f50b441a6a5c7f735a6d4/packaging/whl.py#L86

and returned here:
https://github.com/bazelbuild/rules_python/blob/94677401bc56ed5d756f50b441a6a5c7f735a6d4/packaging/whl.py#L104

is deterministic or otherwise might introduce randomness in the build?

Should the return of the function be something like:

return sorted(dependency_set)

instead of return dependency_set ?

I did some tests using the Python 3 interpreter, and set() seems to retain the order of elements that were added to it, so this might not be an issue at all in reality. I prefer raising the question however, since this might just be an implementation detail of cpython and might not be a behaviour guaranteed in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0