Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Syntax for declaring runtime pip installs #4

Open
cisaacstern opened this issue Dec 21, 2022 · 0 comments · May be fixed by #8
Open

Syntax for declaring runtime pip installs #4

cisaacstern opened this issue Dec 21, 2022 · 0 comments · May be fixed by #8

Comments

@cisaacstern
Copy link
Member

One of the requirements to be able to run beam-refactor on Pangeo Forge Cloud is a meta.yaml syntax for declaring that we want to install pangeo-forge-recipes from a development branch. This is a specific (pressing) instance of the more general problem of how to support runtime pip installs.

Currently, users give something like:

pangeo_forge_recipes: 0.9.1

One idea would be to have two syntaxes. A short form (as above) for the simpler case of released versions. And a long form for when we want to install from a dev branch; i.e. something like

pangeo_forge_recipes: 
  repo: pangeo-forge/pangeo-forge-recipes
  ref: beam-refactor

The same logic could be extended to a new extras_require field, which would specify packages other than pangeo-forge-recipes to be pip-installed at runtime.

extras_require:
    - pangeo-forge-runner:
        repo: pangeo-forge/pangeo-forge-runner
        ref: support-beam-refactor

This is all a lot easier to model in Pydantic than it is in "hand-crafted" JSON, so I'll address #3 first. Once that's resolved, we can do something like:

from pydantic import BaseModel

class GithubDependency(BaseModel):
     repo: str
     ref: str

class MetaYaml(BaseModel):
    pangeo_forge_recipes: Union[str, GithubDependency]
    extras_require: Dict[str, Union[str, GithubDependency]]
    ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant