Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markupsafe 2.1.0 build 0 breaks jinja2<3 #29

Closed
1 task done
saraedum opened this issue Jun 3, 2022 · 12 comments · Fixed by conda-forge/conda-forge-repodata-patches-feedstock#283
Closed
1 task done
Labels

Comments

@saraedum
Copy link
Member

saraedum commented Jun 3, 2022

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

markupsafe 2.1.0 bulid 1 added a run_constraint for jinja2 requiring it to be >=3.

However, build 0 does not have that constraint, so one can sometimes get broken environments, as reported by @davidaulicino for a sagelib=9.2 environment (reported outside of github.)

A short reproducer is the following:

mamba create -n deleteme jinja2=2.10.3 markupsafe=2.1
conda activate deleteme
python -c 'import jinja2'
ImportError: cannot import name 'soft_unicode' from 'markupsafe'

Should the build 0 be marked as broken? (I don't think it's worth to update the metadata here since the builds are otherwise identical.)

Installed packages

_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2022.5.18.1          ha878542_0    conda-forge
jinja2                    2.10.3                     py_0
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 12.1.0              h8d9b700_16    conda-forge
libgomp                   12.1.0              h8d9b700_16    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libzlib                   1.2.12               h166bdaf_0    conda-forge
markupsafe                2.1.0           py310h5764c6d_0    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
openssl                   3.0.3                h166bdaf_0    conda-forge
pip                       22.1.2             pyhd8ed1ab_0    conda-forge
python                    3.10.4          h2660328_0_cpython    conda-forge
python_abi                3.10                    2_cp310    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                62.3.2          py310hff52083_0    conda-forge
sqlite                    3.38.5               h4ff8645_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.12               h166bdaf_0    conda-forge

Environment info

active environment : deleteme
    active env location : /tmp/ruth/micromamba/envs/deleteme
            shell level : 1
       user config file : /home/ruth/.condarc
 populated config files : /home/ruth/.condarc
          conda version : 4.12.0
    conda-build version : not installed
         python version : 3.10.4.final.0
       virtual packages : __linux=4.19.0=0
                          __glibc=2.28=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /tmp/ruth/micromamba  (writable)
      conda av data dir : /tmp/ruth/micromamba/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /tmp/ruth/micromamba/pkgs
                          /home/ruth/.conda/pkgs
       envs directories : /tmp/ruth/micromamba/envs
                          /home/ruth/.conda/envs
               platform : linux-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.10.4 Linux/4.19.0-20-amd64 debian/10 glibc/2.28
                UID:GID : 5012:500
             netrc file : None
           offline mode : False
@saraedum saraedum added the bug label Jun 3, 2022
@saraedum
Copy link
Member Author

saraedum commented Jun 3, 2022

(I can open the PR to mark this as broken, if a maintainer agrees.)

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

I'm not a maintainer but I agree, this would be really helpful!

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

@saraedum, hmm, I don't think the problem is here actually. It's that jinja2 < 3 shouldn't be using markupsafe >=2.1.0. So the fix would be to try to patch the problematic jinja2 < 3. I kind of thought this had been done, actually.

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

By me, actually:
conda-forge/conda-forge-repodata-patches-feedstock#238
I don't know why some cases are sneaking through. But @saraedum if you can figure out why, I can update the patch.

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

@saraedum, it seems like your jinja2 isn't actually coming from conda-forge. No channel is listed so it could be defaults or pypi or your own installation or ???

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

@saraedum, I see when I do:

mamba search --info jinja2=2.10.3

that on the main channel there has been no patching to make sure that markupsafe >=0.23,<2 as there has been on conda-forge:

jinja2 2.10.3 py_0
------------------
file name   : jinja2-2.10.3-py_0.conda
name        : jinja2
version     : 2.10.3
build       : py_0
build number: 0
size        : 101 KB
license     : 3-Clause BSD
subdir      : noarch
url         : https://repo.anaconda.com/pkgs/main/noarch/jinja2-2.10.3-py_0.conda
md5         : d1ee8fe7106f93ac20f6714b7f3270bc
timestamp   : 2019-10-07 15:40:05 UTC
dependencies: 
  - markupsafe >=0.23
  - python
  - setuptools

Looks like an issue that will need to be addressed with the Anaconda folks rather than here.

I did notice that I missed patching one file in conda-forge/conda-forge-repodata-patches-feedstock#238 so I'm going to put in a fix.

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

@saraedum
Copy link
Member Author

saraedum commented Jun 4, 2022

Thanks a lot for looking into this @xylar. And true, I had missed the main channel in my case.

Not sure how complicated it will be to get main patched. Maybe the easier solution here would then be to patch/mark broken markupsafe's build 0?

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

My understanding is that the missing feature that broke junja2 was removed on purpose in markupsafe. So markupsafe isn't broken at all.

@saraedum
Copy link
Member Author

saraedum commented Jun 4, 2022

Sorry, I did not mean to say that markupsafe is broken. Rather the build 0 is broken because it is missing a run constraint. Without it jinja on main breaks. Since build 1 and build 0 are identical apart from the metadata, I don't think we need build 0. If we mark it as broken, then it won't be considered anymore and can't break main/jinja2.
Does that make sense?

@saraedum
Copy link
Member Author

saraedum commented Jun 4, 2022

(We can also patch the metadata for build 0 so it contains that constraint. I don't think it makes a difference really.)

@xylar
Copy link
Contributor

xylar commented Jun 4, 2022

I see. build 0 didn't have the run_constrained to keep jinja2 < 3 from being installed.

Yes, I think you could get build 0 marked as broken. Or you might be able to get the run_constrained added in https://github.com/conda-forge/conda-forge-repodata-patches-feedstock/. I'm not sure what is possible and what isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants