Add pew-style project management#1062
Closed
yggi49 wants to merge 3 commits intopython-poetry:developfrom
Closed
Conversation
Contributor
Author
|
@sdispater, is it worth to keep working on this PR? |
Contributor
|
seems like this would fit well to use (and test) a coming plugin system, see #1237. |
Member
|
Thanks for you contribution! However, I think this goes beyond the purpose of Poetry (see my comment #704 (comment)). |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a first attempt at addressing the feature request from issue #704. I did not yet add/fix tests or add documentation, as I would first appreciate some feedback on (a) whether this is welcome at all, and (b) if yes, whether this PR is headed in the right direction.
Summary
This PR introduces a new
aliascommand suite:poetry alias set fnord– define “fnord” as alias for the current project. If a different project already used “fnord” as its alias, the command would abort with a corresponding error message. Note: only one alias can be defined per project—i.e., ifpoetry alias set ...was called again, the current project’s alias would effectively be renamed.poetry alias show– show the alias that has been defined for the current project.poetry alias list– list all project aliases in alphabetical order along with their assigned project directories.poetry alias go fnord– change to the directory of the project aliased “fnord” and executepoetry shellthere to activate the virtualenv. This only works if not already inside an activated virtualenv.poetry alias rm fnord– remove the “fnord” project alias. The alias name is optional for this command; if omitted, the current project’s alias will be removed.poetry alias prune– remove all aliases that no longer point to a project directory.poetry alias clean– remove all alias definitions.Additionally,
poetry initnow also asks for a project alias, with the package name being the default value for it. Users can enter a period.if they do not want to set an alias this way.Internally, all aliases are centrally stored in an
aliases.tomlfile in the virtualenv cache directory, next toenvs.toml. This PR’s central piece is thepoetry.utils.alias.AliasManagerclass, with the console commands being thin wrappers around its functionality.Pull Request Check List
This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!