-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from saraedum/rerender
- Loading branch information
Showing
21 changed files
with
289 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
From 54c79fc5d1c0f251f01b18d3fadd44f795c19d36 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Julian=20R=C3=BCth?= <[email protected]> | ||
Date: Mon, 29 Jun 2020 01:50:34 +0200 | ||
Subject: [PATCH] Make list_of_dicts_to_dict_of_lists preserver the original | ||
order | ||
|
||
list_of_dicts_to_dict_of_lists() was not actually inverse to | ||
dict_of_lists_to_list_of_dicts() since its use of set() changed the | ||
original order in lists. | ||
--- | ||
conda_build/utils.py | 16 ++++++++++------ | ||
conda_build/variants.py | 13 +++++-------- | ||
2 files changed, 15 insertions(+), 14 deletions(-) | ||
|
||
diff --git a/conda_build/utils.py b/conda_build/utils.py | ||
index f04984e6..927f3d22 100644 | ||
--- a/conda_build/utils.py | ||
+++ b/conda_build/utils.py | ||
@@ -1161,12 +1161,16 @@ def package_has_file(package_path, file_path, refresh=False): | ||
|
||
|
||
def ensure_list(arg): | ||
- if (isinstance(arg, string_types) or not hasattr(arg, '__iter__')): | ||
- if arg is not None: | ||
- arg = [arg] | ||
- else: | ||
- arg = [] | ||
- return arg | ||
+ if arg is None: | ||
+ return [] | ||
+ | ||
+ if isinstance(arg, string_types): | ||
+ return [arg] | ||
+ | ||
+ if not hasattr(arg, '__iter__'): | ||
+ return [arg] | ||
+ | ||
+ return list(arg) | ||
|
||
|
||
@contextlib.contextmanager | ||
diff --git a/conda_build/variants.py b/conda_build/variants.py | ||
index c3cdae43..e91911d3 100644 | ||
--- a/conda_build/variants.py | ||
+++ b/conda_build/variants.py | ||
@@ -446,7 +446,8 @@ def dict_of_lists_to_list_of_dicts(dict_of_lists, extend_keys=None): | ||
|
||
|
||
def list_of_dicts_to_dict_of_lists(list_of_dicts): | ||
- """Opposite of dict_of_lists_to_list_of_dicts function. | ||
+ r""" | ||
+ Inverse of `dict_of_lists_to_list_of_dicts`. | ||
|
||
Take broken out collection of variants, and squish it into a dict, where each value is a list. | ||
Only squishes string/int values; does "update" for dict keys | ||
@@ -475,18 +476,14 @@ def list_of_dicts_to_dict_of_lists(list_of_dicts): | ||
existing_value = squished.get(k, OrderedDict()) | ||
existing_value.update(v) | ||
squished[k] = existing_value | ||
- elif isinstance(v, list): | ||
- squished[k] = set(squished.get(k, set())) | set(v) | ||
else: | ||
- squished[k] = list(squished.get(k, [])) + ensure_list(v) | ||
+ squished[k] = squished.get(k, []) + ensure_list(v) | ||
if k not in all_zip_keys: | ||
- squished[k] = list(set(squished[k])) | ||
+ squished[k] = list(OrderedDict.fromkeys(squished[k])) | ||
# reduce the combinatoric space of the zipped keys, too: | ||
if groups: | ||
for group in groups: | ||
- values = list(zip(*set(zip(*(squished[key] for key in group))))) | ||
- for idx, key in enumerate(group): | ||
- squished[key] = values[idx] | ||
+ squished.update({key: value for (key, value) in zip(group, zip(*OrderedDict.fromkeys(zip(*[squished[key] for key in group]))))}) | ||
squished['zip_keys'] = zip_key_groups | ||
return squished | ||
|
||
-- | ||
2.27.0 | ||
|
25 changes: 14 additions & 11 deletions
25
...intervalxt_python_36_target_coverage.yaml → .ci_support/linux_coverage.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
_python: | ||
- 3.7.* *_cpython | ||
action: | ||
- coverage | ||
boost_cpp: | ||
- 1.70.0 | ||
channel_sources: | ||
- flatsurf,conda-forge,defaults | ||
channel_targets: | ||
- flatsurf main | ||
component: | ||
- intervalxt | ||
cxx_compiler: | ||
- gxx | ||
cxx_compiler_version: | ||
- '7' | ||
docker_image: | ||
- condaforge/linux-anvil-comp7 | ||
fmt: | ||
- '6' | ||
gmp: | ||
- '6' | ||
name: | ||
- intervalxt | ||
job: | ||
- coverage | ||
pin_run_as_build: | ||
boost-cpp: | ||
max_pin: x.x.x | ||
gmp: | ||
max_pin: x | ||
python: | ||
min_pin: x.x | ||
max_pin: x.x | ||
python: | ||
- '3.6' | ||
target: | ||
- coverage | ||
zip_keys: | ||
- - target | ||
- name | ||
- - job | ||
- action | ||
- _python | ||
- component |
31 changes: 0 additions & 31 deletions
31
.ci_support/linux_name_intervalxt_python_36_target_style.yaml
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
.ci_support/linux_name_intervalxt_python_37_target_coverage.yaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.