steps:
- run:
name: Install Python dependencies
- # Everything broken with Pelican 4.5, stay on older version until
- # that's resolved: https://github.com/mosra/m.css/issues/178
# Pyphen 0.10 has significantly different hyphenation results, staying
# on an older version until I can investigate
# Matplotlib 3.4.1 has different output AGAIN, staying on something
# Attrs 20.3 add some new properties that I need to ignore first, using
# 19.3 instead
command: |
- pip install jinja2 pelican==4.2.0 Pyphen==0.9.5 Pillow coverage codecov qrcode matplotlib<< parameters.matplotlib-version >> << parameters.extra >>
+ pip install jinja2 pelican Pyphen==0.9.5 Pillow coverage codecov qrcode matplotlib<< parameters.matplotlib-version >> << parameters.extra >>
- run:
name: Fix unheard-of cursed issues
# otherwise i get Error: unsupported locale setting
self.assertEqual(*self.actual_expected_contents('landing.html'))
self.assertEqual(*self.actual_expected_contents('breadcrumb.html'))
- @unittest.skipUnless(LooseVersion(pelican.__version__) > LooseVersion("4.2.0"),
+ # Not merged for 4.7 yet and no time from my side to push the PR through,
+ # so let's defer this to blow up at some point in the future.
+ @unittest.skipUnless(LooseVersion(pelican.__version__) > LooseVersion("5.0.0"),
"https://github.com/getpelican/pelican/pull/2260")
def test_content(self):
self.run_pelican({
logger = logging.getLogger(__name__)
-import ansilexer
+try:
+ import ansilexer
+except ImportError:
+ # The above worked well on Pelican 4.2 and before, and also works with
+ # other m.css tools like the Python doc generator. Pelican 4.5.0 changed to
+ # "namespace plugins" and broke packaged plugins completely, 4.5.1 was
+ # fixed to load namespaced plugins again, however the loading code is
+ # different from 4.2 and thus anything from the root plugins/ directory
+ # *isn't* in PATH anymore. Thus attempting to import those modules fails
+ # and as a DIRTY hack I have to add the path back.
+ #
+ # TODO: Pelican 4.5+ treats everything that isn't in the pelican.plugins
+ # namespace as "legacy plugins", which is unfortunate because then I
+ # wouldn't be able to easily share the plugin code with other m.css tools
+ # which don't (and shouldn't need to) care about Pelican at all. Allowing
+ # 3rd party plugins without enforcing implicit assumptions on them (the
+ # namespace, an unprefixed register() function...) would probably involve a
+ # complex discussion with Pelican maintainers which I don't have the energy
+ # for right now. Let's hope the "legacy plugins" codepath stays in for the
+ # foreseeable future.
+ import sys
+ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+ import ansilexer
filters_pre = None
filters_post = None
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
-import dot2svg
+try:
+ import dot2svg
+except ImportError:
+ # While the above was enough to make things work with Pelican 4.2 and
+ # before (and also works with other m.css tools like the Python doc
+ # generator), Pelican 4.5.1+ needs the below (4.5.0 didn't work with
+ # namespaced plugins at all). See the comment in m.code for further info.
+ import sys
+ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+ import dot2svg
def _is_graph_figure(parent):
# The parent has to be a figure, marked as m-figure
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
-import latex2svg
-import latex2svgextra
+try:
+ import latex2svg
+ import latex2svgextra
+except ImportError:
+ # While the above was enough to make things work with Pelican 4.2 and
+ # before (and also works with other m.css tools like the Python doc
+ # generator), Pelican 4.5.1+ needs the below (4.5.0 didn't work with
+ # namespaced plugins at all). See the comment in m.code for further info.
+ import sys
+ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+ import latex2svg
+ import latex2svgextra
default_settings = {
'INPUT': '',