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

add remotes in constructor #359

Merged
merged 1 commit into from
Jul 2, 2019
Merged

Conversation

grisumbras
Copy link
Contributor

@grisumbras grisumbras commented Mar 26, 2019

Changelog: Bugfix: Fixes the usage of python requires.

  • Refer to the issue that supports this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.

@grisumbras
Copy link
Contributor Author

Alternative fix to #331. Instead of delaying loading of package recipe (done in this pull request), we eagerly add all remotes in packager's constructor.

BTW, I don't know how to test the fact that python_requires of packages not available locally will start working. Any suggestions?

@grisumbras
Copy link
Contributor Author

@lasote any thoughts?

@lasote
Copy link
Contributor

lasote commented May 20, 2019

Could this fix the issue? https://github.com/conan-io/conan-package-tools/pull/379/files

@grisumbras
Copy link
Contributor Author

Tried the branch locally, and it appears that it does not.

@@ -29,7 +29,6 @@ def __init__(self, profile_abs_path, reference, conan_api, uploader,
self._exclude_vcvars_precommand = exclude_vcvars_precommand
self._build_policy = build_policy
self._runner = PrintRunner(runner or os.system, self.printer)
self._uploader.remote_manager.add_remotes_to_conan()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is going to break something when running docker. Have you tried?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I haven't. Also, currently I am basically in the middle of nowhere, so I can't test it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, it will. I see these ways to fix this:

  1. Add remotes both in packager's and in runner's constructors. This will print a message about remote already existing for each remote if not running jobs in Docker.
  2. Same as 1, but add a flag to RemotesManager, which is set and checked in add_remotes_to_conan.
  3. Add remotes in RemotesManager's constructor.
  4. Add remotes in packager's constructor and in cpt.run_in_docker:run.

What is the most desired approach? Personally, I like approach 2 the most.

@@ -469,8 +469,6 @@ def test_remotes(self):
reference="lib/1.0@lasote/mychannel",
ci_manager=self.ci_manager)

builder.add({}, {}, {}, {})
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This tests if remotes are added. Currently, remotes are added when the jobs are being run. With this change remotes are added before that, so there's no point in adding any jobs.

Copy link
Contributor

@lasote lasote left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, I've been taking a look and maybe we are mostly OK as it is this PR. Because for docker, there is no further need to load the conanfile class before running the build.

@lasote
Copy link
Contributor

lasote commented Jul 2, 2019

Many thanks by the way!!!

@lasote lasote added this to the 0.29.0 milestone Jul 2, 2019
@grisumbras
Copy link
Contributor Author

Thanks for merging.

@grisumbras grisumbras deleted the add-remotes-early branch July 2, 2019 10:48
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.

2 participants