conda-devenv icon indicating copy to clipboard operation
conda-devenv copied to clipboard

feature: 'included_by' list

Open majidaldo opened this issue 4 years ago • 2 comments

I have a use case where I want to (programmatically) refer to envs that had included the subject environment (inverse of deps/'is_included' ).

Example: create one 'jupyter notebook' environment for all envs that include the subject env.

majidaldo avatar Nov 10 '21 15:11 majidaldo

Let me see if I did get that right.

Given 3 files:

# aaa.devenv.yml
name: AAA
include:
  - another.devenv.yml
# bbb.devenv.yml
name: BBB
include:
  - another.devenv.yml
# another.devenv.yml
name: ANOTHER

Do you want an option:

$ conda devenv '**/*.devenv.yml' --if-include=another.devenv.yml --execute echo from '{name}'
from AAA
from BBB

?

prusse-martin avatar Nov 10 '21 16:11 prusse-martin

Let me see if I did get that right.

Given 3 files:

# aaa.devenv.yml
name: AAA
include:
  - another.devenv.yml
# bbb.devenv.yml
name: BBB
include:
  - another.devenv.yml
# another.devenv.yml
name: ANOTHER

Do you want an option:

$ conda devenv *.devenv.yml --if-include=another.devenv.yml --execute echo from {name}
from AAA
from BBB

?

Not far off. Sorry I meant to have the counterpart for is_included. I just wanted to have a feature in the 'compilation' step, just a variable, and not have conda devenv do anything new (although integrating what your deps pkg can do would be nice).

I want something that allows me to:

# another.devenv.yml
name: ANOTHER

includes:
{{for e in included_by:
- e
{{endfor}}

gives:

name: another
includes:
 - aaa.devenv.yml
 - bbb.devenv.yml

majidaldo avatar Nov 10 '21 16:11 majidaldo