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

Allow channel::package in package specifications #207

Merged
merged 6 commits into from
Jul 11, 2022

Conversation

mariusvniekerk
Copy link
Collaborator

This closes #188

This should allow us to be able to safely specify the channel as part of a lock spec.

Since this is a strict superset of the lockfile format we're choosing to not to increment the version number of a the lockfile spec here.

@netlify
Copy link

netlify bot commented Jul 9, 2022

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit 7638c0c
🔍 Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/62cb28c68d8c34000a202bb0
😎 Deploy Preview https://deploy-preview-207--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 settings.

Copy link
Contributor

@ericdill ericdill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some docs to the new code

edit1: tried to use the web editor to add some docs. looks like that failed. lemme try again

edit2: ok successfully pushed to your branch using the web editor 🎉

conda_lock/src_parser/conda_common.py Outdated Show resolved Hide resolved
if package_channel:
channel_str = package_channel.canonical_name
else:
channel_str = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this else block is unnecessary given that ms.get('channel') will return None. But I guess if ms['channel'] is anything falsy ("", false, etc.) then this forces channel_str to be None. so maybe this is fine? idk. probably better to be defensive here and leave the code as is, instead of deleting the else block

Copy link
Collaborator Author

@mariusvniekerk mariusvniekerk Jul 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust the behavior of matchspec about as far as i can throw it, so keeping it explicit here



def conda_spec_to_versioned_dep(spec: str, category: str) -> VersionedDependency:
from ..vendor.conda.models.match_spec import MatchSpec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a docstring to this function?

@@ -0,0 +1,7 @@
channels:
- rapidsai
- nvidia
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything special about rapidsai and nvidia here? or could these be any channels. might be kind to future maintenance to leave a note about why you picked these two channels

Copy link
Contributor

@ericdill ericdill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web editor was confusing. i was trying to leave my changes as a thing for you to approve. this PR looks fine as is, i just had some minor things to point out

@mariusvniekerk mariusvniekerk merged commit 12b71c1 into conda:main Jul 11, 2022
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.

Dependencies of the form channel::name not handled correctly
2 participants