6

For my Python project I am using a conda environment file to ensure a similar environment for all developers and deployment. My project requires a specific version of a private repo to be included in the environment. For deployment on my development server, the package should be installed from the development branch of the repo. For deployment on production, the master branch should be used. Since they run on the same server, the environments need to have different names as well.

So what I want:

  • environment named 'master_env' which installs private package from @master branch
  • environment named 'development_env' which installs private package from @development branch

Given the following environment file, is there I way to achieve that? I figured if I could be passing arguments/variables when installing this environment that would be a solution, but I can't find if/how that works.

Environment.yml:

name: conda_env
channels:
  - conda-forge
dependencies:
  - python==3.6.4
  - pandas==0.22.0
  - pip:
    - git+https://url.com/private_repo.git@development

What is the best practice in this situation?

marqram
  • 725
  • 12
  • 26
  • Possible duplicate of https://stackoverflow.com/questions/19042389/conda-installing-upgrading-directly-from-github – Shashank Verma Aug 02 '18 at 12:24
  • 1
    Maybe I don't understand correctly, but the question you link to refers to doing a pip-install from git in your environment file. From my questions I think it is clear I am already doing that - now I want to parametrize the branch I install from, which is not a part of the question you point to. – marqram Aug 02 '18 at 13:17

1 Answers1

3

git+https://url.com/private_repo.git@development.

The format mentioned in your question is one of the pip standards for VCS. It will work for installing from a specific branch of a project. You can see the other standard formats here: https://pip.pypa.io/en/stable/reference/pip_install/#git

Shashank Verma
  • 369
  • 1
  • 14