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

Skip markers #194

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Skip markers #194

merged 2 commits into from
Oct 5, 2021

Conversation

frenzymadness
Copy link
Collaborator

Related Issues and Dependencies

#192

This introduces a breaking change

  • Yes
  • No

If a dependency is required at least once without any additional markers, all the other markers are skipped and the dependency is installed unconditionally. There is also a test for that.

@sesheta sesheta added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 4, 2021
micropipenv.py Outdated
if isinstance(dependency_info, dict) and "markers" in dependency_info:
additional_markers[normalize_package_name(dependency_name)].append(dependency_info["markers"])
else:
additional_markers[normalize_package_name(dependency_name)].append("skip-all-markers")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix. The approach looks correct to me. I'm wondering if skip-all-markers could be replaced with some language-defined marker that could signalize no markers and would not be a valid marker - e.g. None (not to introduce a special value here). I see the None is handled specifically down below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see. My first intention was to use True for that but neither True nor None indicates to me that this value should cause something special. For me, None is like a missing marker that should itself be skipped but without any impact on other markers. And it's used that way below when a package itself has no markers except the additional ones. We can use something like "*" to indicate that the package should always be installed but it's even worse than the self-describing value in the current implementation. I'm out of ideas. Do you have some?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use a named object, like:

skip_all_markers = object()
[...]
additional_markers[normalize_package_name(dependency_name)].append(skip_all_markers)
[...]
if skip_all_markers in markers:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A special sentinel value like this one might make sense here, thank you. Implemented.

Copy link
Collaborator

@fridex fridex left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the work 👍🏻

@sesheta
Copy link
Member

sesheta commented Oct 5, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fridex

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sesheta sesheta added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 5, 2021
@sesheta sesheta merged commit 865b848 into thoth-station:master Oct 5, 2021
@fridex fridex mentioned this pull request Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants