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

Remove Jinja dependency for landing page generation #1082

Merged
merged 3 commits into from
Feb 28, 2022
Merged

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Feb 26, 2022

Alleviates the issues with the Jinja+aiida dep combination (#1079) by manually constructing and caching the landing page.

The info displayed should be identical, except it is no longer sanitized to check for web-safety of the metadata.

@codecov
Copy link

codecov bot commented Feb 26, 2022

Codecov Report

Merging #1082 (788b1e4) into master (bb3c5a1) will decrease coverage by 0.38%.
The diff coverage is 20.00%.

❗ Current head 788b1e4 differs from pull request most recent head 98ccc21. Consider uploading reports for the commit 98ccc21 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1082      +/-   ##
==========================================
- Coverage   92.90%   92.51%   -0.39%     
==========================================
  Files          67       67              
  Lines        3790     3807      +17     
==========================================
+ Hits         3521     3522       +1     
- Misses        269      285      +16     
Flag Coverage Δ
project 92.51% <20.00%> (-0.39%) ⬇️
validator 92.51% <20.00%> (-0.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
optimade/server/routers/landing.py 38.23% <20.00%> (-32.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb3c5a1...98ccc21. Read the comment docs.

CasperWA
CasperWA previously approved these changes Feb 28, 2022
Copy link
Member

@CasperWA CasperWA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This essentially looks fine to me - cheers @ml-evs.

I have left some comments and suggested changes, but they are not at all critical - at least not if this works on your end as intended. I can try and test it as well, but if you already did, I trust your work.

optimade/server/routers/landing.py Outdated Show resolved Hide resolved
optimade/server/routers/landing.py Outdated Show resolved Hide resolved
optimade/server/routers/landing.py Outdated Show resolved Hide resolved
@CasperWA CasperWA added the blocking For issues/PRs that are blocking other PRs. label Feb 28, 2022
Co-authored-by: Casper Andersen <casper.w.andersen@sintef.no>
@ml-evs
Copy link
Member Author

ml-evs commented Feb 28, 2022

Have tested this again locally, so will merge without a re-review.

@ml-evs ml-evs enabled auto-merge (squash) February 28, 2022 13:42
@ml-evs ml-evs merged commit 74fb938 into master Feb 28, 2022
@ml-evs ml-evs deleted the ml-evs/remove_jinja branch February 28, 2022 13:50
@ml-evs
Copy link
Member Author

ml-evs commented Feb 28, 2022

😓 https://github.com/Materials-Consortia/optimade-python-tools/runs/5360468940?check_suite_focus=true

Run mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml latest master
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.12/x64/bin/mike", line 5, in <module>
    from mike.driver import main
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mike/driver.py", line 4, in <module>
    from . import arguments, commands
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/mike/commands.py", line 5, in <module>
    from jinja2 import Template
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/markupsafe/__init__.py)
Error: Process completed with exit code 1.

@CasperWA
Copy link
Member

Yup. Created issue #1086 for this now :/

@ml-evs ml-evs added server Issues pertaining to the example server implementation and removed blocking For issues/PRs that are blocking other PRs. labels Feb 28, 2022
@ml-evs ml-evs changed the title Do not use Jinja to generate the landing page Remove Jinja dependency for landing page generation Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Issues pertaining to the example server implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants