Repository: conda-forge/conda-smithy

Issue:
linter fails on rattler-build recipe
### Solution to issue cannot be found in the documentation.

- [x] I checked the documentation.

### Issue

I am trying to convert to use rattler-build in https://github.com/conda-forge/highspy-feedstock/pull/11 but the linter fails with an internal error. When running locally it seems to be confused by the new selector syntax:
```
> conda-smithy recipe-lint --conda-forge .
Traceback (most recent call last):
  File "C:\Code\apps\pixi\envs\conda\Scripts\conda-smithy-script.py", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "C:\Code\apps\pixi\envs\conda\Lib\site-packages\conda_smithy\cli.py", line 767, in main
    args.subcommand_func(args)
  File "C:\Code\apps\pixi\envs\conda\Lib\site-packages\conda_smithy\cli.py", line 645, in __call__
    lints, hints = linter.main(
                   ^^^^^^^^^^^^
  File "C:\Code\apps\pixi\envs\conda\Lib\site-packages\conda_smithy\lint_recipe.py", line 697, in main
    results, hints = lintify_meta_yaml(
                     ^^^^^^^^^^^^^^^^^^
  File "C:\Code\apps\pixi\envs\conda\Lib\site-packages\conda_smithy\lint_recipe.py", line 313, in lintify_meta_yaml
    lint_single_space_in_pinned_requirements(requirements_section, lints)
  File "C:\Code\apps\pixi\envs\conda\Lib\site-packages\conda_smithy\linter\lints.py", line 436, in lint_single_space_in_pinned_requirements
    req, _, _ = requirement.partition("#")
                ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CommentedMap' object has no attribute 'partition'
```
This is the requirements from the recipe
```yaml
requirements:
  build:
    - if: build_platform != target_platform
      then: python
    - if: build_platform != target_platform
      then: cross-python_${{ target_platform }}
    - if: build_platform != target_platform
      then: numpy
    - ${{ compiler('c') }}
    - ${{ stdlib('c') }}
    - ${{ compiler('cxx') }}
    - cmake
    - if: unix
      then: make
  host:
    - python
    - pip
    - scikit-build-core
    - numpy
    - pybind11
  run:
    - python
    - numpy
  ignore_run_exports:
    from_package:
      - numpy
```

### Installed packages

```shell
The conda environment has 247 packages:
Package                     Version                Build               Size
_openmp_mutex               4.5                    2_gnu               48.3 KiB
anyio                       4.6.2.post1            pyhd8ed1ab_0        107.3 KiB
archspec                    0.2.3                  pyhd8ed1ab_0        47.6 KiB
attrs                       24.2.0                 pyh71513ae_0        54.7 KiB
backports                   1.0                    pyhd8ed1ab_4        6.8 KiB
backports.strenum           1.2.8                  pyhd8ed1ab_0        13.2 KiB
backports.tarfile           1.2.0                  pyhd8ed1ab_0        32 KiB
beautifulsoup4              4.12.3                 pyha770c72_0        115.4 KiB
blinker                     1.9.0                  pyhff2d567_0        13.6 KiB
boltons                     24.0.0                 pyhd8ed1ab_0        290.9 KiB
boolean.py                  4.0                    pyhd8ed1ab_0        28 KiB
brotli                      1.1.0                  h2466b09_2          19.2 KiB
brotli-bin                  1.1.0                  h2466b09_2          20.3 KiB
brotli-python               1.1.0                  py312h275cf98_2     314.3 KiB
bzip2                       1.0.8                  h2466b09_7          53.6 KiB
ca-certificates             2024.8.30              h56e8100_0          155.1 KiB
cairo                       1.18.0                 h32b962e_3          1.4 MiB
certifi                     2024.8.30              pyhd8ed1ab_0        159.9 KiB
cffi                        1.17.1                 py312h4389bb4_0     281.4 KiB
chardet                     5.2.0                  py312h2e8e312_2     279.6 KiB
charset-normalizer          3.4.0                  pyhd8ed1ab_0        46.2 KiB
cirun                       0.30                   pyhd8ed1ab_0        14.6 KiB
click                       8.1.7                  win_pyh7428d3b_0    83.1 KiB
colorama                    0.4.6                  pyhd8ed1ab_0        24.6 KiB
conda                       24.9.2                 py312h2e8e312_0     1.1 MiB
conda-build                 24.9.0                 py312h2e8e312_0     740.2 KiB
conda-forge-pinning         2024.11.21.5.29.27     hd8ed1ab_0          51.5 KiB
conda-index                 0.5.0                  pyhd8ed1ab_0        179.8 KiB
conda-libmamba-solver       24.9.0                 pyhd8ed1ab_0        40.6 KiB
conda-package-handling      2.4.0                  pyh7900ff3_0        251.7 KiB
conda-package-streaming     0.11.0                 pyhd8ed1ab_0        20.1 KiB
conda-recipe-manager        0.3.4                  pyhd8ed1ab_0        191.3 KiB
conda-smithy                3.44.7                 win_pyhef2d1d4_0    163.8 KiB
conda-souschef              2.2.3                  pyhd8ed1ab_0        17.7 KiB
contourpy                   1.3.1                  py312hd5eb7cc_0     211.4 KiB
cryptography                43.0.3                 py312h9500af3_0     1.2 MiB
cycler                      0.12.1                 pyhd8ed1ab_0        13.1 KiB
deprecated                  1.2.15                 pyhff2d567_0        13.8 KiB
distlib                     0.3.9                  pyhd8ed1ab_0        269.7 KiB
distro                      1.9.0                  pyhd8ed1ab_0        41.1 KiB
editables                   0.5                    pyhd8ed1ab_0        10.7 KiB
exceptiongroup              1.2.2                  pyhd8ed1ab_0        19.9 KiB
filelock                    3.16.1                 pyhd8ed1ab_0        17 KiB
fmt                         11.0.2                 h7f575de_0          184.4 KiB
font-ttf-dejavu-sans-mono   2.37                   hab24e00_0          388.1 KiB
font-ttf-inconsolata        3.0                    h77eed37_0          94.3 KiB
font-ttf-source-code-pro    2.38                   h77eed37_0          684.4 KiB
font-ttf-ubuntu             0.83                   h77eed37_3          1.5 MiB
fontconfig                  2.15.0                 h765892d_1          187.8 KiB
fonts-conda-ecosystem       1                      0                   3.6 KiB
fonts-conda-forge           1                      0                   4 KiB
fonttools                   4.55.0                 py312h31fea79_0     2.3 MiB
freetype                    2.12.1                 hdaf720e_2          498.3 KiB
fribidi                     1.0.10                 h8d14728_0          63.1 KiB
frozendict                  2.4.6                  py312h4389bb4_0     30.4 KiB
getopt-win32                0.1                    hcfcfb64_1          21.4 KiB
gitdb                       4.0.11                 pyhd8ed1ab_0        51.6 KiB
gitpython                   3.1.43                 pyhd8ed1ab_0        153.2 KiB
graphite2                   1.3.13                 h63175ca_1003       93.2 KiB
graphviz                    12.0.0                 hb01754f_0          1.1 MiB
grayskull                   2.7.3                  pyhd8ed1ab_0        88.7 KiB
gts                         0.7.6                  h6b5321d_4          184.3 KiB
h11                         0.14.0                 pyhd8ed1ab_0        47.1 KiB
h2                          4.1.0                  pyhd8ed1ab_0        45.7 KiB
harfbuzz                    9.0.0                  h2bedf89_1          1 MiB
hatch                       1.13.0                 pyhd8ed1ab_0        173 KiB
hatchling                   1.26.3                 pypyhff2d567_0      55.5 KiB
hpack                       4.0.0                  pyh9f0ad1d_0        24.7 KiB
httpcore                    1.0.7                  pyh29332c3_1        47.8 KiB
httpx                       0.27.2                 pyhd8ed1ab_0        63.6 KiB
hyperframe                  6.0.1                  pyhd8ed1ab_0        14.3 KiB
hyperlink                   21.0.0                 pyhd3deb0d_0        71 KiB
icu                         75.1                   he0c23c2_0          13.9 MiB
idna                        3.10                   pyhd8ed1ab_0        48.7 KiB
importlib-metadata          8.5.0                  pyha770c72_0        28 KiB
importlib_resources         6.4.5                  pyhd8ed1ab_0        32 KiB
intel-openmp                2024.2.1               h57928b3_1083       1.8 MiB
isodate                     0.7.2                  pyhd8ed1ab_0        23.3 KiB
jaraco.classes              3.4.0                  pyhd8ed1ab_1        11.9 KiB
jaraco.context              5.3.0                  pyhd8ed1ab_1        12.2 KiB
jaraco.functools            4.0.0                  pyhd8ed1ab_0        14.8 KiB
jinja2                      3.1.4                  pyhd8ed1ab_0        109 KiB
jsonpatch                   1.33                   pyhd8ed1ab_0        17 KiB
jsonpointer                 3.0.0                  py312h2e8e312_1     41.2 KiB
jsonschema                  4.23.0                 pyhd8ed1ab_0        72.6 KiB
jsonschema-specifications   2024.10.1              pyhd8ed1ab_0        15.8 KiB
keyring                     25.5.0                 pyh7428d3b_0        36.5 KiB
kiwisolver                  1.4.7                  py312hd5eb7cc_0     54.1 KiB
krb5                        1.21.3                 hdf4eb48_0          695.3 KiB
lcms2                       2.16                   h67d730c_0          495.7 KiB
lerc                        4.0.0                  h63175ca_0          189.8 KiB
libarchive                  3.7.4                  haf234dc_0          935.2 KiB
libblas                     3.9.0                  25_win64_mkl        3.6 MiB
libbrotlicommon             1.1.0                  h2466b09_2          68.9 KiB
libbrotlidec                1.1.0                  h2466b09_2          31.9 KiB
libbrotlienc                1.1.0                  h2466b09_2          240.2 KiB
libcblas                    3.9.0                  25_win64_mkl        3.6 MiB
libcurl                     8.10.1                 h1ee3ff0_0          334.4 KiB
libdeflate                  1.22                   h2466b09_0          151.9 KiB
libexpat                    2.6.4                  he0c23c2_0          135.8 KiB
libffi                      3.4.2                  h8ffe710_5          41.1 KiB
libgcc                      14.2.0                 h1383e82_1          650.8 KiB
libgd                       2.3.3                  h085315d_10         336.2 KiB
libglib                     2.82.2                 h7025463_0          3.6 MiB
libgomp                     14.2.0                 h1383e82_1          512 KiB
libiconv                    1.17                   hcfcfb64_2          621.2 KiB
libintl                     0.22.5                 h5728263_3          93.3 KiB
libjpeg-turbo               3.0.0                  hcfcfb64_1          803.7 KiB
liblapack                   3.9.0                  25_win64_mkl        3.6 MiB
liblief                     0.14.1                 he0c23c2_2          1.5 MiB
libmamba                    1.5.10                 h81425b0_1          3.4 MiB
libmambapy                  1.5.10                 py312h643a1bd_1     452.2 KiB
libpng                      1.6.44                 h3ca93ac_0          340.8 KiB
libsodium                   1.0.20                 hc70643c_0          197.6 KiB
libsolv                     0.7.30                 hbb528cf_0          419.1 KiB
libsqlite                   3.47.0                 h2466b09_1          871.3 KiB
libssh2                     1.11.0                 h7dfc565_0          260.6 KiB
libtiff                     4.7.0                  hfc51747_1          955.9 KiB
libwebp-base                1.4.0                  hcfcfb64_0          267.9 KiB
libwinpthread               12.0.0.r4.gg4f2fc60ca  h57928b3_8          34.6 KiB
libxcb                      1.17.0                 h0e4246c_0          1.2 MiB
libxml2                     2.13.5                 h442d1da_0          1.4 MiB
libzlib                     1.3.1                  h2466b09_2          54.2 KiB
license-expression          30.3.1                 pyhd8ed1ab_0        95.5 KiB
lz4-c                       1.9.4                  hcfcfb64_0          131.1 KiB
lzo                         2.10                   hcfcfb64_1001       139.4 KiB
m2-conda-epoch              20230914               0_x86_64            6.8 KiB
m2-msys2-runtime            3.4.9.1                hd8ed1ab_4          1.8 MiB
m2-patch                    2.7.6.2                hd8ed1ab_4          129.1 KiB
markdown-it-py              3.0.0                  pyhd8ed1ab_0        62.8 KiB
markupsafe                  3.0.2                  py312h31fea79_0     26.7 KiB
matplotlib-base             3.9.2                  py312h90004f6_2     7.4 MiB
mdurl                       0.1.2                  pyhd8ed1ab_0        14.3 KiB
menuinst                    2.2.0                  py312h275cf98_0     129.9 KiB
mkl                         2024.2.2               h66d3029_14         98.2 MiB
more-itertools              10.5.0                 pyhd8ed1ab_0        56 KiB
msrest                      0.6.21                 pyh44b312d_0        50 KiB
munkres                     1.1.4                  pyh9f0ad1d_0        12.2 KiB
networkx                    3.4.2                  pyh267e887_2        1.2 MiB
numpy                       2.1.3                  py312h49bc9c5_0     6.6 MiB
oauthlib                    3.2.2                  pyhd8ed1ab_0        89.8 KiB
openjpeg                    2.5.2                  h3d672ee_0          232.4 KiB
openssl                     3.4.0                  h2466b09_0          8.1 MiB
packaging                   24.2                   pyhff2d567_1        59 KiB
pango                       1.54.0                 hbb871f6_2          440 KiB
pathspec                    0.12.1                 pyhd8ed1ab_0        40.2 KiB
pcre2                       10.44                  h3d7b363_2          801.6 KiB
pexpect                     4.9.0                  pyhd8ed1ab_0        52.3 KiB
pillow                      11.0.0                 py312ha41cd45_0     39.3 MiB
pip                         24.3.1                 pyh8b19718_0        1.2 MiB
pixman                      0.43.4                 h63175ca_0          451 KiB
pkginfo                     1.11.2                 pyhd8ed1ab_0        29 KiB
pkgutil-resolve-name        1.3.10                 pyhd8ed1ab_1        10.5 KiB
platformdirs                4.3.6                  pyhd8ed1ab_0        20.1 KiB
pluggy                      1.5.0                  pyhd8ed1ab_0        23.3 KiB
progressbar2                4.5.0                  pyhd8ed1ab_0        53.1 KiB
psutil                      6.1.0                  py312h4389bb4_0     491.4 KiB
pthread-stubs               0.4                    h0e40799_1002       9.2 KiB
ptyprocess                  0.7.0                  pyhd3deb0d_0        16.2 KiB
py-lief                     0.14.1                 py312h275cf98_2     543.4 KiB
pybind11-abi                4                      hd8ed1ab_3          9.7 KiB
pycosat                     0.6.6                  py312he70551f_0     75.8 KiB
pycparser                   2.22                   pyhd8ed1ab_0        102.6 KiB
pycryptodome                3.21.0                 py312h4389bb4_0     1.6 MiB
pygithub                    2.5.0                  pyhd8ed1ab_0        150.5 KiB
pygments                    2.18.0                 pyhd8ed1ab_0        858.7 KiB
pygraphviz                  1.14                   py312h4c6beb1_0     144.3 KiB
pyjwt                       2.10.0                 pyhff2d567_0        24.5 KiB
pynacl                      1.5.0                  py312hdb89ce9_4     1.1 MiB
pyparsing                   3.2.0                  pyhd8ed1ab_1        90.3 KiB
pysocks                     1.7.1                  pyh0701188_6        18.9 KiB
python                      3.12.7                 hce54a09_0_cpython  15.2 MiB
python-dateutil             2.9.0.post0            pyhff2d567_0        216.7 KiB
python-libarchive-c         5.1                    py312h2e8e312_1     47.7 KiB
python-utils                3.9.0                  pyhff2d567_0        31.7 KiB
python_abi                  3.12                   5_cp312             6.6 KiB
pytz                        2024.2                 pyhd8ed1ab_0        182.6 KiB
pywin32-ctypes              0.2.3                  py312h2e8e312_1     56.1 KiB
pyyaml                      6.0.2                  py312h4389bb4_1     177 KiB
qhull                       2020.2                 hc790b64_5          1.3 MiB
rapidfuzz                   3.10.1                 py312h275cf98_0     1 MiB
rattler-build               0.31.0                 h49672d7_1          8.3 MiB
rattler-build-conda-compat  1.2.2                  pyhd8ed1ab_0        33.7 KiB
referencing                 0.35.1                 pyhd8ed1ab_0        41.2 KiB
reproc                      14.2.5.post0           h2466b09_0          36.2 KiB
reproc-cpp                  14.2.5.post0           he0c23c2_0          29.4 KiB
requests                    2.32.3                 pyhd8ed1ab_0        57.4 KiB
requests-oauthlib           2.0.0                  pyhd8ed1ab_0        25.1 KiB
rich                        13.9.4                 pyhd8ed1ab_0        181.1 KiB
ripgrep                     14.1.1                 ha073cba_0          1.5 MiB
rpds-py                     0.21.0                 py312h2615798_0     206 KiB
ruamel.yaml                 0.18.6                 py312h4389bb4_1     260.9 KiB
ruamel.yaml.clib            0.2.8                  py312h4389bb4_1     106.4 KiB
ruamel.yaml.jinja2          0.2.7                  pyhd8ed1ab_0        11.1 KiB
scrypt                      0.8.27                 py312h05cb7a8_0     50 KiB
semver                      3.0.2                  pyhd8ed1ab_0        20.4 KiB
setuptools                  75.5.0                 pyhff2d567_0        754.4 KiB
shellingham                 1.5.4                  pyhd8ed1ab_0        14.2 KiB
six                         1.16.0                 pyh6c4a22f_0        13.9 KiB
smmap                       5.0.0                  pyhd8ed1ab_0        22 KiB
sniffio                     1.3.1                  pyhd8ed1ab_0        14.7 KiB
soupsieve                   2.5                    pyhd8ed1ab_1        35.9 KiB
stdlib-list                 0.11.0                 pyhd8ed1ab_0        25.6 KiB
tbb                         2021.7.0               h91493d7_0          174.4 KiB
tk                          8.6.13                 h5226925_1          3.3 MiB
tomli                       2.1.0                  pyhff2d567_0        18.3 KiB
tomli-w                     1.1.0                  pyhd8ed1ab_0        12 KiB
tomlkit                     0.13.2                 pyha770c72_0        36.4 KiB
toolz                       1.0.0                  pyhd8ed1ab_0        51.4 KiB
tqdm                        4.67.0                 pyhd8ed1ab_0        87.3 KiB
trove-classifiers           2024.10.21.16          pyhd8ed1ab_0        18 KiB
truststore                  0.10.0                 pyhd8ed1ab_0        21.3 KiB
typer                       0.13.1                 pyhd8ed1ab_0        54.1 KiB
typer-slim                  0.13.1                 pyhff2d567_0        42.4 KiB
typer-slim-standard         0.13.1                 hd8ed1ab_0          47.6 KiB
typing-extensions           4.12.2                 hd8ed1ab_0          9.9 KiB
typing_extensions           4.12.2                 pyha770c72_0        39 KiB
tzdata                      2024b                  hc8b5060_0          119.5 KiB
ucrt                        10.0.22621.0           h57928b3_1          546.6 KiB
unicodedata2                15.1.0                 py312h4389bb4_1     356.9 KiB
urllib3                     2.2.3                  pyhd8ed1ab_0        95.8 KiB
userpath                    1.7.0                  pyhd8ed1ab_0        17 KiB
uv                          0.5.4                  ha08ef0e_0          10.3 MiB
vc                          14.3                   ha32ba9b_23         17.1 KiB
vc14_runtime                14.42.34433            he29a5d6_23         736.6 KiB
virtualenv                  20.27.1                pyhd8ed1ab_0        2.8 MiB
vs2015_runtime              14.42.34433            hdffcdeb_23         17.2 KiB
vsts-python-api             0.1.25                 pyhd8ed1ab_1        628.7 KiB
wheel                       0.45.0                 pyhd8ed1ab_0        61.3 KiB
win_inet_pton               1.1.0                  pyh7428d3b_7        9.4 KiB
wrapt                       1.16.0                 py312h4389bb4_1     59.4 KiB
xorg-libice                 1.1.1                  h0e40799_1          229.2 KiB
xorg-libsm                  1.2.4                  h0e40799_1          94.6 KiB
xorg-libx11                 1.8.10                 hf48077a_0          929.8 KiB
xorg-libxau                 1.0.11                 h0e40799_1          105.4 KiB
xorg-libxdmcp               1.1.5                  h0e40799_0          68.3 KiB
xorg-libxext                1.3.6                  h0e40799_0          278 KiB
xorg-libxpm                 3.5.17                 h0e40799_1          230.6 KiB
xorg-libxt                  1.3.1                  h0e40799_0          897.1 KiB
xorg-xorgproto              2024.1                 h0e40799_1          555.8 KiB
xz                          5.2.6                  h8d14728_0          212.7 KiB
yaml                        0.2.5                  h8ffe710_2          61.8 KiB
yaml-cpp                    0.8.0                  h63175ca_0          133.4 KiB
zipp                        3.21.0                 pyhd8ed1ab_0        21.2 KiB
zlib                        1.3.1                  h2466b09_2          104.9 KiB
zstandard                   0.23.0                 py312h7606c53_1     313.1 KiB
zstd                        1.5.6                  h0ea2cb4_0          341 KiB
Package                     Version                Build               Size

Exposes:
conda-recipe-manager, conda-develop, conda-render, conda-smithy, feedstocks, activate, conda-inspect, conda-debug, grayskull, conda-env, conda-metapackage, conda, conda-grayskull, conda-greyskull, conda-build, conda-skeleton, crm, conda-convert, greyskull
Channels:
conda-forge
```

