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

Replace suffix_union with less general function #532

Merged
merged 5 commits into from
Oct 16, 2023

Conversation

jacksmith15
Copy link
Contributor

Description

An alternative candidate to #531

This removes the quite complex suffix_union function with a more specific function for unifying channels when aggregating lock specifications, since that's the only place we use it.

If nothing else, this lets us document why we're doing it better since the function pertains specifically to merging packages sources.

Resolves #530

@jacksmith15 jacksmith15 requested a review from a team as a code owner October 16, 2023 14:24
@netlify
Copy link

netlify bot commented Oct 16, 2023

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit 13c1e03
🔍 Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/652d59fe02cc70000863f29c
😎 Deploy Preview https://deploy-preview-532--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.

@@ -51,3 +54,34 @@ def aggregate_lock_specs(
lock_spec.allow_pypi_requests for lock_spec in lock_specs
),
)


def unify_package_sources(collections: List[List[Channel]]) -> List[Channel]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In #529 I would replace Channel here with:

PackageSource = TypeVar("PackageSource", Channel, PipRepository)

@maresb
Copy link
Contributor

maresb commented Oct 16, 2023

We should also be able to remove __lt__ from Channel

Copy link
Contributor

@maresb maresb left a comment

Choose a reason for hiding this comment

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

@mariusvniekerk I hope this is okay, I'm going to merge it

@maresb
Copy link
Contributor

maresb commented Oct 16, 2023

Thanks so much @jacksmith15, I really appreciate all the effort here! I think this is a huge improvement.

@maresb maresb merged commit 1544dc5 into conda:main Oct 16, 2023
9 of 10 checks passed
@jacksmith15 jacksmith15 deleted the feat/530/simplify-suffix-union branch October 16, 2023 16:57
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.

Why is suffix_union so complicated?
2 participants