-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Port install
into PackageManager
#119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @RulerOfCakes!
""" | ||
|
||
def __init__(self) -> None: | ||
self.index_urls = package_index.DEFAULT_INDEX_URLS | ||
self.index_urls = package_index.DEFAULT_INDEX_URLS[:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
micropip/package_manager.py
Outdated
@@ -6,31 +6,52 @@ | |||
from micropip import package_index | |||
from micropip._commands import mock_package | |||
from micropip.freeze import freeze_lockfile | |||
from micropip.install import install | |||
from micropip.list import list_installed_packages | |||
from micropip.package import PackageDict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change import paths to relative paths.
from .package import PackageDict
# same for other imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I'm curious about the reasoning behind this change? (Personally I don't see a significant advantage over one another)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It distinguishes the local imports from external imports. Also, a minor benefit would be that if we change the package name, it does not need to be updated.
Thanks! |
install
intoPackageManager
install
to parent directory(to avoid importing_commands.install.py
frompackage_manager.py
)This concludes implementing the global commands in
PackageManager
, thus making it viable for use, although it doesn't really serve a separated purpose for end users at the moment. Adding customisability to inner behavior via this abstraction may be a later goal.