Skip to content

Commit

Permalink
Merge pull request #7 from showyourwork/showyourwork-spec
Browse files Browse the repository at this point in the history
allow users to choose specific syw version
  • Loading branch information
rodluger authored Sep 28, 2022
2 parents fd5098d + d1f7de2 commit 116e0ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ The **showyourwork-action** accepts any of the following inputs, all of which ar

**Optional** Specify the URL of the :code:`latexpand` script to download. You may use this to set a custom version of :code:`latexpand`.

:code:`showyourwork-spec`
~~~~~~~~~~~~~~~~~~~~~~~~~

**Optional** The version specification of :code:`showyourwork` to install using :code:`pip`. The code will be installed as :code:`pip install -U <showyourwork-spec>`. Default is :code:`showyourwork` (which resolves to the latest available version on PyPI).

Environment variables
---------------------

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ inputs:
description: "URL to download `latexpand`"
required: false
default: "https://gitlab.com/latexpand/latexpand/-/raw/master/latexpand"
showyourwork-spec:
description: "pip version specification for installing showyourwork, e.g., `pip install <showyourwork_spec>`"
required: false
default: "showyourwork"
branding:
icon: "book-open"
color: "red"
5 changes: 3 additions & 2 deletions src/conda.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = { setupConda };

// Cache settings
const CONDA_CACHE_NUMBER = core.getInput("conda-cache-number");
const SHOWYOUWORK_SPEC = core.getInput("showyourwork-spec");
const RUNNER_OS = shell.env["RUNNER_OS"];
const conda_key = `conda-${constants.conda_cache_version}-${RUNNER_OS}-${CONDA_CACHE_NUMBER}`;
const conda_restoreKeys = [];
Expand Down Expand Up @@ -50,8 +51,8 @@ async function setupConda() {
core.endGroup();
}

// Always install the latest version of showyourwork
exec("pip install -U showyourwork", "Install showyourwork");
// Install showyourwork
exec(`pip install -U ${SHOWYOUWORK_SPEC}`, "Install showyourwork");

// Display some info
exec("conda info", "Conda info");
Expand Down

0 comments on commit 116e0ef

Please sign in to comment.