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

"mpm init -c [collection]" #55

Closed
mobeets opened this issue Jul 31, 2018 · 1 comment
Closed

"mpm init -c [collection]" #55

mobeets opened this issue Jul 31, 2018 · 1 comment

Comments

@mobeets
Copy link
Owner

mobeets commented Jul 31, 2018

This issue is for adding venv-like environments to mpm. I'm going to call them "collections" instead of environments since mpm -e is already being used ;)

The idea in this setting is that a collection is a nickname for a particular collection of packages, which you can then easily enable/disable in order to add/rm the paths to all of those installations.

A few notes:

  • mpm init -c colname enables a collection called colname (creating one if it doesn't exist), which means rmpaths for the previous collection (e.g., default), and adding paths for the new collection
  • every user has a default collection, so that mpm init is short-hand for mpm init -c default
  • each collection gets its own folder inside the user's default install directory (e.g., assuming the install directory is mpm-packages, then all packages for the colname collection should be installed to mpm-packages/mpm-collections/colname). for easier backwards compatibility, packages in the default collection are still installed directly to mpm-packages.
  • mpm install -c colname (similarly for mpm uninstall) indicates to install the package to the colname collection
  • mpm freeze -c colname lists the packages in colname
  • in all cases (install, uninstall, freeze, etc.), if -c is not provided then the implied collection is always -c default, NOT the currently init'd collection. To me, this is a safer bet, since there's no easy way to specify which collection is currently enabled (unlike in venv, for example, where it's prefixed to your bash prompt)

e.g., in the following, the package tmp would be installed to the default collection, NOT the test collection, while tmp2 would be installed to the test collection and not the default collection.

>> mpm init -c test
>> mpm install tmp
>> mpm install tmp2 -c test
@mobeets mobeets changed the title "mpm init -c [envname]" "mpm init -c [collection]" Jul 31, 2018
@mobeets
Copy link
Owner Author

mobeets commented Jul 31, 2018

When installing a package to a non-default collection, that package is not auto-added to the path.

Still maybe to do: turn off previous collection when switching?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant