Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Determine user requested specs #7

Draft
soapy1 wants to merge 8 commits intoQuansight:main from
soapy1:user-requested-specs
Draft

Determine user requested specs #7
soapy1 wants to merge 8 commits intoQuansight:main from
soapy1:user-requested-specs

Conversation

@soapy1
Copy link
Collaborator

@soapy1 soapy1 commented Feb 18, 2025
edited
Loading

This PR proposes a way for understanding the user requested specs in an environment. This will be different for a conda env and pixi env. This pr focuses on conda env first.

It uses conda's history class for getting the user requested specs from the environment. When the dof checkpoint is created, the user requested specs are marked and will include the conda-build/rattler compatible string representation of the MatchSpec.

Try it out

# make a check point for where we start
$ dof checkpoint save
$ dof checkpoint list 
 Checkpoints 
┏━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ uuid ┃ tags ┃ timestamp ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 048f93a3 │ ['048f93a3'] │ 2025年02月18日 23:41:32.013738+00:00 │
└──────────┴──────────────┴──────────────────────────────────┘
# list the user requested specs in your current environment
$ dof user-specs 
the user requested specs in this environment are:
 conda
 hatch
 numpy
 pip
 pytest
 pytest-cov
 python >=3.12
 twine >=5.0.0
# install a new package 
$ conda install matplotlib
# list the user requested specs in your current environment
$ dof user-specs 
the user requested specs in this environment are:
 conda
 hatch
 matplotlib <--- notice the new user requested spec
 numpy
 pip
 pytest
 pytest-cov
 python >=3.12
 twine >=5.0.0
# save a checkpoint
$ dof checkpoint save
$ dof checkpoint list 
 Checkpoints 
┏━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ uuid ┃ tags ┃ timestamp ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 16d91835 │ ['16d91835'] │ 2025年02月18日 23:43:34.367435+00:00 │
│ 048f93a3 │ ['048f93a3'] │ 2025年02月18日 23:41:32.013738+00:00 │
└──────────┴──────────────┴──────────────────────────────────┘
# list the user requested specs in an older environment
$ dof user-specs --rev 048f93a3 
the user requested specs rev 048f93a3:
 conda
 hatch
 numpy
 pip
 pytest
 pytest-cov
 python >=3.12
 twine >=5.0.0

what about pip

The goal is to be able to fully recreate something like conda's environment.yaml. In order to do this, dof must also understand what pip packages the user has installed.
Currently, dof is able to inspect an environment and see pip installed packages. I don't expect this has enough information to make a confident guess at which packages are specifically requested by a user or not. More investigation is needed for this.

next steps

  • pip interop
  • generate an environment spec from a dof checkpoint
  • investigate how to do this for pixi envs
    • will require to do some work around allowing dof to target not currently active envs to explore this

@soapy1 soapy1 changed the title (削除) User requested specs (削除ここまで) (追記) Determine user requested specs (追記ここまで) Feb 18, 2025
@soapy1 soapy1 force-pushed the user-requested-specs branch 2 times, most recently from dd0bd89 to 86de305 Compare February 18, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

Comments

AltStyle によって変換されたページ (->オリジナル) /