Skip to content

Commit

Permalink
Merge branch 'main' into pygit2
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Nov 11, 2024
2 parents a21d135 + ea45cd8 commit a6eb2e2
Show file tree
Hide file tree
Showing 10 changed files with 241 additions and 46 deletions.
13 changes: 10 additions & 3 deletions .authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
github: shadowwalkersb
- name: Matthew R. Becker
email: becker.mr@gmail.com
num_commits: 367
num_commits: 388
first_commit: 2020-01-07 17:44:33
github: beckermr
alternate_emails:
Expand Down Expand Up @@ -507,9 +507,11 @@
github: fhoehle
- name: Ben Mares
email: 15216687+maresb@users.noreply.github.com
num_commits: 2
num_commits: 4
first_commit: 2021-05-15 08:16:11
github: maresb
alternate_emails:
- services-git-throwaway1@tensorial.com
- name: Billy K. Poon
email: bkpoon@lbl.gov
num_commits: 15
Expand Down Expand Up @@ -537,7 +539,7 @@
github: nehaljwani
- name: H. Vetinari
email: h.vetinari@gmx.com
num_commits: 60
num_commits: 61
first_commit: 2021-11-14 02:53:10
- name: Benjamin Tovar
email: btovar@nd.edu
Expand Down Expand Up @@ -666,3 +668,8 @@
num_commits: 4
first_commit: 2024-10-28 03:45:27
github: Carreau
- name: Anton Tetov
email: anton@tetov.se
num_commits: 2
first_commit: 2024-11-10 09:28:45
github: tetov
5 changes: 3 additions & 2 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Christopher J. Wright <cjwright4242gh@gmail.com> christopher <cjwright4242@gmail
Christopher J. Wright <cjwright4242gh@gmail.com> Christopher J. 'CJ' Wright <cjwright4242@gmail.com>
Anthony Scopatz <scopatz@gmail.com>
Phil Elson <pelson.pub@gmail.com> pelson <pelson.pub@gmail.com>
Wolf Vollprecht <w.vollprecht@gmail.com>
H. Vetinari <h.vetinari@gmx.com>
Wolf Vollprecht <w.vollprecht@gmail.com>
Uwe L. Korn <uwe.korn@quantco.com> Uwe L. Korn <xhochy@users.noreply.github.com>
Filipe Fernandes <ocefpaf@gmail.com> Filipe <ocefpaf@gmail.com>
Filipe Fernandes <ocefpaf@gmail.com> ocefpaf <ocefpaf@gmail.com>
Expand Down Expand Up @@ -86,6 +86,7 @@ Jan Janßen <janssen@mpie.de> Jan Janßen <jan-janssen@users.noreply.github.com>
xoviat <xoviat@users.noreply.github.com>
Elmar Pruesse <epruesse@users.noreply.github.com>
Patrick Sodré <sodre@sodre.co>
Ben Mares <15216687+maresb@users.noreply.github.com> Ben Mares <services-git-throwaway1@tensorial.com>
David Hirschfeld <david.hirschfeld@stanwell.com>
Finn Womack <finnwomack@microsoft.com> Finn Womack <flan313@gmail.com>
M Bussonnier <bussonniermatthias@gmail.com>
Expand Down Expand Up @@ -113,11 +114,11 @@ Axel Huebl <axel.huebl@plasma.ninja>
Thomas Hopkins <thomashopkins000@gmail.com>
Hugo Slepicka <slepicka@slac.stanford.edu>
fhoehle <fhoehle@users.noreply.github.com>
Ben Mares <15216687+maresb@users.noreply.github.com>
Matthew W. Thompson <mattwthompson@protonmail.com>
conda-forge-admin <pelson.pub+conda-forge@gmail.com>
Klaus Zimmermann <klaus.zimmermann@smhi.se>
Dominic Davis-Foster <dominic@davis-foster.co.uk>
Anton Tetov <anton@tetov.se>
lorenz <looooo@users.noreply.github.com>
Tom Augspurger <tom.augspurger88@gmail.com>
Ryan May <rmay31@gmail.com>
Expand Down
5 changes: 3 additions & 2 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Authors are sorted by number of commits.
* Christopher J. Wright
* Anthony Scopatz
* Phil Elson
* Wolf Vollprecht
* H. Vetinari
* Wolf Vollprecht
* Uwe L. Korn
* Filipe Fernandes
* Dougal J. Sutherland
Expand Down Expand Up @@ -68,6 +68,7 @@ Authors are sorted by number of commits.
* xoviat
* Elmar Pruesse
* Patrick Sodré
* Ben Mares
* David Hirschfeld
* Finn Womack
* M Bussonnier
Expand Down Expand Up @@ -95,11 +96,11 @@ Authors are sorted by number of commits.
* Thomas Hopkins
* Hugo Slepicka
* fhoehle
* Ben Mares
* Matthew W. Thompson
* conda-forge-admin
* Klaus Zimmermann
* Dominic Davis-Foster
* Anton Tetov
* lorenz
* Tom Augspurger
* Ryan May
Expand Down
49 changes: 49 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,55 @@ conda-smithy Change Log

.. current developments
v3.44.3
====================

**Changed:**

