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

Fix pypi url usage #1226

Merged
merged 1 commit into from
May 2, 2024
Merged

Fix pypi url usage #1226

merged 1 commit into from
May 2, 2024

Conversation

ryanmelt
Copy link
Member

@ryanmelt ryanmelt commented May 2, 2024

closes #1137

@ryanmelt ryanmelt requested a review from jmthomas May 2, 2024 04:25
Copy link

sonarqubecloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@@ -36,7 +36,7 @@ module OpenC3
# and destroy to allow interaction with gem files from the PluginModel and
# the GemsController.
class GemModel
include Api
extend Api
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't extend add as class methods vs include adds as instance methods

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep. That was the bug as we were using get_setting in a class method not an instance method.

end
Logger.info "Installing python package: #{name_or_path}"
result = OpenC3::ProcessManager.instance.spawn(["pip", "install", "--user", "-i", pypi_url, package_file_path], "package_install", package_filename, Time.now + 3600.0, scope: scope)
result = OpenC3::ProcessManager.instance.spawn(["/openc3/bin/pipinstall", "--user", "--no-warn-script-location", "-i", pypi_url, package_file_path], "package_install", package_filename, Time.now + 3600.0, scope: scope)
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we were using this in the plugin_model.rb but not here. Is this the real fix?

Copy link
Member Author

Choose a reason for hiding this comment

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

This adds a retry if the remote install fails, that try to just do local.

pypi_url += '/simple'
end
pypi_url ||= 'https://pypi.org/simple'
end
Copy link
Member

Choose a reason for hiding this comment

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

Logic is cleaner but basically the same?

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically the same.

@ryanmelt ryanmelt merged commit 81ca82f into main May 2, 2024
17 checks passed
@ryanmelt ryanmelt deleted the fix_pypi_url_setting branch May 2, 2024 15:54
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.

Investigate If Changing Pypi URL in settings is working
2 participants