Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to disable cache #204

Merged
merged 2 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@ customize several aspects of the workflow. Below is a list of all
available options.


.. _config.cache_on_zenodo:

``cache_on_zenodo``
^^^^^^^^^^^^^^^^^^^

**Type:** ``bool``

**Description:** Flag controlling whether or not caching on Zenodo/Zenodo Sandbox
should be performed. Set this to ``false`` to disable caching.

**Required:** no

**Default:** ``true``

**Example:**

.. code-block:: yaml

cache_on_zenodo: true


.. _config.dag:

``dag``
Expand Down
9 changes: 5 additions & 4 deletions showyourwork/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ def render_config(cwd="."):
config = yaml.safe_load(config)

# Merge with the zenodo config file, if present
file = Path(cwd) / "zenodo.yml"
if file.exists():
with open(file, "r") as f:
config.update(yaml.safe_load(f.read()))
if config.get("cache_on_zenodo", True):
file = Path(cwd) / "zenodo.yml"
if file.exists():
with open(file, "r") as f:
config.update(yaml.safe_load(f.read()))

# Save to a temporary YAML file
with open(paths.user().temp / "showyourwork.yml", "w") as f:
Expand Down