File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1
1
import glob
2
2
import logging
3
3
import os
4
+ import pprint
4
5
import shutil
5
6
import sys
6
7
import tempfile
16
17
17
18
logger = logging .getLogger (__name__ )
18
19
20
+ CONDA_BUILD_SPECIAL_KEYS = (
21
+ "pin_run_as_build" ,
22
+ "ignore_version" ,
23
+ "ignore_build_only_deps" ,
24
+ "extend_keys" ,
25
+ "zip_keys" ,
26
+ )
27
+
19
28
20
29
@contextmanager
21
30
def provide_source_code (recipe_dir , use_container = None ):
@@ -144,6 +153,13 @@ def _print_out():
144
153
]
145
154
variants = get_package_variants (recipe_dir , config = config )[0 ]
146
155
variants = list_of_dicts_to_dict_of_lists ([variants ])
156
+ for key in CONDA_BUILD_SPECIAL_KEYS :
157
+ if key in variants :
158
+ del variants [key ]
159
+ logger .debug (
160
+ "conda build src input variants:\n %s" , pprint .pformat (variants )
161
+ )
162
+
147
163
md = render (
148
164
recipe_dir ,
149
165
finalize = False ,
@@ -158,6 +174,7 @@ def _print_out():
158
174
yield provide (md )
159
175
except (SystemExit , Exception ) as e :
160
176
_print_out ()
177
+ logger .error ("Error in getting conda build src!" , exc_info = e )
161
178
raise RuntimeError ("conda build src exception: " + str (e ))
162
179
163
180
_print_out ()
Original file line number Diff line number Diff line change 31
31
from conda_forge_tick .migration_runner import run_migration_containerized
32
32
from conda_forge_tick .migrators import MigrationYaml , Version
33
33
from conda_forge_tick .os_utils import pushd
34
- from conda_forge_tick .provide_source_code import provide_source_code_containerized
34
+ from conda_forge_tick .provide_source_code import (
35
+ provide_source_code_containerized ,
36
+ provide_source_code_local ,
37
+ )
35
38
from conda_forge_tick .rerender_feedstock import rerender_feedstock
36
39
from conda_forge_tick .solver_checks import is_recipe_solvable
37
40
from conda_forge_tick .update_recipe .version import update_version_feedstock_dir
@@ -776,3 +779,23 @@ def test_container_tasks_update_version_feedstock_dir():
776
779
output = fp .read ()
777
780
778
781
assert actual_output == output
782
+
783
+
784
+ @flaky
785
+ def test_container_tasks_provide_source_code_local (use_containers ):
786
+ with (
787
+ tempfile .TemporaryDirectory () as tmpdir ,
788
+ pushd (tmpdir ),
789
+ ):
790
+ subprocess .run (
791
+ [
792
+ "git" ,
793
+ "clone" ,
794
+ "https://github.com/conda-forge/git-remote-s3-feedstock.git" ,
795
+ ]
796
+ )
797
+
798
+ with provide_source_code_local ("git-remote-s3-feedstock/recipe" ) as source_dir :
799
+ assert os .path .exists (source_dir )
800
+ assert os .path .isdir (source_dir )
801
+ assert "pyproject.toml" in os .listdir (source_dir )
You can’t perform that action at this time.
0 commit comments