sphinx-contrib / emojicodes

An extension to use emoji codes in your Sphinx documentation! 😍
https://sphinxemojicodes.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
50 stars 15 forks source link

PosixPath problem and 0.3.0 #45

Closed tuhe closed 8 months ago

tuhe commented 8 months ago

Hi,

I am sorry this is a bit sparse on details, but my build script is failing after 0.3.0 came out. I am using the ubuntu:latest docker image here, but it also happens for python 3.10. When I pin at version 0.2.0 the build script works again.

Extension error (sphinxemoji.sphinxemoji):
Handler <function copy_asset_files at 0x7f7d95121e10> for event 'build-finished' threw an exception (exception: 'PosixPath' object has no attribute 'lower')
make: *** [Makefile:20: gettext] Error 1
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/builds/cp/02002public/src/cp_box/material/ipp_cicd_deploy.py", line 47, in <module>
    _cicd_deploy_all()
  File "/builds/cp/02002public/src/cp_box/material/ipp_cicd_deploy.py", line 43, in _cicd_deploy_all
    build_documentation(cut_files=True, open_browser=False, CE=args.ce, update_translations=True)
  File "/builds/cp/02002public/src/cp_box/material/build_documentation.py", line 182, in build_documentation
    pr1 = run(f"cd {paths['docs']} && make gettext", print_output=False, log_output=True, check=True)
  File "/usr/local/lib/python3.10/dist-packages/unitgrade_private/run.py", line 125, in run
    raise Exception(f"Command failed with exit code {process.returncode}: {cmd}")
Exception: Command failed with exit code 2: cd /builds/cp/02002public/src/docs && make gettext
Paul-AUB commented 8 months ago

Hello, same issue here with version 0.3.0 It seems the pertinent part is indeed :

Handler <function copy_asset_files at 0x0000026D14462DE0> for event 'build-finished' threw an exception (exception: 'WindowsPath' object has no attribute 'lower')

Note that it not working also on Linux (with a PosixPath instead of WindowsPath.

Hotfixed with specifying sphinxemoji>=0.2.0,<0.3.0

Peque commented 8 months ago

@tuhe @Paul-AUB Thanks for reporting.

Peque commented 8 months ago

@tuhe @Paul-AUB Installing sphinx>=7.2.0 should fix the issue.

I will probably take a look to support older Sphinx versions but, at least for now, there is a workaround. :blush:

Peque commented 8 months ago

@tuhe @Paul-AUB Should be fixed with 0.3.1.