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

Install: option to skip current project package #757

Merged
merged 1 commit into from Mar 7, 2019

Conversation

Projects
None yet
3 participants
@seleem1337
Copy link
Contributor

seleem1337 commented Dec 21, 2018

Add --no-root option to the install command to avoid the installation of the project's root package.

Fixes #730.

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!

  • Added tests for changed code.
  • Updated documentation for changed code.

Note: If your Pull Request introduces a new feature or changes the current behavior, it should be based
on the develop branch. If it's a bug fix or only a documentation update, it should be based on the master branch.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

@brycedrennan
Copy link

brycedrennan left a comment

@seleem1337 Thanks for addressing this issue. Its a blocking my workplace from requiring use of poetry in a large corporate environment.

I just tried out this fix and it didn't seem to work. I got this error:
{path to my package} does not contain any element

I made the following change and then it worked as expected:

        return_code = installer.run()

        if return_code != 0:
            return return_code

        if self.option("no-root"):
            return 0

        try:
            builder = SdistBuilder(self.poetry, NullEnv(), NullIO())
        except ModuleOrPackageNotFound:
            # This is likely due to the fact that the project is an application
            # not following the structure expected by Poetry
            # If this is a true error it will be picked up later by build anyway.
            return 0

        self.line(
            "  - Installing <info>{}</info> (<comment>{}</comment>)".format(
                self.poetry.package.pretty_name, self.poetry.package.pretty_version
            )
        )

        if self.option("dry-run"):
            return 0
Show resolved Hide resolved poetry/installation/installer.py Outdated
Show resolved Hide resolved poetry/console/commands/install.py Outdated

@seleem1337 seleem1337 force-pushed the seleem1337:feature/issue-730-no-root-package-option branch from ea621bb to 30a8cb1 Mar 7, 2019

@seleem1337 seleem1337 force-pushed the seleem1337:feature/issue-730-no-root-package-option branch from 30a8cb1 to 1ff6a95 Mar 7, 2019

@seleem1337

This comment has been minimized.

Copy link
Contributor Author

seleem1337 commented Mar 7, 2019

@brycedrennan @sdispater thanks for the feedback! I've applied the changes.

@sdispater sdispater merged commit 37ec144 into sdispater:develop Mar 7, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sdispater

This comment has been minimized.

Copy link
Owner

sdispater commented Mar 7, 2019

Thanks!

@cancan101 cancan101 referenced this pull request Mar 19, 2019

Open

get-poetry.py to install from git #968

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.