Skip to content

Commit

Permalink
Merge branch 'develop2' into release/2.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
czoido committed Dec 22, 2022
2 parents bd1acb1 + 0b74648 commit 14c9869
Show file tree
Hide file tree
Showing 144 changed files with 1,941 additions and 1,904 deletions.
29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/bug.md

This file was deleted.

45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Bug Report
description: Report a bug, something does not work as it's supposed to
title: '[bug] SHORT DESCRIPTION'
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to submit a report.
**Please don't forget to update the issue title.**
Include all applicable information to help us reproduce your problem.
- type: textarea
id: description
attributes:
label: Environment details
description: Include every applicable attribute
value: |
* Operating System+version:
* Compiler+version:
* Conan version:
* Python version:
validations:
required: false
- type: textarea
id: reproduction
attributes:
label: Steps to reproduce
description: Include if applicable
placeholder: |
1. Make sure that ... is there
2. Execute the `conan ...` command
3. Observe how the resulting ... is wrong
validations:
required: false
- type: textarea
id: logs
attributes:
label: Logs
description: (Executed commands with output, include/attach if applicable)
placeholder: |
```
barbarian@conan ~: conan ...
This is the output from conan ...
```
validations:
required: false
9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature Request
description: Request a new feature or suggest a change
title: '[feature] SHORT DESCRIPTION'
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to submit a request.
**Please don't forget to update the issue title.**
- type: textarea
id: suggestion
attributes:
label: What is your suggestion?
description: Please be as specific as possible!
placeholder: Hi! I would like for conan to be able to ...
validations:
required: true
- type: checkboxes
id: contributing
attributes:
label: Have you read the CONTRIBUTING guide?
description: It can be found in [CONTRIBUTING.md](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md)
options:
- label: I've read the CONTRIBUTING guide
validations:
required: true
9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/question.md

This file was deleted.

26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Question
description: If something needs clarification
title: '[question] SHORT DESCRIPTION'
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill your question.
**Please don't forget to update the issue title.**
- type: textarea
id: question
attributes:
label: What is your question?
description: Please be as specific as possible!
placeholder: Hi! I have a question regarding ...
validations:
required: true
- type: checkboxes
id: contributing
attributes:
label: Have you read the CONTRIBUTING guide?
description: It can be found in [CONTRIBUTING.md](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md)
options:
- label: I've read the CONTRIBUTING guide
validations:
required: true
7 changes: 0 additions & 7 deletions conan/api/conan_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(self, cache_folder=None):
migrator.migrate()
check_required_conan_version(self.cache_folder)

# Remotes management
self.remotes = RemotesAPI(self)
# Search recipes by wildcard and packages filtering by configuracion
self.search = SearchAPI(self)
Expand All @@ -58,9 +57,3 @@ def __init__(self, cache_folder=None):
self.cache = CacheAPI(self)
self.lockfile = LockfileAPI(self)
self.local = LocalAPI(self)


def set_conan_output_level(level, activate_logger=False):
from conan.api import output
output.conan_output_level = level
output.conan_output_logger_format = activate_logger
23 changes: 18 additions & 5 deletions conan/api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ class SelectBundle:
def __init__(self):
self.recipes = OrderedDict()

def add_ref(self, ref):
self.recipes.setdefault(ref, [])
def add_refs(self, refs):
for ref in refs:
self.recipes.setdefault(ref, [])

def refs(self):
return self.recipes.keys()
Expand All @@ -79,17 +80,29 @@ def prefs(self):
prefs.extend(v)
return prefs

def add_prefs(self, prefs):
def add_prefs(self, prefs, configurations=None):
for pref in prefs:
self.recipes.setdefault(pref.ref, []).append(pref)
binary_info = {} if not configurations else configurations.get(pref)
self.recipes.setdefault(pref.ref, []).append((pref, binary_info))

def serialize(self):
ret = {}
for ref, prefs in self.recipes.items():
pref_ret = {}
if prefs:
for pref, binary_info in prefs:
pref_ret[pref.repr_notime()] = binary_info
ret[ref.repr_notime()] = pref_ret
return ret


class UploadBundle:
def __init__(self, select_bundle):
self.recipes = OrderedDict()
# We reverse the bundle so older revisions are uploaded first
for ref, prefs in reversed(select_bundle.recipes.items()):
self.recipes[ref] = _RecipeUploadData(reversed(prefs))
reversed_prefs = reversed([pref for pref, _ in prefs])
self.recipes[ref] = _RecipeUploadData(reversed_prefs)

def serialize(self):
return {r.repr_notime(): v.serialize() for r, v in self.recipes.items()}
Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/cache.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan.api.subapi import api_method
from conan.api.conan_app import ConanApp
from conan.internal.conan_app import ConanApp
from conans.errors import ConanException
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan.api.subapi import api_method
from conan.api.conan_app import ConanApp
from conan.internal.conan_app import ConanApp


class ConfigAPI:
Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/download.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from conan.api.model import Remote
from conan.api.subapi import api_method
from conan.api.output import ConanOutput
from conan.api.conan_app import ConanApp
from conan.internal.conan_app import ConanApp
from conans.client.source import retrieve_exports_sources
from conans.errors import ConanException
from conans.model.package_ref import PkgReference
Expand Down
14 changes: 5 additions & 9 deletions conan/api/subapi/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from conan.api.output import ConanOutput
from conan.api.subapi import api_method
from conan.api.conan_app import ConanApp
from conan.internal.conan_app import ConanApp
from conans.client.cmd.export import cmd_export
from conans.client.conanfile.package import run_package_method
from conans.client.graph.graph import BINARY_INVALID
Expand All @@ -16,9 +16,10 @@ def __init__(self, conan_api):
self.conan_api = conan_api

@api_method
def export(self, path, name, version, user, channel, lockfile=None):
def export(self, path, name, version, user, channel, lockfile=None, remotes=None):
app = ConanApp(self.conan_api.cache_folder)
return cmd_export(app, path, name, version, user, channel, graph_lock=lockfile)
return cmd_export(app, path, name, version, user, channel, graph_lock=lockfile,
remotes=remotes)

@api_method
def export_pkg(self, deps_graph, path):
Expand All @@ -30,12 +31,7 @@ def export_pkg(self, deps_graph, path):
# passing here the create_reference=ref argument is useful so the recipe is in "develop",
# because the "package()" method is in develop=True already

# this is a bit tricky, but works. The root (virtual), has only 1 neighbor,
# which is the exported pkg
# TODO: Seems this could be changed, loading conanfile from cache, but locally setting
# to local folder?
nodes = deps_graph.root.neighbors()
pkg_node = nodes[0]
pkg_node = deps_graph.root
ref = pkg_node.ref
if pkg_node.binary == BINARY_INVALID:
binary, reason = "Invalid", pkg_node.conanfile.info.invalid
Expand Down
Loading

0 comments on commit 14c9869

Please sign in to comment.