Skip to content

Commit 48d15ea

Browse files
committed
Linting.
1 parent 0c95834 commit 48d15ea

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

repo_helper/conda.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,12 @@ def make_recipe(repo_dir: PathLike, recipe_file: PathLike) -> None:
203203
config["conda_channels"],
204204
)
205205

206-
numpy_versions = [v.specifier for v in all_requirements if v == "numpy"]
206+
requirements_entries = [f" - {req}" for req in all_requirements if req and req != "numpy"]
207207

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-
)
208+
if [v.specifier for v in all_requirements if v == "numpy"]:
209+
requirements_entries += " - numpy x.x"
213210

214-
if numpy_versions:
215-
requirements_block += "\n - numpy x.x"
211+
requirements_block = '\n'.join(requirements_entries)
216212

217213
templates = jinja2.Environment( # nosec: B701
218214
loader=jinja2.FileSystemLoader(str(template_dir)),

repo_helper/utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,15 +452,21 @@ def brace(string: str) -> str:
452452

453453

454454
def set_gh_actions_versions(py_versions: Iterable[str]) -> List[str]:
455+
"""
456+
Convert development Python versions into the appropriate versions for GitHub Actions.
457+
458+
:param py_versions:
459+
"""
460+
455461
py_versions = list(py_versions)
456462

463+
# Keep in sync with https://github.com/actions/python-versions/releases
464+
457465
if "3.10-dev" in py_versions:
458466
py_versions.remove("3.10-dev")
459-
# Keep in sync with https://github.com/actions/python-versions/releases
460467
py_versions.append("3.10.0-alpha.3")
461468
if "3.10" in py_versions:
462469
py_versions.remove("3.10")
463-
# Keep in sync with https://github.com/actions/python-versions/releases
464470
py_versions.append("3.10.0-alpha.3")
465471

466472
return py_versions

0 commit comments

Comments
 (0)