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

Only add User-Agent to headers dict if there was none provided by the user #7390

Merged

Conversation

noizex
Copy link
Contributor

@noizex noizex commented Jul 20, 2020

Changelog: BugFix: Only add User-Agent to headers dict if it was not provided by the user.
Docs: Omit

Close #7349

  • 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.

@CLAassistant
Copy link

@CLAassistant CLAassistant commented Jul 20, 2020

CLA assistant check
All committers have signed the CLA.

@memsharded
Copy link
Member

@memsharded memsharded commented Jul 21, 2020

The tests are a bit complicated, need some mocking/patching, need to check, I'll try to contribute them tomorrow.

As this is considered a bug, the expected behavior is to use the User-Agent provided in the headers, I don't think it requires dedicated docs.

Please have a look at the CLA signing (it typically means another email different from the Github one was used in the commit)

@noizex
Copy link
Contributor Author

@noizex noizex commented Jul 21, 2020

The tests are a bit complicated, need some mocking/patching, need to check, I'll try to contribute them tomorrow.

Great, thanks! If I can help somehow please let me know - especially where to put them, as I wasn't sure really - I couldn't find tests specifically for that entire class, there were some others but I think they tested just 2 use cases and were more higher level.

As this is considered a bug, the expected behavior is to use the User-Agent provided in the headers, I don't think it requires dedicated docs.

Ok.

Please have a look at the CLA signing (it typically means another email different from the Github one was used in the commit)

Fixed :)

jgsogo and others added 12 commits Jul 21, 2020
* use get_configs instead of config

* fixing tests

* fix tests

* fix tests

* move pkg_config logic to cpp_info so everyone uses the same

* 'name' from cpp_info needs the generator it is requested for

* configs is a private dict now

* revert change in init

* add test for Conan v2 behavior

* deps_cpp_info['deps'].name warns to use get_name instead

* use cpp_info properly

* compare as lists (convert possible iterables to lists)

* set legit values in cpp_info

* readonly fields expected to be iterable (not nessessaryly lists)

* remove print statement from test

* let any iterable type in

* revert test changes

* use property 'configs' to retrieve the different configs

* check type for cpp_info/deps_cpp_info objects

* just a list
… in the remote (conan-io#7338)

* remove only if there are packages to remove

* working on v1 too

* no need to scape an r-string

* v1 -> no revs

* if not conaninfo, search doesn't work

* propagate 404 only if there are packages for the reference

* Update conans/client/rest/rest_client_v1.py

Co-authored-by: James <james@conan.io>

* when it is not none

* package_ids is always a list. Capture unrelated errors

Co-authored-by: James <james@conan.io>
* use get_configs instead of config

* fixing tests

* fix tests

* fix tests

* move pkg_config logic to cpp_info so everyone uses the same

* 'name' from cpp_info needs the generator it is requested for

* configs is a private dict now

* revert change in init

* add test for Conan v2 behavior

* deps_cpp_info['deps'].name warns to use get_name instead

* some attributes doesn't make sense at the base level

* rewrite txt parser

* revert test changes

* use property 'configs' to retrieve the different configs

* Avoid usage of '__len__' hook

* fixing test: never root

* read names from txt serialization

* the only information that is serialized in the 'txt' generated file is the name for the txt generator

* use ordereddict to retrieve deps in order

* add test for next Conan v2

* remove commented lines

* remove unused method

* wrong behavior in py2 for it scope

* fix tests in windows

* revert single change
* relax msbuild generator to not fail in Linux

* fix test
* add management for commands 2.0

* refactor cli

* fail on empty docs

* rename _conan to _conan_api

* minimum required version

* add fixme for conan factory

* add discuss

* raise on not allowed formatter

* refactor weird try, except, finally pattern

* change output handling

* remove weird pattern

* minor changes

* move exception handling

* use formatters as dictonary

* minor changes

* do not allow empty remotee

* add output argument only if there are formatters

* move exit codes

* change default formatter

* add init
* conditional generators test with configure()

* fixing test

* fixing test

* adding generators in the command line
* conan-io#7328 Add 'outdated' column in search table

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

* conan-io#7328 do not remove more than requested

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

* conan-io#7328 Separate functional test

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

* conan-io#7328 Update other test to support outdated column

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

* implementing __contains__ for option in self.info.options

* add test

* more tests

* clarified test

* changed self.info.options.whatever to raise

* improve tests

* fix tests

* Update conans/test/functional/package_id/package_id_test.py

Co-authored-by: Javier G. Sogo <jgsogo@gmail.com>

* Update conans/test/functional/package_id/package_id_test.py

Co-authored-by: Javier G. Sogo <jgsogo@gmail.com>

* fixed test

Co-authored-by: Javier G. Sogo <jgsogo@gmail.com>
@memsharded
Copy link
Member

@memsharded memsharded commented Jul 21, 2020

Contributed test, seems all good to go.
Thanks very much for reporting and contributing this! It will be released in Conan 1.28

@memsharded memsharded merged commit 0c63663 into conan-io:develop Jul 21, 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.

6 participants