Skip to content

Commit 8944b32

Browse files
authored
Merge branch 'main' into v1-combine-not
2 parents dcf9458 + 3172e1b commit 8944b32

File tree

7 files changed

+332
-41
lines changed

7 files changed

+332
-41
lines changed

conda-lock.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,39 +2104,39 @@ package:
21042104
- category: main
21052105
dependencies: {}
21062106
hash:
2107-
md5: 70a927214f86c015bc968a3a9191effd
2108-
sha256: 6b215f2483afc2e36d01c4cc537a02bf3dcc9c8c6fb1bbd1ec6ac3471cee3435
2107+
md5: 691ca1b3b86e0fe667fb3d689a4da992
2108+
sha256: ea8cdbf2a402624094d9e508941c75ac13dff8e320dcb4b5f7c55c184b02e425
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.25.13.35.37-hd8ed1ab_0.conda
2115-
version: 2025.03.25.13.35.37
2114+
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.25.21.45.18-hd8ed1ab_0.conda
2115+
version: 2025.03.25.21.45.18
21162116
- category: main
21172117
dependencies: {}
21182118
hash:
2119-
md5: 70a927214f86c015bc968a3a9191effd
2120-
sha256: 6b215f2483afc2e36d01c4cc537a02bf3dcc9c8c6fb1bbd1ec6ac3471cee3435
2119+
md5: 691ca1b3b86e0fe667fb3d689a4da992
2120+
sha256: ea8cdbf2a402624094d9e508941c75ac13dff8e320dcb4b5f7c55c184b02e425
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.25.13.35.37-hd8ed1ab_0.conda
2127-
version: 2025.03.25.13.35.37
2126+
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.25.21.45.18-hd8ed1ab_0.conda
2127+
version: 2025.03.25.21.45.18
21282128
- category: main
21292129
dependencies: {}
21302130
hash:
2131-
md5: 70a927214f86c015bc968a3a9191effd
2132-
sha256: 6b215f2483afc2e36d01c4cc537a02bf3dcc9c8c6fb1bbd1ec6ac3471cee3435
2131+
md5: 691ca1b3b86e0fe667fb3d689a4da992
2132+
sha256: ea8cdbf2a402624094d9e508941c75ac13dff8e320dcb4b5f7c55c184b02e425
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.25.13.35.37-hd8ed1ab_0.conda
2139-
version: 2025.03.25.13.35.37
2138+
https://conda.anaconda.org/conda-forge/noarch/conda-forge-pinning-2025.03.25.21.45.18-hd8ed1ab_0.conda
2139+
version: 2025.03.25.21.45.18
21402140
- category: main
21412141
dependencies:
21422142
click: '>=8'
@@ -11538,38 +11538,38 @@ package:
1153811538
dependencies:
1153911539
python: '>=3.9'
1154011540
hash:
11541-
md5: d451ccded808abf6511f0a2ac9bb9dcc
11542-
sha256: bc35995ecbd38693567fc143d3e6008e53cff900b453412cae48ffa535f25d1f
11541+
md5: bc8e3267d44011051f2eb14d22fb0960
11542+
sha256: 8d2a8bf110cc1fc3df6904091dead158ba3e614d8402a83e51ed3a8aa93cdeb0
1154311543
manager: conda
1154411544
name: pytz
1154511545
optional: false
1154611546
platform: linux-64
11547-
url: https://conda.anaconda.org/conda-forge/noarch/pytz-2025.1-pyhd8ed1ab_0.conda
11548-
version: '2025.1'
11547+
url: https://conda.anaconda.org/conda-forge/noarch/pytz-2025.2-pyhd8ed1ab_0.conda
11548+
version: '2025.2'
1154911549
- category: main
1155011550
dependencies:
1155111551
python: '>=3.9'
1155211552
hash:
11553-
md5: d451ccded808abf6511f0a2ac9bb9dcc
11554-
sha256: bc35995ecbd38693567fc143d3e6008e53cff900b453412cae48ffa535f25d1f
11553+
md5: bc8e3267d44011051f2eb14d22fb0960
11554+
sha256: 8d2a8bf110cc1fc3df6904091dead158ba3e614d8402a83e51ed3a8aa93cdeb0
1155511555
manager: conda
1155611556
name: pytz
1155711557
optional: false
1155811558
platform: osx-64
11559-
url: https://conda.anaconda.org/conda-forge/noarch/pytz-2025.1-pyhd8ed1ab_0.conda
11560-
version: '2025.1'
11559+
url: https://conda.anaconda.org/conda-forge/noarch/pytz-2025.2-pyhd8ed1ab_0.conda
11560+
version: '2025.2'
1156111561
- category: main
1156211562
dependencies:
1156311563
python: '>=3.9'
1156411564
hash:
11565-
md5: d451ccded808abf6511f0a2ac9bb9dcc
11566-
sha256: bc35995ecbd38693567fc143d3e6008e53cff900b453412cae48ffa535f25d1f
11565+
md5: bc8e3267d44011051f2eb14d22fb0960
11566+
sha256: 8d2a8bf110cc1fc3df6904091dead158ba3e614d8402a83e51ed3a8aa93cdeb0
1156711567
manager: conda
1156811568
name: pytz
1156911569
optional: false
1157011570
platform: osx-arm64
11571-
url: https://conda.anaconda.org/conda-forge/noarch/pytz-2025.1-pyhd8ed1ab_0.conda
11572-
version: '2025.1'
11571+
url: https://conda.anaconda.org/conda-forge/noarch/pytz-2025.2-pyhd8ed1ab_0.conda
11572+
version: '2025.2'
1157311573
- category: main
1157411574
dependencies:
1157511575
__glibc: '>=2.17,<3.0.a0'

