I have a slightly odd scenario, but fishing for th...
# development
b
I have a slightly odd scenario, but fishing for thoughts (Python + GPU deps) I have
<http://repository.in|repository.in>
that lists most of my deps, minus
mxnet
. -> it gets locked manually (e.g. I call
pex3
) and toss in `mxnet`for the lock. Then I have a
python_requirement
for
mxnet
. Lastly I have a package
mxboard
which has an implicit, undeclared dependency on
mxnet
. So I would normally do:
Copy code
python_requirements(
    ...,
    overrides={"mxboard": {"dependencies": [":repository#mxnet"]}}",
)
Buuuuuuuuuut In order to support GPU
mxnet
I also have more lockfiles/resolves which swap
mxnet
with
mxnet-cu1XX
for each CUDA version we care about. Plus an additional
python_requirement
for each new resolve. But then my hardcoded dependency breaks and I weep. (All hard-coded deps break, but I despise them. This one is most relevant). So I'm thinking we should make it easy to say "this package relies on this module (name)" that isn't specifically "this
python_requirement
depends on this other `python_requirement`". That way the resolve aspect is delayed to dependency injection plugin time. Or any other way to unblock this 🙂
✅ 1
Ohhhhhhh
parameterize
works like a CHARM
c
wait ! I hadn’t even finished reading that 😛 😄
b
Copy code
python_requirements(
    ...,
    overrides={"mxboard": {"dependencies": [":#mxnet"]}}",
    resolve=parametrize(
        "python-repository",
        "python-repository-cu102",
        "python-repository-cu116",
    )
)
plus:
Copy code
python_requirement(
    name = "mxnet",
    modules = ["mxnet"],
    requirements = [],
    resolve = parametrize(
        "python-repository",
        "python-repository-cu102",
        "python-repository-cu116",
    )
)
c
parametrize is really cool (and confusing) but mostly cool 😎
b
Bless you @hundreds-father-404 et. al.
❤️ 2
c
I think parametrize really was a good example of team effort, as I know stu wrote a lot of the implementation (and design) but even I feel part guilty of the end result 😛
b
This upcoming blog post is gonna be lit 🔥
🏕️ 2
🔦 2
🤸 2
Oh no...
Copy code
The explicit dependency `3rdparty/python/deps:mxnet` of the target at `thinga:mabob` does not provide enough address parameters to identify which parametrization of the dependency target should be used.
Guess I need to parameterize that too
And all clients 😮
h
yeah, that's the worst part of this
b
I hate manual dependencies anyways
More fuel to my fire
this is fine fire 1
requirements = [],
that was dumb