From 39f72204894f93412a14856e25088c14984347ea Mon Sep 17 00:00:00 2001 From: John Sirois Date: Sat, 11 Jan 2025 11:42:09 -0800 Subject: [PATCH] Fix cache location and doc urls for Windows. --- CHANGES.md | 10 ++++++++++ docs/_ext/sphinx_science/directives.py | 2 +- docs/providers.md | 2 +- science/__init__.py | 2 +- science/context.py | 2 +- uv.lock | 2 +- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fd9fb7c..ed2ec49 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,15 @@ # Release Notes +## 0.10.2 + +This release brings two fixes for `science` on Windows: ++ Previously the default `science` cache location was + `%USERPROFILE%\AppData\Local\science\science\Cache`. The redundant `science` subdirectory is now + removed, resulting in a default of `%USERPROFILE%\AppData\Local\science\Cache`. ++ The intra-site links in the local docs served via `science doc open` are now work. Previously + they mistakenly contained `\` in some URL path components causing deep links to return to the + home page. + ## 0.10.1 This release fixes `science` to retry failed HTTP(S) fetches when appropriate. diff --git a/docs/_ext/sphinx_science/directives.py b/docs/_ext/sphinx_science/directives.py index aa23d9c..80355ef 100644 --- a/docs/_ext/sphinx_science/directives.py +++ b/docs/_ext/sphinx_science/directives.py @@ -166,7 +166,7 @@ def run(self) -> list[nodes.Node]: self.options.pop("toctree_hidden") docnames = tuple( - str(doc.write(dest_dir).relative_to(app.srcdir).with_suffix("")) + doc.write(dest_dir).relative_to(app.srcdir).with_suffix("").as_posix() for doc in doc_gen_directive.enumerate_docs( DirectiveSpec( name=doc_gen_directive_name, diff --git a/docs/providers.md b/docs/providers.md index 50f921c..fa6a7fc 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -7,7 +7,7 @@ similar small set of configuration, and then injects the file in your configurat referencable by the interpreter `id` you supply in [command](science-model-command) `#{id}` substitutions. Additionally, interpreter providers can provide keyed access to important files and binaries within the distribution archives that you can reference via `{#id:}`. The -documentation for each interpreter provider will detail both the distibution archive file keys +documentation for each interpreter provider will detail both the distribution archive file keys supported and the configuration information required. (built-in-providers)= diff --git a/science/__init__.py b/science/__init__.py index 274ab48..3069dde 100644 --- a/science/__init__.py +++ b/science/__init__.py @@ -3,6 +3,6 @@ from packaging.version import Version -__version__ = "0.10.1" +__version__ = "0.10.2" VERSION = Version(__version__) diff --git a/science/context.py b/science/context.py index 430eaf9..e3d0505 100644 --- a/science/context.py +++ b/science/context.py @@ -26,7 +26,7 @@ def active_context_config(config_type: type[_T]) -> _T | None: @dataclass(frozen=True) class ScienceConfig(ContextConfig): - DEFAULT_CACHE_DIR = Path(user_cache_dir("science")) + DEFAULT_CACHE_DIR = Path(user_cache_dir("science", appauthor=False)) @classmethod def active(cls) -> ScienceConfig: diff --git a/uv.lock b/uv.lock index cb51c46..1eed14b 100644 --- a/uv.lock +++ b/uv.lock @@ -517,7 +517,7 @@ wheels = [ [[package]] name = "science" -version = "0.10.1" +version = "0.10.2" source = { editable = "." } dependencies = [ { name = "appdirs" },