conda_forge_tick/migrators/cross_compile.py

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,14 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No
148148
f.write("".join(lines))
149149

150150

151-
class CrossPythonMigrator(CrossCompilationMigratorBase):
151+
class CrossPythonMigrator(MiniMigrator):
152+
allowed_schema_versions = {0, 1}
153+
post_migration = True
154+
152155
def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool:
156+
if super().filter(attrs, not_bad_str_start):
157+
return True
158+
153159
host_reqs = attrs.get("requirements", {}).get("host", set())
154160
build_reqs = attrs.get("requirements", {}).get("build", set())
155161
return (
@@ -161,7 +167,8 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool:
161167
def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None:
162168
host_reqs = attrs.get("requirements", {}).get("host", set())
163169
with pushd(recipe_dir):
164-
with open("meta.yaml") as f:
170+
recipe_file = next(filter(os.path.exists, ("recipe.yaml", "meta.yaml")))
171+
with open(recipe_file) as f:
165172
lines = f.readlines()
166173
in_reqs = False
167174
for i, line in enumerate(lines):
@@ -189,24 +196,37 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No
189196
for pkg in reversed(
190197
[
191198
"python",
192-
"cross-python_{{ target_platform }}",
199+
(
200+
"cross-python_${{ host_platform }}"
201+
if recipe_file == "recipe.yaml"
202+
else "cross-python_{{ target_platform }}"
203+
),
193204
"cython",
194205
"numpy",
195206
"cffi",
196207
"pybind11",
197208
],
198209
):
199210
if pkg in host_reqs or pkg.startswith("cross-python"):
200-
new_line = (
201-
" " * spaces
202-
+ "- "
203-
+ pkg.ljust(37)
204-
+ " # [build_platform != target_platform]\n"
205-
)
206-
lines.insert(i + 1, new_line)
211+
if recipe_file == "recipe.yaml":
212+
new_line = (
213+
" " * spaces
214+
+ "- if: build_platform != host_platform\n"
215+
)
216+
lines.insert(i + 1, new_line)
217+
new_line = " " * spaces + f" then: {pkg}\n"
218+
lines.insert(i + 2, new_line)
219+
else:
220+
new_line = (
221+
" " * spaces
222+
+ "- "
223+
+ pkg.ljust(37)
224+
+ " # [build_platform != target_platform]\n"
225+
)
226+
lines.insert(i + 1, new_line)
207227
break
208228

209-
with open("meta.yaml", "w") as f:
229+
with open(recipe_file, "w") as f:
210230
f.write("".join(lines))
211231

212232

tests/test_cross_compile.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,15 @@ def test_cross_rbase_build_sh(tmp_path, recipe_version: int):
205205
assert lines == expected
206206

207207

208+
@pytest.mark.parametrize("recipe_version", [0, 1])
208209
@flaky
209-
def test_cross_python(tmp_path):
210+
def test_cross_python(tmp_path, recipe_version: int):
210211
run_test_migration(
211212
m=version_migrator_python,
212-
inp=YAML_PATH.joinpath("python_recipe.yaml").read_text(),
213-
output=YAML_PATH.joinpath("python_recipe_correct.yaml").read_text(),
213+
inp=YAML_PATHS[recipe_version].joinpath("python_recipe.yaml").read_text(),
214+
output=YAML_PATHS[recipe_version]
215+
.joinpath("python_recipe_correct.yaml")
216+
.read_text(),
214217
prb="Dependencies have been updated if changed",
215218
kwargs={"new_version": "1.19.1"},
216219
mr_out={
@@ -219,15 +222,21 @@ def test_cross_python(tmp_path):
219222
"version": "1.19.1",
220223
},
221224
tmp_path=tmp_path,
225+
recipe_version=recipe_version,
222226
)
223227

224228

229+
@pytest.mark.parametrize("recipe_version", [0, 1])
225230
@flaky
226-
def test_cross_python_no_build(tmp_path):
231+
def test_cross_python_no_build(tmp_path, recipe_version: int):
227232
run_test_migration(
228233
m=version_migrator_python,
229-
inp=YAML_PATH.joinpath("python_no_build_recipe.yaml").read_text(),
230-
output=YAML_PATH.joinpath("python_no_build_recipe_correct.yaml").read_text(),
234+
inp=YAML_PATHS[recipe_version]
235+
.joinpath("python_no_build_recipe.yaml")
236+
.read_text(),
237+
output=YAML_PATHS[recipe_version]
238+
.joinpath("python_no_build_recipe_correct.yaml")
239+
.read_text(),
231240
prb="Dependencies have been updated if changed",
232241
kwargs={"new_version": "2020.6.20"},
233242
mr_out={
@@ -236,6 +245,7 @@ def test_cross_python_no_build(tmp_path):
236245
"version": "2020.6.20",
237246
},
238247
tmp_path=tmp_path,
248+
recipe_version=recipe_version,
239249
)
240250

241251

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
schema_version: 1
2+
3+
context:
4+
version: 2020.4.5.2
5+
pip_version: 19.1.1
6+
setuptools_version: 41.0.1
7+
8+
package:
9+
name: certifi
10+
version: ${{ version }}
11+
12+
source:
13+
- url: https://pypi.io/packages/source/c/certifi/certifi-${{ version }}.tar.gz
14+
sha256: 5ad7e9a056d25ffa5082862e36f119f7f7cec6457fa07ee2f8c339814b80c9b1
15+
target_directory: certifi
16+
# bootstrap pip and setuptools to avoid circular dependency
17+
# but without losing metadata
18+
- url: https://pypi.io/packages/py2.py3/p/pip/pip-${{ pip_version }}-py2.py3-none-any.whl
19+
sha256: 993134f0475471b91452ca029d4390dc8f298ac63a712814f101cd1b6db46676
20+
target_directory: pip_wheel
21+
- url: https://pypi.io/packages/py2.py3/s/setuptools/setuptools-${{ setuptools_version }}-py2.py3-none-any.whl
22+
sha256: c7769ce668c7a333d84e17fe8b524b1c45e7ee9f7908ad0a73e1eda7e6a5aebf
23+
target_directory: setuptools_wheel
24+
25+
build:
26+
number: 0
27+
28+
requirements:
29+
host:
30+
- python
31+
run:
32+
- python
33+
34+
tests:
35+
- python:
36+
imports:
37+
- certifi
38+
39+
about:
40+
license: ISC
41+
license_file: certifi/LICENSE
42+
summary: "Python package for providing Mozilla's CA Bundle."
43+
description: |
44+
Certifi is a curated collection of Root Certificates for validating the
45+
trustworthiness of SSL certificates while verifying the identity of TLS
46+
hosts.
47+
homepage: http://certifi.io/
48+
repository: https://github.com/certifi/python-certifi
49+
documentation: https://pypi.python.org/pypi/certifi
50+
51+
extra:
52+
recipe-maintainers:
53+
- jakirkham
54+
- pelson
55+
- sigmavirus24
56+
- ocefpaf
57+
- mingwandroid
58+
- jjhelmus
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
schema_version: 1
2+
3+
context:
4+
version: "2020.6.20"
5+
pip_version: 19.1.1
6+
setuptools_version: 41.0.1
7+
8+
package:
9+
name: certifi
10+
version: ${{ version }}
11+
12+
source:
13+
- url: https://pypi.io/packages/source/c/certifi/certifi-${{ version }}.tar.gz
14+
sha256: 5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3
15+
target_directory: certifi
16+
# bootstrap pip and setuptools to avoid circular dependency
17+
# but without losing metadata
18+
- url: https://pypi.io/packages/py2.py3/p/pip/pip-${{ pip_version }}-py2.py3-none-any.whl
19+
sha256: 993134f0475471b91452ca029d4390dc8f298ac63a712814f101cd1b6db46676
20+
target_directory: pip_wheel
21+
- url: https://pypi.io/packages/py2.py3/s/setuptools/setuptools-${{ setuptools_version }}-py2.py3-none-any.whl
22+
sha256: c7769ce668c7a333d84e17fe8b524b1c45e7ee9f7908ad0a73e1eda7e6a5aebf
23+
target_directory: setuptools_wheel
24+
25+
build:
26+
number: 0
27+
28+
requirements:
29+
build:
30+
- if: build_platform != host_platform
31+
then: python
32+
- if: build_platform != host_platform
33+
then: cross-python_${{ host_platform }}
34+
host:
35+
- python
36+
run:
37+
- python
38+
39+
tests:
40+
- python:
41+
imports:
42+
- certifi
43+
44+
about:
45+
license: ISC
46+
license_file: certifi/LICENSE
47+
summary: "Python package for providing Mozilla's CA Bundle."
48+
description: |
49+
Certifi is a curated collection of Root Certificates for validating the
50+
trustworthiness of SSL certificates while verifying the identity of TLS
51+
hosts.
52+
homepage: http://certifi.io/
53+
repository: https://github.com/certifi/python-certifi
54+
documentation: https://pypi.python.org/pypi/certifi
55+
56+
extra:
57+
recipe-maintainers:
58+
- jakirkham
59+
- pelson
60+
- sigmavirus24
61+
- ocefpaf
62+
- mingwandroid
63+
- jjhelmus

0 commit comments

Comments
 (0)