From 38fd183d2a09305f9dd5e43a6498b221ffe3ee94 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Thu, 5 Oct 2023 16:31:50 +0200 Subject: [PATCH] More fixes --- docs/conf.py | 1 - jupyterlite_xeus_python/__init__.py | 4 +++- jupyterlite_xeus_python/build.py | 8 ++++++-- pyproject.toml | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index cc0df9b..ba01ba2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,3 @@ - extensions = [ "jupyterlite_sphinx", "myst_parser", diff --git a/jupyterlite_xeus_python/__init__.py b/jupyterlite_xeus_python/__init__.py index c30a58c..f5ea975 100644 --- a/jupyterlite_xeus_python/__init__.py +++ b/jupyterlite_xeus_python/__init__.py @@ -6,7 +6,9 @@ # the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs import warnings - warnings.warn("Importing 'jupyterlite-xeus-python' outside a proper installation.") + warnings.warn( + "Importing 'jupyterlite-xeus-python' outside a proper installation.", stacklevel=2 + ) __version__ = "dev" diff --git a/jupyterlite_xeus_python/build.py b/jupyterlite_xeus_python/build.py index 90b7b23..03cac50 100644 --- a/jupyterlite_xeus_python/build.py +++ b/jupyterlite_xeus_python/build.py @@ -36,6 +36,7 @@ ] PLATFORM = "emscripten-32" +DEFAULT_REQUEST_TIMEOUT = 1 # in minutes def create_env( @@ -127,7 +128,8 @@ def _install_pip_dependencies(prefix_path, dependencies, log=None): if log is not None: log.warning( """ - Installing pip dependencies. This is very much experimental so use this feature at your own risks. + Installing pip dependencies. This is very much experimental so use + this feature at your own risks. Note that you can only install pure-python packages. pip is being run with the --no-deps option to not pull undesired system-specific dependencies, so please install your package dependencies from emscripten-forge or conda-forge. @@ -294,7 +296,9 @@ def build_and_pack_emscripten_env( if empack_config: empack_config_is_url = urlparse(empack_config).scheme in ("http", "https") if empack_config_is_url: - empack_config_content = requests.get(empack_config).content + empack_config_content = requests.get( + empack_config, timeout=DEFAULT_REQUEST_TIMEOUT + ).content pack_kwargs["file_filters"] = PkgFileFilter.parse_obj( yaml.safe_load(empack_config_content) ) diff --git a/pyproject.toml b/pyproject.toml index 0bd0b67..361b229 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,7 +100,7 @@ target-version = ["py38"] target-version = "py38" exclude = [ "*/tests/*", - "docs/source/tools/*", + "docs", ] line-length = 100 select = [ @@ -122,7 +122,9 @@ ignore = [ # PLR0913 Too many arguments to function call "PLR0913", # extended flake8 ignore - "D104", "D100", "EM101" + "D104", "D100", "EM101", + # Probable insecure usage of temporary file or directory + "S108" ] [tool.ruff.per-file-ignores]