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

#6489 Raise ConanException for invalid package folder on export-pkg #6720

Merged
merged 5 commits into from Mar 24, 2020

Conversation

uilianries
Copy link
Member

@uilianries uilianries commented Mar 23, 2020

Changelog: Fix: Raises ConanException when package folder is invalid for export-pkg.
Docs: conan-io/docs#1624

Hi! This PR is related to #6489.

When the package folder doesn't exist for the command export-pkg, a ConanException must be raised.

fixes #6489

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries uilianries changed the title #6489 Add test for absent package folder #6489 Raise ConanException for invalid package folder on export-pkg Mar 23, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries uilianries marked this pull request as ready for review Mar 23, 2020
@uilianries
Copy link
Member Author

@uilianries uilianries commented Mar 23, 2020

@memsharded This PR only checks the package folder, but looking into export_pkg method, both source folder and build folder are not checked too: https://github.com/conan-io/conan/blob/develop/conans/client/conan_api.py#L395

Could I check both in this same PR?

@memsharded
Copy link
Member

@memsharded memsharded commented Mar 23, 2020

yes, please @uilianries add checks for those folders too (taking into account that maybe one of them might not be defined or defaulted). Thanks!

uilianries added 3 commits Mar 24, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@memsharded memsharded added this to the 1.24 milestone Mar 24, 2020
def export_pkg_json_test(self):
def test_export_pkg_json(self):

def _check_json_output_no_folder():
Copy link
Member Author

@uilianries uilianries Mar 24, 2020

Choose a reason for hiding this comment

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

When the build folder is absent and json output is required, now, it will provide only an empty json file with error=True.

@danimtb danimtb self-assigned this Mar 24, 2020
@danimtb danimtb merged commit df3f882 into conan-io:develop Mar 24, 2020
2 checks passed
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.

3 participants