diff --git a/CHANGELOG.md b/CHANGELOG.md index bdf21d9a..6e5881ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ Instructions: Add a subsection under `[Unreleased]` for additions, fixes, change ## [Unreleased] +### Changed + +- Added a temporary hack to avoid build failures when not connected to the internet. This will be reverted in 2.14 in favor of a more robust solution. + ## [2.13.1] - 2025-02-11 Includes updates to core through commit: [2f6bfae](https://github.com/PreTeXtBook/pretext/commit/2f6bfaedec237e0024772dd1a7486b5559ec53df) diff --git a/pretext/project/__init__.py b/pretext/project/__init__.py index e18c871c..f994a355 100644 --- a/pretext/project/__init__.py +++ b/pretext/project/__init__.py @@ -8,6 +8,7 @@ import tempfile from pathlib import Path from functools import partial +import requests from lxml import etree as ET # noqa: N812 @@ -637,6 +638,20 @@ def build( if no_knowls: self.stringparams["debug.skip-knowls"] = "yes" + # if no internet access, turn off runestone features + # Note: this is temporary code that will be removed once the runestone methods are merged into core pretext. + try: + test_services = requests.get( + "https://runestone.academy/cdn/runestone/latest/webpack_static_imports.xml", + timeout=5, + ) + except requests.exceptions.RequestException as e: + log.warning( + "No internet access detected; turning off Runestone features. Your output might not work correctly until you rebuild with internet access." + ) + self.stringparams["debug.rs.dev"] = "yes" + # End temporary code + # Proceed with the build with tempfile.TemporaryDirectory(prefix="ptxcli_") as tmp_xsl_str: # Put the custom xsl in a "cli_xsl" directory inside the temporary directory, so we can create a symlink to core from the temporary directory itself. diff --git a/pretext/resources/resource_hash_table.json b/pretext/resources/resource_hash_table.json index 802dcf1e..f44d762b 100644 --- a/pretext/resources/resource_hash_table.json +++ b/pretext/resources/resource_hash_table.json @@ -1 +1 @@ -{"2.11.5": {"project.ptx": "20b8cd8099dc3b21a04bcf94d9386446f07e7b11eb1bc3247875546a173b0b3c", "codechat_config.yaml": "d1314aefecb11bf4dee0775ba095ad90bd508c2023c8be1a4dc02ed71406afee", ".gitignore": "56a9ffb6b221bea906348ab3ccb4af37a42d89aeeaaff1e8abf46c06217fd05c", ".devcontainer.json": "4a3c939ffe2fdae8670da5254984419107a794013ef0487e2cbc84db465d0371", "pretext-cli.yml": "acc8fa861bba25478048c1d731a0e2057a746dff9542ee007766111886660f8a"}, "2.12.1": {"project.ptx": "d160e345ff6172157517ce95f3310e3a19f8e05779865316f4a02e1fac13329f", "codechat_config.yaml": "8fbb8c5e888da3b49e070dd189195becc104b082f3d3c3dfbd0de0f9652a1c7e", ".gitignore": "348671629432e5a41f11d2b07242a51831858e3aef41d7f3eb435f3175d3afe4", ".devcontainer.json": "7113274fe6b005b742e68381d477cee3376b4bff8f673eade0b6300a88b2a8eb", "pretext-cli.yml": "a01524273301bfb48b1d72ec0c968f51e63f81a299007b2604e53cb53509ff3b"}, "2.13.1": {"project.ptx": "5bc12b1064ad51b1b0fe5eaaf8f117e133032f3e83907b5e4ae54c10f046b2fb", "codechat_config.yaml": "42c25e156024d8387ecea798406c2bbe990cf8b721946f4f4bb23d9f36f99a5c", ".gitignore": "426ad2f18d6cd35428a52d967e3381195ab610527158a839f072dac594e93e2f", ".devcontainer.json": "ab5713855ee14c265989fc3525ac70665edd5b7745803a58b9d3b240df7e5be5", "pretext-cli.yml": "32f8f76fe6894505ef0e84a47d9546f8b6ee6422fcb031cfc1bab242890da0a5"}} \ No newline at end of file +{"2.11.5": {"project.ptx": "20b8cd8099dc3b21a04bcf94d9386446f07e7b11eb1bc3247875546a173b0b3c", "codechat_config.yaml": "d1314aefecb11bf4dee0775ba095ad90bd508c2023c8be1a4dc02ed71406afee", ".gitignore": "56a9ffb6b221bea906348ab3ccb4af37a42d89aeeaaff1e8abf46c06217fd05c", ".devcontainer.json": "4a3c939ffe2fdae8670da5254984419107a794013ef0487e2cbc84db465d0371", "pretext-cli.yml": "acc8fa861bba25478048c1d731a0e2057a746dff9542ee007766111886660f8a"}, "2.12.1": {"project.ptx": "d160e345ff6172157517ce95f3310e3a19f8e05779865316f4a02e1fac13329f", "codechat_config.yaml": "8fbb8c5e888da3b49e070dd189195becc104b082f3d3c3dfbd0de0f9652a1c7e", ".gitignore": "348671629432e5a41f11d2b07242a51831858e3aef41d7f3eb435f3175d3afe4", ".devcontainer.json": "7113274fe6b005b742e68381d477cee3376b4bff8f673eade0b6300a88b2a8eb", "pretext-cli.yml": "a01524273301bfb48b1d72ec0c968f51e63f81a299007b2604e53cb53509ff3b"}, "2.13.1": {"project.ptx": "5bc12b1064ad51b1b0fe5eaaf8f117e133032f3e83907b5e4ae54c10f046b2fb", "codechat_config.yaml": "42c25e156024d8387ecea798406c2bbe990cf8b721946f4f4bb23d9f36f99a5c", ".gitignore": "426ad2f18d6cd35428a52d967e3381195ab610527158a839f072dac594e93e2f", ".devcontainer.json": "ab5713855ee14c265989fc3525ac70665edd5b7745803a58b9d3b240df7e5be5", "pretext-cli.yml": "32f8f76fe6894505ef0e84a47d9546f8b6ee6422fcb031cfc1bab242890da0a5"}, "2.13.2": {"project.ptx": "fc8587b8c1e1cfbfd81795c18f277c7c24e78184d2142dcfd0ecde2df5c4b113", "codechat_config.yaml": "ff403a8eb5044a99fd7d8ab91396e67ba09d5a0ff5baa6b06ae6e0b2e144280e", ".gitignore": "2c2374d6c4c0057c454ccc9bbc0edf8371a92675ef43ec20e10480da6726251f", ".devcontainer.json": "a5ae571e96fafbb67e496f9b1920b1b257179179d173048475b9aa9e4bd97544", "pretext-cli.yml": "fb5dc2394469de88c9c662be8c71b39e600e80378a41f50db36f4405d4bde3fa"}} \ No newline at end of file diff --git a/templates/.devcontainer.json b/templates/.devcontainer.json index 48086f53..4283d33a 100644 --- a/templates/.devcontainer.json +++ b/templates/.devcontainer.json @@ -1,4 +1,4 @@ -// This file was automatically generated with PreTeXt 2.13.1. +// This file was automatically generated with PreTeXt 2.13.2. // If you modify this file, PreTeXt will no longer automatically update it. // ////////////////////////////////////////////////////////////// diff --git a/templates/.gitignore b/templates/.gitignore index e52a731d..e6acb3dd 100644 --- a/templates/.gitignore +++ b/templates/.gitignore @@ -1,4 +1,4 @@ -# This file was automatically generated with PreTeXt 2.13.1. +# This file was automatically generated with PreTeXt 2.13.2. # If you modify this file, PreTeXt will no longer automatically update it. # # Boilerplate list of files in a PreTeXt project for git to ignore diff --git a/templates/codechat_config.yaml b/templates/codechat_config.yaml index 6d1ccdc5..a778c543 100644 --- a/templates/codechat_config.yaml +++ b/templates/codechat_config.yaml @@ -1,4 +1,4 @@ -# This file was automatically generated with PreTeXt 2.13.1. +# This file was automatically generated with PreTeXt 2.13.2. # If you modify this file, PreTeXt will no longer automatically update it. # ############################################################# diff --git a/templates/pretext-cli.yml b/templates/pretext-cli.yml index f1e0b844..e66c8a2d 100644 --- a/templates/pretext-cli.yml +++ b/templates/pretext-cli.yml @@ -1,4 +1,4 @@ -# This file was automatically generated with PreTeXt 2.13.1. +# This file was automatically generated with PreTeXt 2.13.2. # If you modify this file, PreTeXt will no longer automatically update it. # name: PreTeXt-CLI Actions diff --git a/templates/project.ptx b/templates/project.ptx index 4c9cd38d..a6c97ebd 100644 --- a/templates/project.ptx +++ b/templates/project.ptx @@ -1,5 +1,5 @@ - +