Skip to content

Commit d6d830a

Browse files
committed
Disable pip version check when building conda packages, and work around numpy fmod bug when compiling conda requirements for packages requiring numpy.
1 parent 900ffb5 commit d6d830a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

repo_helper/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ def build_conda(self) -> str:
678678
"--no-compile",
679679
"--no-warn-script-location",
680680
"--no-warn-conflicts",
681+
"--disable-pip-version-check",
681682
]
682683
process = Popen(command, stdout=PIPE)
683684
(output, err) = process.communicate()

repo_helper/conda.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def compile_requirements(
121121
if requirement.url: # pragma: no cover
122122
continue
123123

124+
# TODO: add the extra requirements
124125
if requirement.extras:
125126
requirement.extras = set()
126127
if requirement.marker:
@@ -202,7 +203,16 @@ def make_recipe(repo_dir: PathLike, recipe_file: PathLike) -> None:
202203
config["conda_channels"],
203204
)
204205

205-
requirements_block = '\n'.join(f" - {req}" for req in all_requirements if req)
206+
numpy_versions = [v.specifier for v in all_requirements if v == "numpy"]
207+
208+
requirements_block = '\n'.join([
209+
f" - {req}"
210+
for req in filter(lambda x: x != "numpy", all_requirements)
211+
if req and req != "numpy"]
212+
)
213+
214+
if numpy_versions:
215+
requirements_block += "\n - numpy x.x"
206216

207217
templates = jinja2.Environment( # nosec: B701
208218
loader=jinja2.FileSystemLoader(str(template_dir)),
@@ -218,7 +228,7 @@ def make_recipe(repo_dir: PathLike, recipe_file: PathLike) -> None:
218228
# - "*/templates/*.py" # These should not (and cannot) be compiled
219229

220230

221-
#: Mapping of normalised names to names on conda, if they differ for some reason
231+
#: Mapping of normalised names to names on conda, if they differ for some reason.
222232
alias_mapping = {
223233
"ruamel-yaml": "ruamel.yaml",
224234
}

0 commit comments

Comments
 (0)