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

Use the latest pandoc-latex-environment version in pandoc/extra/requirements.txt #220

Closed
princefishthrower opened this issue Dec 12, 2023 · 9 comments · Fixed by #225
Closed

Comments

@princefishthrower
Copy link

Hi all, my team and I discovered that the pandoc/extra image is using a very old (2 years+) version of pandoc-latex-environment, looks like the 1.1.0.0 version:

pandoc-latex-environment==1.1

The latest of pandoc-latex-environment appears to be 1.1.6.2 (from July 2023)... I think the fix here is to simply modify the == to >=

@daamien
Copy link
Collaborator

daamien commented May 4, 2024

yes what was actually meant is pandoc-latex-environment==1.1.* : we want to freeze the major version and still get the minor patches.

@daamien
Copy link
Collaborator

daamien commented May 4, 2024

@tarleb : Seems like moving to pipx broke something. The filter is not found in the latest image

I believe the problem comes form this commit:
fe78ac3

docker run --rm --volume "$(pwd):/data" pandoc/extra README.md --filter pandoc-latex-environment                   
Error running filter pandoc-latex-environment: 
Could not find executable pandoc-latex-environment

Version 3.1 works fine

docker run --rm --volume "$(pwd):/data" pandoc/extra:3.1 README.md --filter pandoc-latex-environment

@tarleb
Copy link
Member

tarleb commented May 4, 2024

Sorry, my bad. I don't really know how to install this properly, the previous installation method lead to a build error. I don't know much about pip, unfortunately.

@daamien
Copy link
Collaborator

daamien commented May 4, 2024

@tarleb I am very confused by this new pipx thing too 😅

In other images, I tend to use pip with the --break-system-packages option. It sounds bad, but it works and since nobody's gonna use the python system package of this image, I'd say "we don't care" if they're broken :)

@daamien
Copy link
Collaborator

daamien commented May 4, 2024

Ok so pipx install the filter in /root/.local/bin/

docker run -it --entrypoint=sh pandoc/extra
/data # pipx install pandoc-latex-environment 
/data # ls /root/.local/bin
pandoc-latex-environment                                                                                             
/data # echo 'plop' | pandoc --filter pandoc-latex-environment                                                       
Error running filter pandoc-latex-environment:                                                                       
Could not find executable pandoc-latex-environment                                                                   
/data # echo 'plop' | pandoc --filter /root/.local/bin/pandoc-latex-environment
<p>plop</p>                                                                                                          
/data #

I guess we just need to add /root/.local/bin/ to the PATH

@tarleb
Copy link
Member

tarleb commented May 4, 2024

I'm ok with either of these options 😄

Do you want to write a fix, or should I try?

@tarleb
Copy link
Member

tarleb commented May 4, 2024

Option 3: we re-write this as a Lua filter. Then we wouldn't need to install Python, but would need to find a way to make it easy to use.

Of the other two options, I think I lean towards --break-system-packages, it seems the easiest and not too terrible.

I'm going to spend some time on #127, maybe that will help.

@daamien
Copy link
Collaborator

daamien commented May 4, 2024

yes afaik the --break-system-packages solution is the simplest approach. It's just the same install method as before but with an explicit option to allow it...

In other words, in previous versions we were already "breaking system packages" 😈 . We were simply breaking them silently and nobody ever complained about it.

I can try to fix that later today or tomorrow...

@daamien
Copy link
Collaborator

daamien commented May 4, 2024

And btw the lua-filters are pretty cool, it would be a nice addition to the extra image.

But I think rewriting the pandoc-latex-environment filter in lua is NOT in the scope of this project... Plus we might have to add other Python filters sooner or later...

daamien added a commit that referenced this issue May 4, 2024
…nvironment-version-in-pandocextrarequirementstxt

Fix #220 : Allow pandoc-latex-environment minor upgrades
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants