internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: conan-io/conan

Issue:
Provide a user-agent header for Conan (#3390)
- [X] Refer to the issue that supports this Pull Request: Closes #3097 

Docs: https://github.com/conan-io/docs/pull/700

This PR generates a user agent string that outputs the Conan client version and the Python version.  This will allow us to track data for client version uptake, and data needed for assessing python version deprecation.  Example: Conan/1.5.0 (Python 2.7.1)

I have not implemented tests yet.  I did do manual tests to confirm it achieves the desired result against Bintray, and when requesting a source tarball from places like source forge.


Discussion:

Resolving patch:
diff --git a/conans/client/rest/conan_requester.py b/conans/client/rest/conan_requester.py
--- a/conans/client/rest/conan_requester.py
+++ b/conans/client/rest/conan_requester.py
@@ -1,8 +1,10 @@
 import fnmatch
 import os
+import requests
+import platform
 
 from conans.util.files import save
-
+from conans import __version__ as client_version
 
 class ConanRequester(object):
 
@@ -55,6 +57,11 @@ def _add_kwargs(self, url, kwargs):
                 kwargs["proxies"] = self.proxies
         if self._timeout_seconds:
             kwargs["timeout"] = self._timeout_seconds
+        if not kwargs.get("headers"):
+            kwargs["headers"]  = {}
+        kwargs["headers"]["User-Agent"] = "Conan/%s (Python %s) %s" % (client_version,
+                                                                       platform.python_version(),
+                                                                       requests.utils.default_user_agent())
         return kwargs
 
     def get(self, url, **kwargs):


Test patch:
Repository: conan-io/conan

Issue:
Add additional default LLVM toolsets
Add to the default settings:
```
LLVM-vs2012, LLVM-vs2012_xp, LLVM-vs2013, LLVM-vs2013_xp, LLVM-vs2017, LLVM-vs2017_xp
```
Should it be possible to add wildcard settings? Like `LLVM-vs*`?



Discussion:

Resolving patch:
diff --git a/conans/client/conf/__init__.py b/conans/client/conf/__init__.py
--- a/conans/client/conf/__init__.py
+++ b/conans/client/conf/__init__.py
@@ -62,7 +62,10 @@
     Visual Studio:
         runtime: [MD, MT, MTd, MDd]
         version: ["8", "9", "10", "11", "12", "14", "15"]
-        toolset: [None, v90, v100, v110, v110_xp, v120, v120_xp, v140, v140_xp, v140_clang_c2, LLVM-vs2014, LLVM-vs2014_xp, v141, v141_xp, v141_clang_c2]
+        toolset: [None, v90, v100, v110, v110_xp, v120, v120_xp,
+                  v140, v140_xp, v140_clang_c2, LLVM-vs2012, LLVM-vs2012_xp, 
+                  LLVM-vs2013, LLVM-vs2013_xp, LLVM-vs2014, LLVM-vs2014_xp, 
+                  LLVM-vs2017, LLVM-vs2017_xp, v141, v141_xp, v141_clang_c2]
     clang:
         version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0", "5.0", "6.0", "7.0"]
         libcxx: [libstdc++, libstdc++11, libc++]


Test patch:
Repository: conan-io/conan

Issue:
[build system] [MSBuild] Abilty to set WindowsSDKVersion when using MSBuild build helper
To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [x] I've specified the Conan version, operating system version and any tool that can be relevant.
- [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

It would be nice to be able to use `/p:WindowsTargetPlatformVersion` (WindowsSDKVersion ) when using the msbuild build helper (similar functionality to the tools.vcvars_command()). 

Unless there is a way to pass arbitrary property flags to the msbuild build command call?

```
if winsdk_version:
   command.append("/p:WindowsTargetPlatformVersion=%s" % winsdk_version)
```


Discussion:
I think it might be a duplicated of: https://github.com/conan-io/conan/issues/3048
WDYT? Could this one be closed?
@lasote MSBuild should mirror an attribute `winsdk_version` of `https://docs.conan.io/en/latest/reference/tools.html#tools-vcvars-command` .

Resolving patch:
diff --git a/conans/client/build/msbuild.py b/conans/client/build/msbuild.py
--- a/conans/client/build/msbuild.py
+++ b/conans/client/build/msbuild.py
@@ -25,12 +25,14 @@ def __init__(self, conanfile):
             self.build_env = None
 
     def build(self, project_file, targets=None, upgrade_project=True, build_type=None, arch=None,
-              parallel=True, force_vcvars=False, toolset=None, platforms=None, use_env=True):
+              parallel=True, force_vcvars=False, toolset=None, platforms=None, use_env=True,
+              vcvars_ver=None, winsdk_version=None):
         with tools.environment_append(self.build_env.vars):
             # Path for custom properties file
             props_file_contents = self._get_props_file_contents()
             with tmp_file(props_file_contents) as props_file_path:
-                vcvars = vcvars_command(self._conanfile.settings, force=force_vcvars)
+                vcvars = vcvars_command(self._conanfile.settings, force=force_vcvars,
+                                        vcvars_ver=vcvars_ver, winsdk_version=winsdk_version)
                 command = self.get_command(project_file, props_file_path,
                                            targets=targets, upgrade_project=upgrade_project,
                                            build_type=build_type, arch=arch, parallel=parallel,
diff --git a/conans/client/tools/win.py b/conans/client/tools/win.py
--- a/conans/client/tools/win.py
+++ b/conans/client/tools/win.py
@@ -231,7 +231,8 @@ def find_windows_10_sdk():
     return None
 
 
-def vcvars_command(settings, arch=None, compiler_version=None, force=False, vcvars_ver=None, winsdk_version=None):
+def vcvars_command(settings, arch=None, compiler_version=None, force=False, vcvars_ver=None,
+                   winsdk_version=None):
     arch_setting = arch or settings.get_safe("arch")
     compiler_version = compiler_version or settings.get_safe("compiler.version")
     os_setting = settings.get_safe("os")


Test patch:
Repository: conan-io/conan

Issue:
SystemPackageTool should call yum update instead of yum check-update
To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [x] I've specified the Conan version, operating system version and any tool that can be relevant.
- [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

conan version 1.5.0
Fedora 28, gcc-8.1.1

from https://github.com/bincrafters/community/issues/345

for instance, attempt to install sdl2/2.0.8@bincrafters/stable recipe on fedora. you'll see that ```yum check-update``` failed with error code 100. this is a legal situation according to the https://access.redhat.com/solutions/2779441.
also, as ```yum check-update``` only verifies are updates available, I believe ```yum update``` shall be used instead. see https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-yum-useful-commands.html



Discussion:

Resolving patch:
diff --git a/conans/client/tools/system_pm.py b/conans/client/tools/system_pm.py
--- a/conans/client/tools/system_pm.py
+++ b/conans/client/tools/system_pm.py
@@ -141,7 +141,7 @@ def installed(self, package_name):
 
 class YumTool(object):
     def update(self):
-        _run(self._runner, "%syum check-update" % self._sudo_str, accepted_returns=[0, 100])
+        _run(self._runner, "%syum update" % self._sudo_str, accepted_returns=[0, 100])
 
     def install(self, package_name):
         _run(self._runner, "%syum install -y %s" % (self._sudo_str, package_name))


Test patch:
diff --git a/conans/test/util/tools_test.py b/conans/test/util/tools_test.py
--- a/conans/test/util/tools_test.py
+++ b/conans/test/util/tools_test.py
@@ -83,7 +83,7 @@ def system_package_tool_test(self):
             os_info.linux_distro = "fedora"
             spt = SystemPackageTool(runner=runner, os_info=os_info)
             spt.update()
-            self.assertEquals(runner.command_called, "sudo yum check-update")
+            self.assertEquals(runner.command_called, "sudo yum update")
 
             os_info.linux_distro = "opensuse"
             spt = SystemPackageTool(runner=runner, os_info=os_info)
@@ -151,7 +151,7 @@ def system_package_tool_test(self):
             spt.install("a_package", force=True)
             self.assertEquals(runner.command_called, "yum install -y a_package")
             spt.update()
-            self.assertEquals(runner.command_called, "yum check-update")
+            self.assertEquals(runner.command_called, "yum update")
 
             os_info.linux_distro = "ubuntu"
             spt = SystemPackageTool(runner=runner, os_info=os_info)
@@ -332,7 +332,7 @@ def get_linux_error_message():
             if os_info.with_apt:
                 update_command = "sudo apt-get update"
             elif os_info.with_yum:
-                update_command = "sudo yum check-update"
+                update_command = "sudo yum update"
             elif os_info.with_zypper:
                 update_command = "sudo zypper --non-interactive ref"
             elif os_info.with_pacman:
Repository: conan-io/conan

Issue:
Add "keep_permissions" option to tools.get()
A nice enhancement to the tools.get() high level wrapper function would be allowing the user to keep permissions when the unzip process happens. This is really useful when downloading compilers or other tools that need to be marked as executable. 


Discussion:
Sure! we can just propagate the parameter `keep_permissions` to the unzip easily.
Also, we should propagate the `pattern`.
Sounds good, I'll make a PR later propagating both of those
Hi @zlalanne 

We are doing some progress towards conan 1.6 and this feature is planned in it. Would you need some help to contribute this feature? Don't hesitate to ask. Please tell us if you could manage, so we plan accordingly. Thanks!

Resolving patch:
diff --git a/conans/client/tools/net.py b/conans/client/tools/net.py
--- a/conans/client/tools/net.py
+++ b/conans/client/tools/net.py
@@ -9,7 +9,8 @@
 _global_requester = None
 
 
-def get(url, md5='', sha1='', sha256='', destination=".", filename=""):
+def get(url, md5='', sha1='', sha256='', destination=".", filename="", keep_permissions=False,
+        pattern=None):
     """ high level downloader + unzipper + (optional hash checker) + delete temporary zip
     """
     if not filename and ("?" in url or "=" in url):
@@ -25,7 +26,7 @@ def get(url, md5='', sha1='', sha256='', destination=".", filename=""):
     if sha256:
         check_sha256(filename, sha256)
 
-    unzip(filename, destination=destination)
+    unzip(filename, destination=destination, keep_permissions=keep_permissions, pattern=pattern)
     os.unlink(filename)
 
 


Test patch:
Repository: conan-io/conan

Issue:
--manifest=[manifest folder] removes information from dependencies
Conan 1.5.2

Using the ``--manifest=[manifest folder]`` argument, deletes information from the dependency graph, the ``package_info()`` method information of the dependencies is lost, and the generated files (conanbuildinfo.cmake) doesn't have it, so compilation fails. To reproduce: 

```
$ conan new Pkg/0.1 -s -t
$ conan create . user/testing --manifests=mymanifests
```




Discussion:

Resolving patch:
diff --git a/conans/client/manager.py b/conans/client/manager.py
--- a/conans/client/manager.py
+++ b/conans/client/manager.py
@@ -285,9 +285,8 @@ def install(self, reference, install_folder, profile, remote_name=None, build_mo
             for node in deps_graph.nodes:
                 if not node.conan_ref:
                     continue
-                conanfile = node.conanfile
                 complete_recipe_sources(self._remote_manager, self._client_cache, self._registry,
-                                        conanfile, node.conan_ref)
+                                        node.conanfile, node.conan_ref)
             manifest_manager.check_graph(deps_graph,
                                          verify=manifest_verify,
                                          interactive=manifest_interactive)


Test patch:
diff --git a/conans/test/integration/manifest_validation_test.py b/conans/test/integration/manifest_validation_test.py
--- a/conans/test/integration/manifest_validation_test.py
+++ b/conans/test/integration/manifest_validation_test.py
@@ -39,11 +39,15 @@ class ConsumerFileTest(ConanFile):
     name = "Chat"
     version = "0.1"
     requires = "Hello/0.1@lasote/stable"
+    def package_info(self):
+        self.cpp_info.libs = ["MyLib"]
 """
         test_conanfile = """from conans import ConanFile
 
 class ConsumerFileTest(ConanFile):
     requires = "Chat/0.1@lasote/stable"
+    def build(self):
+        self.output.info("LIBS = %s" % self.deps_cpp_info.libs[0])
     def test(self):
         self.output.info("TEST OK")
 """
@@ -58,6 +62,7 @@ def test(self):
                           "test_package/conanfile.py": test_conanfile}, clean_first=True)
 
         self.client.run("create . lasote/stable --manifests%s" % dest)
+        self.assertIn("Chat/0.1@lasote/stable (test package): LIBS = MyLib", self.client.out)
         self.assertIn("Chat/0.1@lasote/stable (test package): TEST OK", self.client.user_io.out)
         self.assertIn("Installed manifest for 'Chat/0.1@lasote/stable' from local cache",
                       self.client.user_io.out)
Repository: conan-io/conan

Issue:
Enable python 3.7 in CI 
At least for Linux




Discussion:

Resolving patch:
diff --git a/.ci/jenkins/conf.py b/.ci/jenkins/conf.py
--- a/.ci/jenkins/conf.py
+++ b/.ci/jenkins/conf.py
@@ -13,7 +13,8 @@
 
 linuxpylocation = {"py27": "/usr/bin/python2.7",
                    "py34": "/usr/bin/python3.4",
-                   "py36": "/usr/bin/python3.6"}
+                   "py36": "/usr/bin/python3.6",
+                   "py37": "/usr/bin/python3.7"}
 
 
 def get_environ(tmp_path):
diff --git a/conans/pylint_plugin.py b/conans/pylint_plugin.py
--- a/conans/pylint_plugin.py
+++ b/conans/pylint_plugin.py
@@ -1,7 +1,6 @@
 """Pylint plugin for ConanFile"""
-
 import astroid
-from astroid import MANAGER, scoped_nodes
+from astroid import MANAGER
 
 
 def register(linter):
@@ -16,7 +15,7 @@ def register(linter):
 def transform_conanfile(node):
     """Transform definition of ConanFile class so dynamic fields are visible to pylint"""
 
-    str_class = scoped_nodes.builtin_lookup("str")
+    str_class = astroid.builtin_lookup("str")
     info_class = MANAGER.ast_from_module_name("conans.model.info").lookup(
         "ConanInfo")
     build_requires_class = MANAGER.ast_from_module_name(
@@ -42,5 +41,5 @@ def transform_conanfile(node):
 
 
 MANAGER.register_transform(
-    scoped_nodes.Class, transform_conanfile,
+    astroid.ClassDef, transform_conanfile,
     lambda node: node.qname() == "conans.model.conan_file.ConanFile")


Test patch:
Repository: conan-io/conan

Issue:
Clean C++20 support for CMake 3.12+
CMake 3.12 is out there and officially supports C++20. So now you can use clean way to enable C++20 mode if CMake 3.12 or later is detected.


Discussion:
What are you asking for with this issue?
Right now conan simply adds `-std=c++2a` as a literal flag. For older standards I'm pretty sure it sets `CMAKE_CXX_STANDARD` and a few other things.
I think Conan already does correctly what you are requesting, let me know if I'm wrong, otherwise, we can close this issue.

```
macro(conan_set_std)
  # Do not warn "Manually-specified variables were not used by the project"
  set(ignorevar "${CONAN_STD_CXX_FLAG}${CONAN_CMAKE_CXX_STANDARD}${CONAN_CMAKE_CXX_EXTENSIONS}")
  # TODO: Check version where CMake supports 20, still not released
  if (CMAKE_VERSION VERSION_LESS "3.1" OR "${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "20"
                                       OR "${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "gnu20")
    if(CONAN_STD_CXX_FLAG)
      message(STATUS "Conan setting CXX_FLAGS flags: ${CONAN_STD_CXX_FLAG}")
      set(CMAKE_CXX_FLAGS "${CONAN_STD_CXX_FLAG} ${CMAKE_CXX_FLAGS}")
    endif()
  else()
    if(CONAN_CMAKE_CXX_STANDARD)
      message(STATUS "Conan setting CPP STANDARD: ${CONAN_CMAKE_CXX_STANDARD} WITH EXTENSIONS ${CONAN_CMAKE_CXX_EXTENSIONS}")
      set(CMAKE_CXX_STANDARD ${CONAN_CMAKE_CXX_STANDARD})
      set(CMAKE_CXX_EXTENSIONS ${CONAN_CMAKE_CXX_EXTENSIONS})
    endif()
  endif ()
endmacro()
```
The answer is in the code you've posted:

    # TODO: Check version where CMake supports 20, still not released
You are totally right. I'll open a PR asap.

Resolving patch:
diff --git a/conans/client/generators/cmake_common.py b/conans/client/generators/cmake_common.py
--- a/conans/client/generators/cmake_common.py
+++ b/conans/client/generators/cmake_common.py
@@ -237,9 +237,8 @@ def generate_targets_section(dependencies):
 macro(conan_set_std)
   # Do not warn "Manually-specified variables were not used by the project"
   set(ignorevar "${CONAN_STD_CXX_FLAG}${CONAN_CMAKE_CXX_STANDARD}${CONAN_CMAKE_CXX_EXTENSIONS}")
-  # TODO: Check version where CMake supports 20, still not released
-  if (CMAKE_VERSION VERSION_LESS "3.1" OR "${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "20"
-                                       OR "${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "gnu20")
+  if (CMAKE_VERSION VERSION_LESS "3.1" OR 
+     (CMAKE_VERSION VERSION_LESS "3.12" AND ("${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "20" OR "${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "gnu20")))
     if(CONAN_STD_CXX_FLAG)
       message(STATUS "Conan setting CXX_FLAGS flags: ${CONAN_STD_CXX_FLAG}")
       set(CMAKE_CXX_FLAGS "${CONAN_STD_CXX_FLAG} ${CMAKE_CXX_FLAGS}")
@@ -250,7 +249,7 @@ def generate_targets_section(dependencies):
       set(CMAKE_CXX_STANDARD ${CONAN_CMAKE_CXX_STANDARD})
       set(CMAKE_CXX_EXTENSIONS ${CONAN_CMAKE_CXX_EXTENSIONS})
     endif()
-  endif ()
+  endif()
 endmacro()
 
 macro(conan_set_rpath)


Test patch:
Repository: conan-io/conan

Issue:
zypper package tool is not detected correctly
In the latest versions of opensuse.

The newest versions of opensuse now report their distro.id() as "opensuse-leap", which breaks conan's detection of zypper. This patch fixes it for opensuse leap, opensuse tumbleweed and SLES

(Issue opened to associate to PR #3368)


Discussion:

Resolving patch:
diff --git a/conans/client/tools/oss.py b/conans/client/tools/oss.py
--- a/conans/client/tools/oss.py
+++ b/conans/client/tools/oss.py
@@ -122,9 +122,12 @@ def with_pacman(self):
 
     @property
     def with_zypper(self):
-        return self.is_linux and self.linux_distro in \
-            ("opensuse", "sles")
-
+        if not self.is_linux:
+            return False
+        if "opensuse" in self.linux_distro or "sles" in self.linux_distro:
+            return True
+        return False
+    
     @staticmethod
     def get_win_os_version():
         """


Test patch:
Repository: conan-io/conan

Issue:
scm query
Is there a reason the .git folder is excluded from the copy that occurs? Would it be possible to ensure that it isn't ignored?

I've got a tool I'm using in parts of my conanfile that requires being able to query the git repo. I think it would make sense for the .git folder to be included in the copy to make the export from source closer to what happens on a machine that pulls the recipe and tries to build a non-existant hash.

https://github.com/conan-io/conan/blob/94222228824c90f482cd56769667d1f5c42cca8e/conans/client/tools/scm.py#L99

Thanks!
Matt


Discussion:
Probably you are right.

Resolving patch:
diff --git a/conans/client/tools/scm.py b/conans/client/tools/scm.py
--- a/conans/client/tools/scm.py
+++ b/conans/client/tools/scm.py
@@ -96,7 +96,6 @@ def excluded_files(self):
             tmp = grep_stdout.splitlines()
         except CalledProcessError:
             tmp = []
-        tmp.append(".git")
         return tmp
 
     def get_remote_url(self, remote_name=None):


Test patch:
diff --git a/conans/test/functional/scm_test.py b/conans/test/functional/scm_test.py
--- a/conans/test/functional/scm_test.py
+++ b/conans/test/functional/scm_test.py
@@ -184,7 +184,7 @@ def test_excluded_repo_fies(self):
         bf = self.client.client_cache.build(pref)
         self.assertTrue(os.path.exists(os.path.join(bf, "myfile.txt")))
         self.assertTrue(os.path.exists(os.path.join(bf, "myfile")))
-        self.assertFalse(os.path.exists(os.path.join(bf, ".git")))
+        self.assertTrue(os.path.exists(os.path.join(bf, ".git")))
         self.assertFalse(os.path.exists(os.path.join(bf, "ignored.pyc")))
 
     def test_local_source(self):
Repository: conan-io/conan

Issue:
[SCM] Inability to export (and create) when using the `scm` feature while the conanfile is in a subfolder
(Working with conan 1.61 on both OS X and Windows)

This issue is following the second part of the problem described in #3069.
Our workflow relies on the *conanfile.py* `scm` feature for revision auto-deduction. We don't place said *conanfile.py* at the root of the repository, but at *conan/conanfile.py* instead.

With this configuration, any attempt to run 

    cd $gitrepo
    conan export conan/ com/develop

Will fail with

> ERROR: Not a git repository

This seems to be because the folder containing the recipe is **not** the root of the repository (it does not contain the .git/ repository), yet its parent does.

Is hosting the recipe in subfolders supported by conan? It seemed to work well for our use case, until this issue.


Discussion:
Here is a repository trying to produce the minimal example:
https://github.com/Adnn/issue_conan-3322

    git clone https://github.com/Adnn/issue_conan-3322.git
    cd issue_conan-3322
    conan export conan com/develop 
In theory, yes, the conanfile.py is intended to live in the root of the repo. I don't know if the SCM feature will be capable of doing this, but lets have a look. Thanks for your report and the minimal example to reproduce!
Marking it for conan 1.7, to have a look and think about it. If any fix/feature is due, it might be implemented in conan 1.8.

Resolving patch:
diff --git a/conans/client/tools/scm.py b/conans/client/tools/scm.py
--- a/conans/client/tools/scm.py
+++ b/conans/client/tools/scm.py
@@ -130,8 +130,10 @@ def get_commit(self):
     get_revision = get_commit
 
     def _check_git_repo(self):
-        if not os.path.exists(os.path.join(self.folder, ".git")):
-            raise ConanException("Not a git repository")
+        try:
+            self.run("status")
+        except Exception:
+            raise ConanException("Not a valid git repository")
 
     def get_branch(self):
         self._check_git_repo()


Test patch: