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

Pin magika version to fix pip issue #1179

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Pin magika version to fix pip issue #1179

merged 2 commits into from
Dec 11, 2024

Conversation

emtuls
Copy link
Member

@emtuls emtuls commented Nov 25, 2024

This pins magika to version 0.5.0 to fix a pip resolving issue with numpy conflicting with stringsifter as noted in #1130. It should be fixed when magika version 0.6.0 is officially released and we can revert back to how we installed it before after verifying.

@emtuls emtuls added the 🐛 bug Something isn't working label Nov 25, 2024
@emtuls emtuls self-assigned this Nov 25, 2024
@emtuls emtuls requested a review from Ana06 November 25, 2024 05:44
packages/magika.vm/magika.vm.nuspec Outdated Show resolved Hide resolved
@emtuls emtuls force-pushed the magika-pin branch 2 times, most recently from 63851c6 to 3e619b4 Compare December 10, 2024 05:28
@emtuls emtuls requested a review from Ana06 December 10, 2024 05:37
Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

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

Thanks for adding a version argument to the VM-Install-With-Pip function @emtuls! 👍

# Conditionally add version string
$toolNameForPip = $toolName
if (![string]::IsNullOrEmpty($version)) { # Check if $version is not empty or null
$toolNameForPip += "==$version"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should expect the version to include the ==:

Suggested change
$toolNameForPip += "==$version"
$toolNameForPip += "$version"

This allows us more flexibility in case we need for example to specify a range of versions. I would then also add a comment next to the version argument to document this:

[string] $version = "",  # Version using pip format, example: "==0.5.0"

This also allows us to simplify the code, as the if is not needed anymore needed? As the version is set to empty by default, it can't be null, only set or empty. Concatenating an empty string makes no different, so we can just do directly:

VM-Pip-Install "$toolName$version"

Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

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

Tested locally, both installation and uninstallation work as expected! Thanks for all the work @emtuls!!! 😄

@Ana06 Ana06 merged commit 754a7a1 into main Dec 11, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants