Skip to content

Add "same_version_as"-directive to fix py-protobuf dependencies#14002

Open
obreitwi wants to merge 2 commits intospack:developfrom
electronicvisions:pr/add_same_version_as_directive_fix_protobuf
Open

Add "same_version_as"-directive to fix py-protobuf dependencies#14002
obreitwi wants to merge 2 commits intospack:developfrom
electronicvisions:pr/add_same_version_as_directive_fix_protobuf

Conversation

@obreitwi
Copy link
Copy Markdown
Member

@obreitwi obreitwi commented Dec 5, 2019

Problem:

Each version of py-protobuf depends on the exact same version of protobuf. Tracking this kind of dependency is only possible with a lot of boilerplate, which we aim to avoid.

Solution:

  • Add same_version_as-directive that automatically adds a one-to-one dependency of each version of the package to the exact same version of the other package.

  • Use same_version_as-directive to keep versions of py-protobuf and protobuf in sync (i.e., [email protected] depends on [email protected], [email protected] depends on [email protected] and so forth).

  • Add mock packages used in tests to ensure same_version_as-directive remains functional.

@adamjstewart
Copy link
Copy Markdown
Member

This looks really useful!

@adamjstewart
Copy link
Copy Markdown
Member

For the record, I'm also modifying the py-protobuf package in #13112, expected to be merged today.

@obreitwi obreitwi force-pushed the pr/add_same_version_as_directive_fix_protobuf branch from d7ec118 to 66cd9d9 Compare December 5, 2019 20:05
@obreitwi
Copy link
Copy Markdown
Member Author

obreitwi commented Dec 5, 2019 via email

@obreitwi obreitwi force-pushed the pr/add_same_version_as_directive_fix_protobuf branch 2 times, most recently from 552b481 to fc47a1d Compare December 6, 2019 11:27
@obreitwi
Copy link
Copy Markdown
Member Author

obreitwi commented Dec 6, 2019

Since #13112 is now merged, I rebased accordingly.

@obreitwi
Copy link
Copy Markdown
Member Author

obreitwi commented Feb 4, 2020

Is there anything preventing this from getting merged?

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Feb 6, 2020

Relates to #10255

@obreitwi obreitwi force-pushed the pr/add_same_version_as_directive_fix_protobuf branch 2 times, most recently from 1477dd5 to b6c16b7 Compare February 11, 2020 09:10
@obreitwi obreitwi force-pushed the pr/add_same_version_as_directive_fix_protobuf branch from b6c16b7 to e71f3e4 Compare April 22, 2020 12:21
@obreitwi
Copy link
Copy Markdown
Member Author

Rebased again! Let me know if anything is still missing…

Leave out release candidates.

Change-Id: Iac99fdab05d9b2760d87805b3e1398c5d6516ec4
@obreitwi obreitwi force-pushed the pr/add_same_version_as_directive_fix_protobuf branch from e71f3e4 to 68cc955 Compare June 11, 2021 15:07
Problem:
Each version of `py-protobuf` depends on the exact same version of
`protobuf`. Tracking this kind of dependency is only possible with a lot
of boilerplate, which we aim to avoid.

Solution:
* Add `same_version_as`-directive that automatically adds a one-to-one
  dependency of each version of the package to the exact same version of
  the other package.

* Use `same_version_as`-directive to keep versions of py-protobuf and
  protobuf in sync (i.e., `[email protected]` depends on
  `[email protected]`, `[email protected]` depends on `[email protected]` and
  so forth).

* Add mock packages used in tests to ensure `same_version_as`-directive
  remains functional.

Change-Id: I3f28d76cb32a0a91e38c5c70fb650698ab7f0316
@obreitwi obreitwi force-pushed the pr/add_same_version_as_directive_fix_protobuf branch from 68cc955 to 2002f3b Compare June 11, 2021 15:48
@adamjstewart
Copy link
Copy Markdown
Member

I would love to see this PR revived. Would it be less controversial if we add a new parameter to depends_on like same_version=True? Then we aren't adding an entirely new directive. Arguably we should do the same thing with extends since it also implies depends_on.

@adamjstewart
Copy link
Copy Markdown
Member

@alalazo how hard would this be with the new concretizer? Can we add a same_version=True arg to depends_on to support this use case? I've had to use for loops to handle this kind of thing in several packages now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants