Skip to content

Commit dcf9458

Browse files
authored
Merge branch 'main' into v1-combine-not
2 parents 7b218cf + 141732a commit dcf9458

File tree

5 files changed

+229
-62
lines changed

5 files changed

+229
-62
lines changed

conda-lock.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -701,47 +701,47 @@ package:
701701
python-dateutil: '>=2.1,<3.0.0'
702702
urllib3: '>=1.25.4,!=2.2.0,<3'
703703
hash:
704-
md5: 2d2150ea873387c525a28755c976291f
705-
sha256: f814c6cd184bf7526ef1770fc3e5c33d5f4c4867991d5b2713323599d7911f16
704+
md5: 197f85e572eb35418f60f85ad0a211e7
705+
sha256: 1843a8bdf37d220beed37764b550922fd737838253b32f068fa718c35c7223e4
706706
manager: conda
707707
name: botocore
708708
optional: false
709709
platform: linux-64
710710
url:
711-
https://conda.anaconda.org/conda-forge/noarch/botocore-1.37.18-pyge310_1234567_0.conda
712-
version: 1.37.18
711+
https://conda.anaconda.org/conda-forge/noarch/botocore-1.37.19-pyge310_1234567_0.conda
712+
version: 1.37.19
713713
- category: main
714714
dependencies:
715715
jmespath: '>=0.7.1,<2.0.0'
716716
python: '>=3.10'
717717
python-dateutil: '>=2.1,<3.0.0'
718718
urllib3: '>=1.25.4,!=2.2.0,<3'
719719
hash:
720-
md5: 2d2150ea873387c525a28755c976291f
721-
sha256: f814c6cd184bf7526ef1770fc3e5c33d5f4c4867991d5b2713323599d7911f16
720+
md5: 197f85e572eb35418f60f85ad0a211e7
721+
sha256: 1843a8bdf37d220beed37764b550922fd737838253b32f068fa718c35c7223e4
722722
manager: conda
723723
name: botocore
724724
optional: false
725725
platform: osx-64
726726
url:
727-
https://conda.anaconda.org/conda-forge/noarch/botocore-1.37.18-pyge310_1234567_0.conda
728-
version: 1.37.18
727+
https://conda.anaconda.org/conda-forge/noarch/botocore-1.37.19-pyge310_1234567_0.conda
728+
version: 1.37.19
729729
- category: main
730730
dependencies:
731731
jmespath: '>=0.7.1,<2.0.0'
732732
python: '>=3.10'
733733
python-dateutil: '>=2.1,<3.0.0'
734734
urllib3: '>=1.25.4,!=2.2.0,<3'
735735
hash:
736-
md5: 2d2150ea873387c525a28755c976291f
737-
sha256: f814c6cd184bf7526ef1770fc3e5c33d5f4c4867991d5b2713323599d7911f16
736+
md5: 197f85e572eb35418f60f85ad0a211e7
737+
sha256: 1843a8bdf37d220beed37764b550922fd737838253b32f068fa718c35c7223e4
738738
manager: conda
739739
name: botocore
740740
optional: false
741741
platform: osx-arm64
742742
url:
743-
https://conda.anaconda.org/conda-forge/noarch/botocore-1.37.18-pyge310_1234567_0.conda
744-
version: 1.37.18
743+
https://conda.anaconda.org/conda-forge/noarch/botocore-1.37.19-pyge310_1234567_0.conda
744+
version: 1.37.19
745745
- category: main
746746
dependencies:
747747
__glibc: '>=2.17,<3.0.a0'
@@ -2104,39 +2104,39 @@ package:
21042104
- category: main
21052105
dependencies: {}
21062106
hash:
2107-
md5: 949519bf61c21c9db15f19f67a08a5b9
2108-
sha256: 54cbf4a99778316e05a7c646a92681e2694ee104fa637b5f435d4e6a1da818f6
2107+
md5: 70a927214f86c015bc968a3a9191effd
2108+
sha256: 6b215f2483afc2e36d01c4cc537a02bf3dcc9c8c6fb1bbd1ec6ac3471cee3435
21092109
manager: conda
21102110
name: conda-forge-pinning
21112111
optional: false
21122112
platform: linux-64
21132113
url:
2114-
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.23.21.47.32-hd8ed1ab_0.conda
2115-
version: 2025.03.23.21.47.32
2114+
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.25.13.35.37-hd8ed1ab_0.conda
2115+
version: 2025.03.25.13.35.37
21162116
- category: main
21172117
dependencies: {}
21182118
hash:
2119-
md5: 949519bf61c21c9db15f19f67a08a5b9
2120-
sha256: 54cbf4a99778316e05a7c646a92681e2694ee104fa637b5f435d4e6a1da818f6
2119+
md5: 70a927214f86c015bc968a3a9191effd
2120+
sha256: 6b215f2483afc2e36d01c4cc537a02bf3dcc9c8c6fb1bbd1ec6ac3471cee3435
21212121
manager: conda
21222122
name: conda-forge-pinning
21232123
optional: false
21242124
platform: osx-64
21252125
url:
2126-
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.23.21.47.32-hd8ed1ab_0.conda
2127-
version: 2025.03.23.21.47.32
2126+
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.25.13.35.37-hd8ed1ab_0.conda
2127+
version: 2025.03.25.13.35.37
21282128
- category: main
21292129
dependencies: {}
21302130
hash:
2131-
md5: 949519bf61c21c9db15f19f67a08a5b9
2132-
sha256: 54cbf4a99778316e05a7c646a92681e2694ee104fa637b5f435d4e6a1da818f6
2131+
md5: 70a927214f86c015bc968a3a9191effd
2132+
sha256: 6b215f2483afc2e36d01c4cc537a02bf3dcc9c8c6fb1bbd1ec6ac3471cee3435
21332133
manager: conda
21342134
name: conda-forge-pinning
21352135
optional: false
21362136
platform: osx-arm64
21372137
url:
2138-
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.23.21.47.32-hd8ed1ab_0.conda
2139-
version: 2025.03.23.21.47.32
2138+
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.25.13.35.37-hd8ed1ab_0.conda
2139+
version: 2025.03.25.13.35.37
21402140
- category: main
21412141
dependencies:
21422142
click: '>=8'
@@ -9183,45 +9183,45 @@ package:
91839183
python: '>=3.11,<3.12.0a0'
91849184
python_abi: 3.11.*
91859185
hash:
9186-
md5: 19615e39755eac6975671b8a679f7088
9187-
sha256: 2626f5c211749d1e5632c81d92313677e0c537f1376f397432976379db2dabc4
9186+
md5: a0b45a3ae748e3cce6409cb12664bf2b
9187+
sha256: 20ecfaf61224ea92dadb543ee5ca3757e4feff4524c9d6633de908d11f4c5cd4
91889188
manager: conda
91899189
name: orjson
91909190
optional: false
91919191
platform: linux-64
91929192
url:
9193-
https://conda.anaconda.org/conda-forge/linux-64/orjson-3.10.15-py311h9e33e62_0.conda
9194-
version: 3.10.15
9193+
https://conda.anaconda.org/conda-forge/linux-64/orjson-3.10.16-py311h9e33e62_0.conda
9194+
version: 3.10.16
91959195
- category: main
91969196
dependencies:
91979197
__osx: '>=10.13'
91989198
python: '>=3.11,<3.12.0a0'
91999199
python_abi: 3.11.*
92009200
hash:
9201-
md5: a1b4c1e9c26279ae4dcbd4319dffb541
9202-
sha256: 0015c2a458bea689eb5af205bc30770ca3c51e68a23aa9ee0ae2f84282ac11b5
9201+
md5: cb8506609560dbdc5dfc31be0a11f3b5
9202+
sha256: 02b79f1ab9a745a542fd9fa361890ea1b99764fb91a1637d7a64e5bd9c699c96
92039203
manager: conda
92049204
name: orjson
92059205
optional: false
92069206
platform: osx-64
92079207
url:
9208-
https://conda.anaconda.org/conda-forge/osx-64/orjson-3.10.15-py311h3b9c2be_0.conda
9209-
version: 3.10.15
9208+
https://conda.anaconda.org/conda-forge/osx-64/orjson-3.10.16-py311h3b9c2be_0.conda
9209+
version: 3.10.16
92109210
- category: main
92119211
dependencies:
92129212
__osx: '>=11.0'
92139213
python: '>=3.11,<3.12.0a0'
92149214
python_abi: 3.11.*
92159215
hash:
9216-
md5: 1c10494123be62099e1afaa0ea746786
9217-
sha256: 5f34f758aa88da54af624e5bd8e8f19f0cc36acf3f1792efbd4c59748ffa9b7a
9216+
md5: 8d735e647d8e06b1e33ecd296070de34
9217+
sha256: 2f9f6d2541a903ce91f5af8bf31b39d678d7e569c802e73f7c2e2ca91eb763f2
92189218
manager: conda
92199219
name: orjson
92209220
optional: false
92219221
platform: osx-arm64
92229222
url:
9223-
https://conda.anaconda.org/conda-forge/osx-arm64/orjson-3.10.15-py311h3ff9189_0.conda
9224-
version: 3.10.15
9223+
https://conda.anaconda.org/conda-forge/osx-arm64/orjson-3.10.16-py311h3ff9189_0.conda
9224+
version: 3.10.16
92259225
- category: main
92269226
dependencies:
92279227
python: '>=3.8'

conda_forge_tick/migrators/cross_compile.py

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -325,20 +325,24 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No
325325
"""
326326

327327

328-
class CrossRBaseMigrator(CrossCompilationMigratorBase):
328+
class CrossRBaseMigrator(MiniMigrator):
329+
allowed_schema_versions = {0, 1}
330+
post_migration = True
331+
329332
def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool:
333+
if super().filter(attrs, not_bad_str_start):
334+
return True
335+
330336
host_reqs = attrs.get("requirements", {}).get("host", set())
331-
skip_schema = skip_migrator_due_to_schema(attrs, self.allowed_schema_versions)
332-
if (
333-
"r-base" in host_reqs or attrs.get("name", "").startswith("r-")
334-
) and not skip_schema:
337+
if "r-base" in host_reqs or attrs.get("name", "").startswith("r-"):
335338
return False
336339
else:
337340
return True
338341

339342
def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None:
340343
with pushd(recipe_dir):
341-
with open("meta.yaml") as fp:
344+
recipe_file = next(filter(os.path.exists, ("recipe.yaml", "meta.yaml")))
345+
with open(recipe_file) as fp:
342346
meta_yaml = fp.readlines()
343347

344348
new_lines = []
@@ -347,10 +351,20 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No
347351
for line in meta_yaml:
348352
if previous_was_build:
349353
nspaces = len(line) - len(line.lstrip())
350-
new_lines.append(
351-
" " * nspaces
352-
+ "- cross-r-base {{ r_base }} # [build_platform != target_platform]\n",
353-
)
354+
if recipe_file == "recipe.yaml":
355+
new_lines.extend(
356+
[
357+
" " * nspaces
358+
+ "- if: build_platform != host_platform\n",
359+
" " * nspaces + " then:\n",
360+
" " * nspaces + " - cross-r-base ${{ r_base }}\n",
361+
]
362+
)
363+
else:
364+
new_lines.append(
365+
" " * nspaces
366+
+ "- cross-r-base {{ r_base }} # [build_platform != target_platform]\n",
367+
)
354368
# Add host R requirements to build
355369
host_reqs = attrs.get("requirements", {}).get("host", set())
356370
r_host_reqs = [
@@ -359,15 +373,18 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No
359373
if req.startswith("r-") and req != "r-base"
360374
]
361375
for r_req in r_host_reqs:
362-
# Ensure nice formatting
363-
post_nspaces = max(0, 25 - len(r_req))
364-
new_lines.append(
365-
" " * nspaces
366-
+ "- "
367-
+ r_req
368-
+ " " * post_nspaces
369-
+ " # [build_platform != target_platform]\n",
370-
)
376+
if recipe_file == "recipe.yaml":
377+
new_lines.append(" " * nspaces + f" - {r_req}\n")
378+
else:
379+
# Ensure nice formatting
380+
post_nspaces = max(0, 25 - len(r_req))
381+
new_lines.append(
382+
" " * nspaces
383+
+ "- "
384+
+ r_req
385+
+ " " * post_nspaces
386+
+ " # [build_platform != target_platform]\n",
387+
)
371388
in_req = False
372389
previous_was_build = False
373390
if "requirements:" in line:
@@ -376,7 +393,7 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No
376393
previous_was_build = True
377394
new_lines.append(line)
378395

379-
with open("meta.yaml", "w") as f:
396+
with open(recipe_file, "w") as f:
380397
f.write("".join(new_lines))
381398

382399
if os.path.exists("build.sh"):

tests/test_cross_compile.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,15 @@ def test_cmake(tmp_path):
149149
assert lines == expected
150150

151151

152+
@pytest.mark.parametrize("recipe_version", [0, 1])
152153
@flaky
153-
def test_cross_rbase(tmp_path):
154+
def test_cross_rbase(tmp_path, recipe_version: int):
154155
run_test_migration(
155156
m=version_migrator_rbase,
156-
inp=YAML_PATH.joinpath("rbase_recipe.yaml").read_text(),
157-
output=YAML_PATH.joinpath("rbase_recipe_correct.yaml").read_text(),
157+
inp=YAML_PATHS[recipe_version].joinpath("rbase_recipe.yaml").read_text(),
158+
output=YAML_PATHS[recipe_version]
159+
.joinpath("rbase_recipe_correct.yaml")
160+
.read_text(),
158161
prb="Dependencies have been updated if changed",
159162
kwargs={"new_version": "2.0.1"},
160163
mr_out={
@@ -163,18 +166,22 @@ def test_cross_rbase(tmp_path):
163166
"version": "2.0.1",
164167
},
165168
tmp_path=tmp_path,
169+
recipe_version=recipe_version,
166170
)
167171

168172

173+
@pytest.mark.parametrize("recipe_version", [0, 1])
169174
@flaky
170-
def test_cross_rbase_build_sh(tmp_path):
175+
def test_cross_rbase_build_sh(tmp_path, recipe_version: int):
171176
tmp_path.joinpath("recipe").mkdir()
172177
with open(tmp_path / "recipe/build.sh", "w") as f:
173178
f.write("#!/bin/bash\nR CMD INSTALL --build .")
174179
run_test_migration(
175180
m=version_migrator_rbase,
176-
inp=YAML_PATH.joinpath("rbase_recipe.yaml").read_text(),
177-
output=YAML_PATH.joinpath("rbase_recipe_correct.yaml").read_text(),
181+
inp=YAML_PATHS[recipe_version].joinpath("rbase_recipe.yaml").read_text(),
182+
output=YAML_PATHS[recipe_version]
183+
.joinpath("rbase_recipe_correct.yaml")
184+
.read_text(),
178185
prb="Dependencies have been updated if changed",
179186
kwargs={"new_version": "2.0.1"},
180187
mr_out={
@@ -183,6 +190,7 @@ def test_cross_rbase_build_sh(tmp_path):
183190
"version": "2.0.1",
184191
},
185192
tmp_path=tmp_path,
193+
recipe_version=recipe_version,
186194
)
187195
expected = [
188196
"#!/bin/bash\n",
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
schema_version: 1
2+
3+
context:
4+
version: 2.0.0
5+
posix: ${{'m2-' if win else ''}}
6+
native: ${{'m2w64-' if win else ''}}
7+
8+
package:
9+
name: r-magrittr
10+
version: ${{ version|replace("-", "_") }}
11+
12+
source:
13+
url:
14+
- https://cran.r-project.org/src/contrib/magrittr_${{ version }}.tar.gz
15+
- https://cran.r-project.org/src/contrib/Archive/magrittr/magrittr_${{ version }}.tar.gz
16+
sha256: 05c45943ada9443134caa0ab24db4a962b629f00b755ccf039a2a2a7b2c92ae8
17+
18+
build:
19+
number: 1
20+
dynamic_linking:
21+
rpaths:
22+
- lib/R/lib/
23+
- lib/
24+
25+
requirements:
26+
build:
27+
- if: not win
28+
then: ${{ compiler('c') }}
29+
- if: win
30+
then: ${{ compiler('m2w64_c') }}
31+
- if: win
32+
then: ${{ posix }}filesystem
33+
- ${{ posix }}make
34+
- if: win
35+
then: ${{ posix }}sed
36+
- if: win
37+
then: ${{ posix }}coreutils
38+
- if: win
39+
then: ${{ posix }}zip
40+
host:
41+
- r-base
42+
- r-rlang
43+
run:
44+
- r-base
45+
- r-rlang
46+
- if: win
47+
then: ${{ native }}gcc-libs
48+
49+
tests:
50+
- script:
51+
- if: not win
52+
then: "$R -e \"library('magrittr')\""
53+
- if: win
54+
then: "\"%R%\" -e \"library('magrittr')\""
55+
56+
about:
57+
license: MIT
58+
summary: |
59+
Provides a mechanism for chaining commands with a new forward-pipe operator, %>%. This operator will forward a value, or the result of an expression, into the next function call/expression. There is flexible support for the type of right-hand side expressions. For more information, see package vignette. To quote
60+
Rene Magritte, "Ceci n'est pas un pipe."
61+
license_file:
62+
- lib/R/share/licenses/MIT
63+
- LICENSE
64+
homepage: https://magrittr.tidyverse.org
65+
66+
extra:
67+
recipe-maintainers:
68+
- conda-forge/r
69+
- ocefpaf

0 commit comments

Comments
 (0)