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

Adding the miniforge installer for conda #14

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mikibonacci
Copy link

@mikibonacci mikibonacci commented Jan 22, 2025

This installer is needed to install conda on local/remote computer which does not have it, or only have Anaconda (for license reason, we don't want/cannot to use it). This, in principle, can be particularly useful if we want to automatically setup a python code from the aiidalab-qe app.

I basically added two object to the utils.py file:

  • generate_bash_to_install_conda function
  • CONDA_DEFAULT_PATH variable

the script strig to install conda is generated in the create_conda_env function if install_conda is True, and merged to the script used to create the conda env (we put the installer script first, in the sh file):

...
    script = generate_bash_to_create_python_env(name, pip, conda, modules, python_version, variables, shell)
    
    conda_path = conda.get("path", CONDA_DEFAULT_PATH)
    
    if install_conda:
        install_conda_script = generate_bash_to_install_conda(shell, destination=conda_path, modules=modules)
        script = install_conda_script + script
...

Moreover, now we can define the path: str k:v in the conda input dictionary. This is needed to define a common path where to install and then find conda.

Missing:

  • pre-commit checks
  • detect the architecture and download the correct installer, as well as using the correct cmd instructions
  • test(s)
  • documentation/guide

- generate_bash_to_install_conda
- CONDA_DEFAULT_PATH

the script to install conda is generated in the `create_conda_env` function
if `install_conda` is `True`.

Moreover, now we can define the `path`: `str` k:v in the `conda` input dictionary.
This is needed to define a common path where to install and then find conda.
@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 24.00000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 85.50%. Comparing base (839e3ba) to head (fb0d6ac).

Files with missing lines Patch % Lines
src/aiida_pythonjob/utils.py 24.00% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
- Coverage   87.88%   85.50%   -2.39%     
==========================================
  Files          14       14              
  Lines         652      676      +24     
==========================================
+ Hits          573      578       +5     
- Misses         79       98      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 this pull request may close these issues.

2 participants