[geant4] Restore single point of maintenance for versions#37381
[geant4] Restore single point of maintenance for versions#37381greenc-FNAL wants to merge 4 commits intospack:developfrom
Conversation
greenc-FNAL
commented
May 2, 2023
- Enable package-specific dependency directives
- [geant4] Restore single point of maintenance for versions
|
Closes #37380. |
Use `directives.pkg_depends_on()` to create a directive to handle dependency on the corresponding version of `geant4-data`.
a631dc0 to
d7f21e4
Compare
|
@greenc-FNAL, I guess this should be marked as Draft until #37380 is merged? It seems to have similar/same commits. |
|
Will also need #37383 to pass audit tests. |
|
Can we just make a new directive like this for all packages? Dozens of packages need this feature, not just this one. |
Of course. I'm not sure of the best way to make the directive simple to use and flexible enough for the general case, though. Something like this, maybe? Unfortunately, I have no idea what an implementation of def _merge(dep_spec, spec_bit):
"""Here, a miracle occurs."""
pass
@directive(("dependencies"))
def depends_on_matching_version(spec):
"""Package-specific directive to depend on the corresponding version of a given spec"""
def _execute_depends_on_matching_version(pkg):
dep_spec = Spec(spec)
for vers in pkg.versions.keys():
this_dep_spec = _merge(dep_spec, f"@{vers}")
pkg_depends_on(pkg, this_dep_spec, when=f"@{vers}", type="run")
return _execute_depends_on_matching_version |
|
There was an initial attempt in #14002 but that PR was abandoned. Basically the only thing I would change is to wrap this into the existing |
|
I'm fine with wrapping this into the OG |
I'm fine with the |
|
@adamjstewart I think I have an implementation: testing now. |
|
See #37418. |
|
This pull request has been automatically marked as stale because it has not had |
|
This pull request was closed because it had no activity for 30 days after being marked stale. |