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

dep key items unintended merging #152

Open
majidaldo opened this issue Sep 27, 2022 · 6 comments
Open

dep key items unintended merging #152

majidaldo opened this issue Sep 27, 2022 · 6 comments

Comments

@majidaldo
Copy link
Contributor

#devenv file
name: 'sdf'
dependencies:
  - d1
  - d2
  - notdevenvkey:
    - one
    - two
    - startwith xxx
    - startwith yyy

gets processed to conda devenv --print-full

# generated by conda-devenv, do not modify and do not commit to VCS
dependencies:
- d1
- d2
- notdevenvkey:
  - one
  - startwith xxx,yyy
  - two
name: sdf
environment: {}

i'm not sure if this behavior is by design.

@prusse-martin
Copy link
Member

It recursively merge the dicts, that is by design. It has some custom handling for "pip" and "name" though.
Thank you the small example to make clear to issue.
Does this present a problem for your use case?

@majidaldo
Copy link
Contributor Author

It recursively merge the dicts, that is by design. It has some custom handling for "pip" and "name" though. Thank you the small example to make clear to issue. Does this present a problem for your use case?

yes. i slightly post-process the conda-devenv output. i think conda-devenv should only process what's going to conda and leave the rest as is.

@majidaldo
Copy link
Contributor Author

majidaldo commented Sep 27, 2022

It recursively merge the dicts, that is by design. It has some custom handling for "pip" and "name" though. Thank you the small example to make clear to issue. Does this present a problem for your use case?

yes. i slightly post-process the conda-devenv output. i think conda-devenv should only process what's going to conda and leave the rest as is.

for example you can think about installers other than conda or pip like npm. each installer has a spec format that shouldn't be touched by conda-devenv. since you have special treatment for pip, you might as well just generalize it to conda vs non-conda.

@prusse-martin
Copy link
Member

prusse-martin commented Sep 28, 2022

The idea was to also merge the specs for other installers.
The custom pip handling affect just some declarations not all.
No version spec from npm can be merged the same as dome by conda-devenv?

@majidaldo
Copy link
Contributor Author

why would it? each installer has its own way. also, the specs got alphabetically ordered.

related #84

@prusse-martin
Copy link
Member

Sorry, almost 2 years ago I did focus on the top part of your example in #84 (comment), or I will mention that the "environment" section is already merged.
When I told "The idea was to also merge the specs for other installers." it should read "The idea was to merge everything possible.".

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

No branches or pull requests

2 participants