You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error occurs when running poe test on a Python 3.12 project that imports streamlit.
⬢ [Docker] ❯ poe test
Poe => coverage run
=========================================================================================================================================================================== test session starts ============================================================================================================================================================================
platform linux -- Python 3.12.3, pytest-8.1.1, pluggy-1.5.0 -- /opt/my-package-env/bin/python
cachedir: .pytest_cache
rootdir: /workspaces/my-package
configfile: pyproject.toml
testpaths: src, tests
plugins: typeguard-4.2.1, mock-3.14.0, xdist-3.5.0
collected 0 items / 1 error
run-last-failure: None
================================================================================================================================================================================== ERRORS ==================================================================================================================================================================================
__________________________________________________________________________________________________________________________________________________________________ ERROR collecting src/my_package/app.py __________________________________________________________________________________________________________________________________________________________________
/opt/my-package-env/lib/python3.12/site-packages/_pytest/python.py:520: in importtestmodule
mod = import_path(
/opt/my-package-env/lib/python3.12/site-packages/_pytest/pathlib.py:584: in import_path
importlib.import_module(module_name)
/usr/local/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
/opt/my-package-env/lib/python3.12/site-packages/typeguard/_importhook.py:98: in exec_module
super().exec_module(module)
<frozen importlib._bootstrap_external>:995: in exec_module
???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
???
src/my_package/app.py:3: in <module>
import streamlit as st
/opt/my-package-env/lib/python3.12/site-packages/streamlit/__init__.py:69: in <module>
from streamlit.delta_generator import (
/opt/my-package-env/lib/python3.12/site-packages/streamlit/delta_generator.py:49: in <module>
from streamlit.elements.arrow import ArrowMixin
/opt/my-package-env/lib/python3.12/site-packages/streamlit/elements/arrow.py:22: in <module>
from streamlit.elements.lib.column_config_utils import (
/opt/my-package-env/lib/python3.12/site-packages/streamlit/elements/lib/column_config_utils.py:23: in <module>
from streamlit.elements.lib.column_types import ColumnConfig, ColumnType
E File "/opt/my-package-env/lib/python3.12/site-packages/streamlit/elements/lib/column_types.py", line 488
E """Configure a link column in ``st.dataframe`` or ``st.data_editor``.
E ^^^
E SyntaxError: invalid escape sequence '\.'
------------------------------------------------------------------------------------------------------------------------------------------------------ generated xml file: /workspaces/my-package/reports/pytest.xml -------------------------------------------------------------------------------------------------------------------------------------------------------
========================================================================================================================================================================= short test summary info ==========================================================================================================================================================================
ERROR src/my_package/app.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================================================================================================= 1 error in 0.83s =============================================================================================================================================================================
Error: Sequence aborted after failed subtask 'test[0]'
Steps to reproduce
Tested inside WSL2 on Windows 11 version 23H2.
Delete all existing poetry-cookicutter Docker containers and images.
Hi, @vanolucas, thanks for submitting this issue! It looks like it's a known issue on Streamlit side in combination with the strict configuration of pytest which is enabled with development_environment=strict.
I see that there's a fix merged already so I expect it to no longer be an issue in the next streamlit release. As a temporary workaround, I'd recommend switching to the simple development environment or remove the line filterwarnings = ["error", "ignore::DeprecationWarning"] in the pyproject.toml which causes pytest to fail on warnings.
Error
The error occurs when running
poe test
on a Python 3.12 project that importsstreamlit
.Steps to reproduce
Tested inside WSL2 on Windows 11 version 23H2.
Delete all existing
poetry-cookicutter
Docker containers and images.Clone the repo to a local folder:
Open it with VSCode:
code .
Run VSCode command:
Dev Containers: Rebuild Without Cache and Reopen in Container
.The
poetry-cookiecutter
dev container builds and opens.Once completely initialized, open VSCode's bash terminal:
Terminal: Create New Terminal
.Scaffold a new Python 3.12 package project using cruft:
Choose the following cookiecutter values. Here reported in the generated
.cruft.json
:Exit the dev container and close VSCode.
Copy the scaffolded project to another local folder:
cd .. cp -r poetry-cookiecutter/my-package ./
Navigate to the scaffolded project folder and open it with VSCode:
Build the project's dev container: run VSCode command:
Dev Containers: Rebuild Without Cache and Reopen in Container
.Once completely initialized, open VSCode's bash terminal:
Terminal: Create New Terminal
.Add Streamlit as a dependency:
Create a Python file that imports
streamlit
:In
src/my_package/app.py
:Init a git repo:
Run code linting:
Run tests:
poe test
The text was updated successfully, but these errors were encountered: