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

Version 2: Stop writing to ~/.condarc and remove some options #103

Closed
jonashaag opened this issue Oct 25, 2022 · 5 comments · Fixed by #122
Closed

Version 2: Stop writing to ~/.condarc and remove some options #103

jonashaag opened this issue Oct 25, 2022 · 5 comments · Fixed by #122

Comments

@jonashaag
Copy link
Collaborator

jonashaag commented Oct 25, 2022

The current interface has a bunch of problems:

Some of the problems with channels have been inherited from setup-miniconda but I don't think it's worth staying compatible (we're not compatible in other ways anyways).

I don't think we should be using channels in the first place, with one exception. We should be specifying channels in the environment.yml and in a .condarc. You want to be able to install from environment.yml outside of CI anyways. I'm not sure why we set channel_priority: strict but I think this one should also not be CI specific, so set in .condarc. The exception for a valid use case for channels being if you don't have an environment.yml.

My suggestion is as follows:

  • Remove the channels option.
  • Don't set the channel_priority option and remove the channel-priority option.
  • For the special case of environmnent-file: false use channels: [conda-forge]. Other channels are not supported in that case (must create an environment.yml file or use a condarc-file instead).
  • Stop writing to ~/.condarc. (Maybe keep the condarc-file -> ~/.condarc copying.)
  • Remove the condarc-options option? We could also keep it but make it mutually exclusive with condarc-file.

@wolfv @pavelzw

@jonashaag
Copy link
Collaborator Author

@wolfv I want to start working on this this week, if you have any opionions please share!

@hadim
Copy link

hadim commented Nov 23, 2022

Sorry to jump here from nowhere, but I use that action extensively. One use case is releasing a library using only a couple of deps (versus installing everything that is in the repo env.yml file) that all depends on one or more specific channels.

For this need, it's important for us to be able to set extra-specs as well as channels. Take for example the below snippet:

  steps:
    - name: Setup Mamba
      uses: mamba-org/provision-with-micromamba@v14
      with:
        environment-file: false
        environment-name: rever
        cache-downloads: true
        cache-env: true
        channel-priority: strict
        channels: conda-forge
        extra-specs: |
          python
          pip
          conda-smithy
          semver
          git
          rever>=0.5.1

For the special case of environmnent-file: false use channels: [conda-forge]. Other channels are not supported in that case (must create an environment.yml file or use a condarc-file instead).

For this use case, the below proposal would work, but I can imagine some other cases where being able to set channels to something else could be useful.

Would that be possible to keep it but only when environmnent is false and throw an error otherwise?

@jonashaag
Copy link
Collaborator Author

jonashaag commented Nov 24, 2022

Thanks Hadrien, that's valuable input!

You seem to have some non-trivial environment setup in your GHA workflow, making it hard to run that CI step outside of GHA. I'd argue that one should put code that's not specific to GHA (list of dependencies, list of channels, ...) outside the workflow. Thus rendering those options unnecessary.

For very simple CI steps it might not be worth having that code outside the workflow, but I'd argue your setup is already past that. (Convenient for my argument, I'm defining "simple" = "needs only conda-forge packages with no other options changed" :-))

@jonashaag
Copy link
Collaborator Author

jonashaag commented Dec 7, 2022

Idea: condarc input as literal string. But could also use cat

@jonashaag jonashaag mentioned this issue Jan 15, 2023
@jonashaag
Copy link
Collaborator Author

Please continue discussion of the new version's spec here #114

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

Successfully merging a pull request may close this issue.

2 participants