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

Add render-lock-spec subcommand for exporting lock specification to pixi.toml #664

Merged
merged 30 commits into from
Sep 15, 2024

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Aug 29, 2024

Description

Leverage conda-lock's source parser to generate pixi.toml

The command

conda-lock render-lock-spec --kind=pixi.toml --stdout ...

is a stand-in replacement for

conda-lock lock ...

It takes the same CLI arguments and outputs a pixi.toml file.

For example, based on the command

conda-lock --file=environments/dev-environment.yaml --file=pyproject.toml

this translates to

conda-lock render-lock-spec --kind=pixi.toml --stdout --file=environments/dev-environment.yaml --file=pyproject.toml --pixi-project-name=conda-lock --editable conda-lock=. > pixi.toml

which produces the included pixi.toml with the warnings:

~/repos/conda-lock/conda_lock/src_parser/markers.py:73: UserWarning: Marker 'python_version < "3.11"' contains environment markers: {'python_version'}. Only {'os_name', 'sys_platform', 'platform_system'} are supported.
  warnings.warn(
~/repos/conda-lock/conda_lock/src_parser/markers.py:73: UserWarning: Marker 'python_version < "3.10"' contains environment markers: {'python_version'}. Only {'os_name', 'sys_platform', 'platform_system'} are supported.
  warnings.warn(
~/repos/conda-lock/conda_lock/export_lock_spec.py:147: UserWarning: Extras not supported in Conda dep name='cachecontrol' manager='conda' category='main' extras=['filecache'] markers=None version='<0.15.0,>=0.14.0' build=None conda_channel=None hash=None
  warnings.warn(f"Extras not supported in Conda dep {dep}")

TODO:

  • commit the pixi.toml
  • add the option for an editable dependency
  • write dict values as toml instead of json (uses = instead of : as a key-value separator)

@maresb maresb requested a review from a team as a code owner August 29, 2024 20:59
Copy link

netlify bot commented Aug 29, 2024

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit e4f47d1
🔍 Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/66e765be0820a30008bfff78
😎 Deploy Preview https://deploy-preview-664--conda-lock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@maresb maresb force-pushed the export-to-pixi branch 2 times, most recently from 853fee9 to 5ce0113 Compare September 6, 2024 19:18
@maresb maresb force-pushed the export-to-pixi branch 3 times, most recently from a830b90 to 874e0d1 Compare September 7, 2024 14:59
@maresb maresb force-pushed the export-to-pixi branch 13 times, most recently from b6e68d6 to 5d28d89 Compare September 14, 2024 12:51
@maresb
Copy link
Contributor Author

maresb commented Sep 15, 2024

Ugh, tomlkit is butchering tables and I don't understand why. Things were simpler when generated as pure text. 😞

@maresb maresb changed the title Export to pixi Add render-lock-spec subcommand for exporting lock specification to pixi.toml Sep 15, 2024
@maresb maresb merged commit c5c9e9e into conda:main Sep 15, 2024
43 checks passed
@maresb maresb deleted the export-to-pixi branch September 15, 2024 23:06
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.

1 participant