ansys / ansys-sphinx-theme

PyData-based Sphinx theme from the PyAnsys community
https://sphinxdocs.ansys.com
MIT License
21 stars 5 forks source link

SyntaxWarning when running with Python 3.12 #348

Closed greschd closed 3 months ago

greschd commented 3 months ago

šŸ” Before submitting the issue

šŸž Description of the bug

When importing the ansys_sphinx_theme in Python 3.12, it generates syntax warnings due to invalid escape sequences in docstrings. This causes noise in the build pipelines of downstream projects.

šŸ“ Steps to reproduce

Note: This happens only on the first import; after the Python bytecode is generated it will not re-appear. To make it re-appear:

Output:

python -c 'import ansys_sphinx_theme'
D:\ANSYSDev\public\ansys-sphinx-theme\src\ansys_sphinx_theme\latex\__init__.py:58: SyntaxWarning: invalid escape sequence '\B'
  block_start_string="\BLOCK{",
D:\ANSYSDev\public\ansys-sphinx-theme\src\ansys_sphinx_theme\latex\__init__.py:60: SyntaxWarning: invalid escape sequence '\p'
  variable_start_string="\pyvar{",
D:\ANSYSDev\public\ansys-sphinx-theme\src\ansys_sphinx_theme\latex\__init__.py:62: SyntaxWarning: invalid escape sequence '\#'
  comment_start_string="\#{",

šŸ’» Which operating system are you using?

Windows

šŸ“€ Which ANSYS version are you using?

n/a

šŸ Which Python version are you using?

3.12

šŸ“¦ Installed packages

accessible-pygments==0.0.4
alabaster==0.7.16
-e git+https://github.com/ansys/ansys-sphinx-theme.git@b8422236be0673b867919bc215fb2450652d0afe#egg=ansys_sphinx_theme
Babel==2.14.0
beautifulsoup4==4.12.3
certifi==2024.2.2
charset-normalizer==3.3.2
colorama==0.4.6
docutils==0.20.1
idna==3.6
imagesize==1.4.1
importlib_metadata==7.1.0
Jinja2==3.1.3
MarkupSafe==2.1.5
packaging==24.0
pydata-sphinx-theme==0.14.4
Pygments==2.17.2
requests==2.31.0
snowballstemmer==2.2.0
soupsieve==2.5
Sphinx==7.2.6
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
typing_extensions==4.10.0
urllib3==2.2.1
zipp==3.18.1