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 cpp_info.name to cmake and pkg_config generators #5598

Merged
merged 8 commits into from Sep 27, 2019

Conversation

@danimtb
Copy link
Member

commented Aug 9, 2019

Changelog: Feature: Adds name attribute to CppInfo and use cpp_info.name in all CMake and pkg-config generators as the find scripts files names, target names, etc.
Docs: conan-io/docs#1393

@tags: slow

  • Refer to the issue that supports this Pull Request: related to #5090
  • 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.

@danimtb danimtb added this to the 1.19 milestone Aug 9, 2019
@danimtb danimtb marked this pull request as ready for review Aug 9, 2019
Copy link
Contributor

left a comment

Silly question, why the feature is not just: develop...lasote:feature/custom_name
It will apply to ALL generators. Did you detected some issues?

@danimtb

This comment has been minimized.

Copy link
Member Author

commented Sep 13, 2019

That way the name of dependencies in the dict for deps_cpp_info would not match the name of the references and it would be confusing. The name of the reference should not change IMO

@lasote

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2019

Maybe that is exactly what we want as far as we document it properly. It looks like it simplifies everything A LOT. ping @memsharded

Mhh, thinking again it would produce conflicts without control. Let me think about it.

@@ -51,10 +52,12 @@ def variables_setup_test(self):
conanfile.initialize(Settings({}), EnvValues())
ref = ConanFileReference.loads("MyPkg/0.1@lasote/stables")
cpp_info = CppInfo("dummy_root_folder1")
cpp_info.name = ref.name

This comment has been minimized.

Copy link
@lasote

lasote Sep 13, 2019

Contributor

What happens if you don't assign this?

This comment has been minimized.

Copy link
@danimtb

danimtb Sep 16, 2019

Author Member

When cpp_info.name is used inside the generator, the None type makes it crash

AttributeError: 'NoneType' object has no attribute 'upper'

Copy link
Contributor

left a comment

I would introduce also the pc files change. Explaining better exactly what is affecting this field in the generators. If we increase with more generators, we can update the list.

@danimtb

This comment has been minimized.

Copy link
Member Author

commented Sep 16, 2019

Done!

@danimtb danimtb changed the title Add cpp_info.name to cmake generators Add cpp_info.name to cmake and pkg_config generators Sep 17, 2019
@danimtb danimtb referenced this pull request Sep 17, 2019
@danimtb danimtb removed their assignment Sep 26, 2019
@lasote lasote removed their assignment Sep 26, 2019
@lasote lasote merged commit a7298fe into conan-io:develop Sep 27, 2019
2 checks passed
2 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details
czoido added a commit to czoido/conan that referenced this pull request Sep 27, 2019
* Add cpp_info.name to cmake generators

* Fix unit tests to mimic real behavior

* cmake_paths test

* add test for cmake generator

* Add cmake_find_package test

* fix test in py3

* Applied cpp_info.name to pkg_config generator

* check different name in pkg_config
memsharded added a commit that referenced this pull request Oct 1, 2019
* Added required = True to subparsers in order to print error message in Py2 and Py3.

* sync

* basic concurrent upload at reference level with futures

* revert changes

* add line

* Lock buggy urllib3 (#5808)

* app simplifying (#5806)

* Apply lockfile before updating downstream requires (#5771)

* apply graph_lock before looking for overrides

* first step: get rid of the warning

* cleaner if graph_lock is passed to the function

* only update requires upstream if no lockfile is applied

* fix tests

* Deprecation of CONAN_USERNAME and CONAN_CHANNEL: fix error message (#5756)

* if CONAN_USERNAME and CONAN_CHANNEL are deprecated, the error cannot recommend them

* update tests accordingly

* test client load() file method (#5815)

* no user/channel repr without _ (#5817)

* no user/channel repr without _

* minor fixes

* fix tests

* Remove py34 (#5820)

* fix upload package id (#5824)

* - update macOS, watchOS, tvOS, iOS version numbers (#5823)

* Refresh token client support.  (#5662)

* Refresh token client support. Missing tests. Missing migration

* public method

* WIP

* Refresh almost there

* Removed prints

* Try migrate

* Migration

* Add comment

* Refresh token flow following RFC recommentations

* Refresh ok

* review

* Remove traces

* Refactor capabilities

* Removed tmp file

* Review

* #5819 Show warning message for Python 3.4 (#5829)

* #5819 Show warning message for Python 3.4

- Add new warning message for python 3.4 which is no longer supported
- Added funcional tests to validate both python 3.4 and 2.x

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #5819 Fix broken tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add cpp_info.name to cmake and pkg_config generators (#5598)

* Add cpp_info.name to cmake generators

* Fix unit tests to mimic real behavior

* cmake_paths test

* add test for cmake generator

* Add cmake_find_package test

* fix test in py3

* Applied cpp_info.name to pkg_config generator

* check different name in pkg_config

* use pyreq short path if exists

* sync with develop

* revert change

* pass correct conanfile

* add test

* remove line

* clean test
memsharded added a commit to memsharded/conan that referenced this pull request Oct 2, 2019
* Added required = True to subparsers in order to print error message in Py2 and Py3.

* sync

* basic concurrent upload at reference level with futures

* revert changes

* add line

* Lock buggy urllib3 (conan-io#5808)

* app simplifying (conan-io#5806)

* Apply lockfile before updating downstream requires (conan-io#5771)

* apply graph_lock before looking for overrides

* first step: get rid of the warning

* cleaner if graph_lock is passed to the function

* only update requires upstream if no lockfile is applied

* fix tests

* Deprecation of CONAN_USERNAME and CONAN_CHANNEL: fix error message (conan-io#5756)

* if CONAN_USERNAME and CONAN_CHANNEL are deprecated, the error cannot recommend them

* update tests accordingly

* test client load() file method (conan-io#5815)

* no user/channel repr without _ (conan-io#5817)

* no user/channel repr without _

* minor fixes

* fix tests

* Remove py34 (conan-io#5820)

* fix upload package id (conan-io#5824)

* - update macOS, watchOS, tvOS, iOS version numbers (conan-io#5823)

* Refresh token client support.  (conan-io#5662)

* Refresh token client support. Missing tests. Missing migration

* public method

* WIP

* Refresh almost there

* Removed prints

* Try migrate

* Migration

* Add comment

* Refresh token flow following RFC recommentations

* Refresh ok

* review

* Remove traces

* Refactor capabilities

* Removed tmp file

* Review

* conan-io#5819 Show warning message for Python 3.4 (conan-io#5829)

* conan-io#5819 Show warning message for Python 3.4

- Add new warning message for python 3.4 which is no longer supported
- Added funcional tests to validate both python 3.4 and 2.x

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* conan-io#5819 Fix broken tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add cpp_info.name to cmake and pkg_config generators (conan-io#5598)

* Add cpp_info.name to cmake generators

* Fix unit tests to mimic real behavior

* cmake_paths test

* add test for cmake generator

* Add cmake_find_package test

* fix test in py3

* Applied cpp_info.name to pkg_config generator

* check different name in pkg_config

* use pyreq short path if exists

* sync with develop

* revert change

* pass correct conanfile

* add test

* remove line

* clean test
lasote added a commit that referenced this pull request Oct 3, 2019
* refactor GraphBinariesAnalyzer

* 1.19.0 release

* 1.20.0-dev

* Issue/5814 fix python_requires with short_paths enabled (#5841)

* Added required = True to subparsers in order to print error message in Py2 and Py3.

* sync

* basic concurrent upload at reference level with futures

* revert changes

* add line

* Lock buggy urllib3 (#5808)

* app simplifying (#5806)

* Apply lockfile before updating downstream requires (#5771)

* apply graph_lock before looking for overrides

* first step: get rid of the warning

* cleaner if graph_lock is passed to the function

* only update requires upstream if no lockfile is applied

* fix tests

* Deprecation of CONAN_USERNAME and CONAN_CHANNEL: fix error message (#5756)

* if CONAN_USERNAME and CONAN_CHANNEL are deprecated, the error cannot recommend them

* update tests accordingly

* test client load() file method (#5815)

* no user/channel repr without _ (#5817)

* no user/channel repr without _

* minor fixes

* fix tests

* Remove py34 (#5820)

* fix upload package id (#5824)

* - update macOS, watchOS, tvOS, iOS version numbers (#5823)

* Refresh token client support.  (#5662)

* Refresh token client support. Missing tests. Missing migration

* public method

* WIP

* Refresh almost there

* Removed prints

* Try migrate

* Migration

* Add comment

* Refresh token flow following RFC recommentations

* Refresh ok

* review

* Remove traces

* Refactor capabilities

* Removed tmp file

* Review

* #5819 Show warning message for Python 3.4 (#5829)

* #5819 Show warning message for Python 3.4

- Add new warning message for python 3.4 which is no longer supported
- Added funcional tests to validate both python 3.4 and 2.x

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #5819 Fix broken tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add cpp_info.name to cmake and pkg_config generators (#5598)

* Add cpp_info.name to cmake generators

* Fix unit tests to mimic real behavior

* cmake_paths test

* add test for cmake generator

* Add cmake_find_package test

* fix test in py3

* Applied cpp_info.name to pkg_config generator

* check different name in pkg_config

* use pyreq short path if exists

* sync with develop

* revert change

* pass correct conanfile

* add test

* remove line

* clean test

* Feature/remote enable error handling (#5835)

* Add a test

* Raise an error if no remote found

* Check that we don't raise an error if the state is already in the required state

* Raise an error only if the remote name is not a wildcard

* Check that we don't raise an error with a wildcard if there are no remotes

* Removed go test files and references to golang from README (#5854)

* Removed go test files and references to golang from README

* Removed golang from README

* making GraphBinaryAnalyzer injectable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.