Skip to content
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

Conditional Dependencies #1085

Closed
00vareladavid opened this issue Feb 24, 2019 · 6 comments
Closed

Conditional Dependencies #1085

00vareladavid opened this issue Feb 24, 2019 · 6 comments

Comments

@00vareladavid
Copy link
Contributor

00vareladavid commented Feb 24, 2019

Crazy idea. Support "conditional dependencies"/"features" in a "sandbox"-analogous manner. (Note this is just meant to prod the search space, not as a serious/complete solution)

Foo
├── feature
│   ├── A
│   │   ├── Project.toml
│   │   └── src
│   │       └── A.jl
│   └── B
│       ├── Project.toml
│       └── src
│           └── B.jl
├── Project.toml
└── src
    └── Foo.jl

When someone runs add --feature=A Foo, Pkg will sandbox Foo in Foo/feature/A and add the result to the active dependency graph.

So Foo/src/Foo.jl will contain the core logic. Foo/feature/A/src/A.jl will contain the "A feature" logic.

Advantages:

  • No need to query for which features are activated, it is apparent from the filesystem location
  • Conceptually reinforces "environments" as an organizational unit.
@StefanKarpinski
Copy link
Member

I like it. This seems like a promising idea.

@aaowens
Copy link

aaowens commented Jul 26, 2019

If this were to happen it could help with JuliaStats/Distributions.jl#702 without needing Distributions to require Optim.

@cscherrer
Copy link

Doesn't Flux have some trick to handle this problem? I don't see CuArrays as a dependency, but...
https://fluxml.ai/Flux.jl/stable/gpu/

@KristofferC
Copy link
Member

It uses Requires.jl, see #1285

@KristofferC
Copy link
Member

I think #1285 is a bit more recent take on this.

@00vareladavid
Copy link
Contributor Author

For the purpose of history, this proposal more closely resembles #1233, not #1285.

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

No branches or pull requests

5 participants