### Environment info

```shell
active environment : base
    active env location : C:\Code\apps\pixi\envs\conda
       user config file : C:\Users\aen\.condarc
 populated config files : C:\Users\aen\.condarc
          conda version : 24.9.2
    conda-build version : 24.9.0
         python version : 3.12.7.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=x86_64_v3
                          __conda=24.9.2=0
                          __win=0=0
       base environment : C:\Code\apps\pixi\envs\conda  (read only)
      conda av data dir : C:\Code\apps\pixi\envs\conda\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/nodefaults/win-64
                          https://conda.anaconda.org/nodefaults/noarch
          package cache : C:\Code\apps\pixi\envs\conda\pkgs
                          C:\Users\aen\.conda\pkgs
                          C:\Users\aen\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\aen\.conda\envs
                          C:\Code\apps\pixi\envs\conda\envs
                          C:\Users\aen\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/24.9.2 requests/2.32.3 CPython/3.12.7 Windows/10 Windows/10.0.19045 solver/libmamba conda-libmamba-solver/24.9.0 libmambapy/1.5.10
          administrator : False
             netrc file : None
           offline mode : False
```

Discussion:

Patch:
diff --git a/conda_smithy/lint_recipe.py b/conda_smithy/lint_recipe.py
index be7a9ead..67dbdb90 100644
--- a/conda_smithy/lint_recipe.py
+++ b/conda_smithy/lint_recipe.py
@@ -310,7 +310,9 @@ def lintify_meta_yaml(
     lint_legacy_usage_of_compilers(build_requirements, lints)
 
     # 22: Single space in pinned requirements
-    lint_single_space_in_pinned_requirements(requirements_section, lints)
+    lint_single_space_in_pinned_requirements(
+        requirements_section, lints, recipe_version
+    )
 
     # 23: non noarch builds shouldn't use version constraints on python and r-base
     lint_non_noarch_builds(
diff --git a/conda_smithy/linter/lints.py b/conda_smithy/linter/lints.py
index 02966829..a81784ce 100644
--- a/conda_smithy/linter/lints.py
+++ b/conda_smithy/linter/lints.py
@@ -428,6 +428,12 @@ def lint_single_space_in_pinned_requirements(
     recipe_version: int = 0,
 ):
     for section, requirements in requirements_section.items():
+        if (
+            recipe_version == 1
+            and section == "ignore_run_exports"
+            and requirements
+        ):
+            requirements = requirements[0].get("from_package", [])
         for requirement in requirements or []:
             if recipe_version == 1:
                 req = requirement
diff --git a/news/2157-bugfix-ignore_run_exports-for-v1-recipes.rst b/news/2157-bugfix-ignore_run_exports-for-v1-recipes.rst
new file mode 100644
index 00000000..edfbf695
--- /dev/null
+++ b/news/2157-bugfix-ignore_run_exports-for-v1-recipes.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news item>
+
+**Fixed:**
+
+* Fixed a bug that caused the linter to fail when a v1 recipe had the `ignore_run_exports` key. (#2157, #2153)
+
+**Security:**
+
+* <news item>


Test patch:
diff --git a/tests/recipes/v1_recipes/recipe-ignore_run_exports-no-lint.yaml b/tests/recipes/v1_recipes/recipe-ignore_run_exports-no-lint.yaml
new file mode 100644
index 00000000..54d6806b
--- /dev/null
+++ b/tests/recipes/v1_recipes/recipe-ignore_run_exports-no-lint.yaml
@@ -0,0 +1,32 @@
+package:
+  name: foo
+  version: 1.2.3
+
+source:
+  url: https://example.com/foo.tar.gz
+  sha256: b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
+
+build:
+  number: 0
+
+requirements:
+  host:
+    - has_run_export
+  ignore_run_exports:
+    from_package:
+    - has_run_export
+
+tests:
+  - script:
+      - echo "Hello, world!"
+
+about:
+  license: BSD-3-Clause
+  license_file: LICENSE.txt
+  homepage: https://example.com/foo
+  summary: A package that does foo.
+
+extra:
+  recipe-maintainers:
+    - Alice
+    - Bob
diff --git a/tests/test_lint_recipe.py b/tests/test_lint_recipe.py
index eaeb13bd..bb92da5f 100644
--- a/tests/test_lint_recipe.py
+++ b/tests/test_lint_recipe.py
@@ -2688,6 +2688,14 @@ def test_v1_recipes():
         assert not lints
 
 
+def test_v1_recipes_ignore_run_exports():
+    with get_recipe_in_dir(
+        "v1_recipes/recipe-ignore_run_exports-no-lint.yaml"
+    ) as recipe_dir:
+        lints, hints = linter.main(str(recipe_dir), return_hints=True)
+        assert not lints
+
+
 def test_v1_no_test():
     with get_recipe_in_dir("v1_recipes/recipe-no-tests.yaml") as recipe_dir:
         lints, hints = linter.main(str(recipe_dir), return_hints=True)