* Changed the language in the ``noarch: python`` hint to add instructions on override w/ Jinja2/contexts and use softer language. (#2126)
* Add emojis to visually distinguish between hints and lints (#2128)

**Fixed:**

* Fixed a bug where v1 recipes were not properly linted for `noarch: python` hints. (#2126)
* Fixed linting of version 1 recipes where the version number was an integer (#2130)

**Authors:**

* Matthew R. Becker
* H. Vetinari
* Ben Mares
* Anton Tetov



v3.44.2
====================

**Fixed:**

* Fixed false positives in the ``noarch: python`` check. (#2123)

**Authors:**

* Matthew R. Becker



v3.44.1
====================

**Fixed:**

* Fixed ``noarch: python`` hint for v1 recipes. (#2119)
* Fixed ``noarch: python`` syntax to be more compatible. (#2122)

**Authors:**

* Matthew R. Becker



v3.44.0
====================

Expand Down
5 changes: 3 additions & 2 deletions conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ def run_conda_forge_specific(
test_reqs,
outputs_section,
noarch_value,
recipe_version,
hints,
)

Expand Down Expand Up @@ -706,13 +707,13 @@ def main(
all_pass = False
messages.append(
"\nFor **{}**:\n\n{}".format(
rel_path, "\n".join(f"* {lint}" for lint in lints)
rel_path, "\n".join(f"* {lint}" for lint in lints)
)
)
if hints:
messages.append(
"\nFor **{}**:\n\n{}".format(
rel_path, "\n".join(f"* {hint}" for hint in hints)
rel_path, "\n".join(f"* ℹ️ {hint}" for hint in hints)
)
)

Expand Down
19 changes: 11 additions & 8 deletions conda_smithy/linter/conda_recipe_v1_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,18 @@ def get_recipe_name(recipe_content: RecipeWithContext) -> str:
return package_name or recipe_name


def get_recipe_version(recipe_content: RecipeWithContext) -> str:
def get_recipe_version(recipe_content: RecipeWithContext) -> Optional[str]:
rendered_context_recipe = render_recipe_with_context(recipe_content)
package_version = (
rendered_context_recipe.get("package", {}).get("version", "").strip()
)
recipe_version = (
rendered_context_recipe.get("recipe", {}).get("version", "").strip()
)
return package_version or recipe_version
package_version = rendered_context_recipe.get("package", {}).get("version")
recipe_version = rendered_context_recipe.get("recipe", {}).get("version")

if not package_version and not recipe_version:
return None

if package_version:
return str(package_version).strip()

return str(recipe_version).strip()


def lint_recipe_name(
Expand Down
52 changes: 41 additions & 11 deletions conda_smithy/linter/hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,34 +227,64 @@ def hint_pip_no_build_backend(host_or_build_section, package_name, hints):

if not found_backend:
hints.append(
f"No valid build backend found for Python recipe for package `{package_name}` using `pip`. Python recipes using `pip` need to "
f"No valid build backend found for Python recipe for package `{package_name}` using `pip`. "
"Python recipes using `pip` need to "
"explicitly specify a build backend in the `host` section. "
"If your recipe has built with only `pip` in the `host` section in the past, you likely should "
"add `setuptools` to the `host` section of your recipe."
)


def hint_noarch_python_use_python_min(
host_reqs, run_reqs, test_reqs, outputs_section, noarch_value, hints
host_reqs,
run_reqs,
test_reqs,
outputs_section,
noarch_value,
recipe_version,
hints,
):
if noarch_value == "python" and not outputs_section:
hint = ""
for section_name, syntax, reqs in [
("host", "python {{ python_min }}.*", host_reqs),
("host", "python {{ python_min }}", host_reqs),
("run", "python >={{ python_min }}", run_reqs),
("test.requires", "python ={{ python_min }}", test_reqs),
("test.requires", "python {{ python_min }}", test_reqs),
]:
if recipe_version == 1:
syntax = syntax.replace(
"{{ python_min }}", "${{ python_min }}"
)
test_syntax = syntax
else:
test_syntax = syntax.replace("{{ python_min }}", "9999")

for req in reqs:
if (
req.strip().split()[0] == "python"
and req != "python"
and syntax in req
and test_syntax in req
):
break
else:
hints.append(
f"noarch: python recipes should almost always follow the syntax in "
f"our [documentation](https://conda-forge.org/docs/maintainer/knowledge_base/#noarch-python). "
f"For the `{section_name}` section of the recipe, you should almost always use `{syntax}` "
f"for the `python` entry. You may need to override the `python_min` variable if the package "
f"requires a newer Python version than the currently supported minimum version on `conda-forge`."
hint += (
f"\n - For the `{section_name}` section of the recipe, you should usually use `{syntax}` "
f"for the `python` entry."
)

if hint:
hint = (
(
"`noarch: python` recipes should usually follow the syntax in "
"our [documentation](https://conda-forge.org/docs/maintainer/knowledge_base/#noarch-python) "
"for specifying the Python version."
)
+ hint
+ (
"\n - If the package requires a newer Python version than the currently supported minimum "
"version on `conda-forge`, you can override the `python_min` variable by adding a "
"Jinja2 `set` statement at the top of your recipe (or using an equivalent `context` "
"variable for v1 recipes)."
)
)
hints.append(hint)
4 changes: 2 additions & 2 deletions conda_smithy/templates/run_win_build.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ call "%MICROMAMBA_EXE%" create --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefi
if !errorlevel! neq 0 exit /b !errorlevel!
{#- set "CONDA_PKGS_DIRS=" #}
echo Removing %MAMBA_ROOT_PREFIX%
del /S /Q "%MAMBA_ROOT_PREFIX%"
del /S /Q "%MICROMAMBA_TMPDIR%"
del /S /Q "%MAMBA_ROOT_PREFIX%" >nul
del /S /Q "%MICROMAMBA_TMPDIR%" >nul
{%- elif conda_install_tool == "pixi" %}
call :start_group "Provisioning base env with pixi"
echo Installing pixi
Expand Down
1 change: 1 addition & 0 deletions conda_smithy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def render_meta_yaml(text):
target_platform="linux-64",
build_platform="linux-64",
mpi="mpi",
python_min="9999", # use as a sentinel value for linting
)
)
mockos = MockOS()
Expand Down
Loading

0 comments on commit a6eb2e2

Please sign in to comment.