Skip to content
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
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ jobs:
enable-coverage: "false"
extra-pytest-warnings: ""

# Run the tests that install package managers, on runners without them
tests-package-manager-install:
needs: build
uses: ewoks-kit/.github/.github/workflows/python-tests.yml@main
with:
os: ${{ matrix.os }}
python-version: "3.12"
pytest-args: >-
-v -ra -W error -m package_manager_install
-W ignore::DeprecationWarning:jupyter_client.session
-W ignore::DeprecationWarning:orangecanvas.utils.localization
-W ignore::DeprecationWarning:orangecanvas.utils.localization.si
-W ignore::DeprecationWarning:matplotlib._fontconfig_pattern
-W ignore::DeprecationWarning:matplotlib._mathtext
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

# Run linter / checks
checks:
uses: ewoks-kit/.github/.github/workflows/python-check.yml@main
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- add `--in-place`, `--python-version` and `--with-ewoks` arguments.
- `ewoks convert`: add `--package-manager-name` and `--package-manager-command` arguments.
- `ewoks execute`: add `--env` argument.
- Add `ewoks-install.sh` and `ewoks-install.ps1` scripts to install the environment of a workflow without ewoks.
- Add `ewoks lint` CLI command to check if a workflow is conform to the Ewoks specification.

### Changed
Expand Down
3 changes: 3 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
}


# The ewoks-install scripts
html_extra_path = ["../src/ewoks/_bootstrap"]

# Root of the documentation version that is built: on Read the Docs, for example
# .../en/stable, or on GitLab Pages
_DOCS_URL = (
Expand Down
3 changes: 2 additions & 1 deletion doc/howtoguides/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ What is stored
``ewoks convert`` and ``ewoks execute -o convert_destination=...`` store

* ``ewoks``: the version of :term:`ewoks` that generated the requirements and the engine
that saved the :term:`workflow`.
that saved the :term:`workflow`. The
:ref:`ewoks-install script <install_bootstrap>` installs both to run ``ewoks install``.
* ``python`` and ``system``: the python interpreter and the operating system.
* ``distributions``: every installed python package with its version and, when it was not
installed from the python package index, the git commit or the archive it came from. Any
Expand Down
104 changes: 104 additions & 0 deletions doc/tutorials/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,110 @@ Without ``--yes`` you are asked to confirm after the packages have been listed.
walk-throughs use ``--env-root`` to create the environment in the working directory. Without
it the environment is created where the :term:`package manager` creates named environments.

.. _install_bootstrap:

Create the environment without ewoks
++++++++++++++++++++++++++++++++++++

``ewoks install`` needs a Python environment with :term:`ewoks`. The ``ewoks-install`` script
only needs a :term:`package manager`: it installs the version of :term:`ewoks` that generated
the requirements, and the engine that saved the :term:`workflow`, in a bootstrap environment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the requirements, and the engine that saved the :term:`workflow`, in a bootstrap environment
the requirements, and the engine that saved the :term:`workflow`, in a new environment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "new" environment would suggest the environment created by ewoks install. We are really talking about the bootstrap environment. It is not always new if the ewoks and engine versions are the same as a previous run of the bootstrap script.

and runs ``ewoks install`` from there. All
arguments are passed to ``ewoks install``, except for the options of the script itself

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All arguments are passed to ewoks install, except for the options of the script itself

Not clear. What are the options of the script ?

@woutdenolf woutdenolf Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bootstrap script itself has arguments like --bootstrap-requirement.

@woutdenolf woutdenolf Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See usage() in the script or run it with --help.


.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: Windows

.. code-block:: powershell

& ([scriptblock]::Create((irm |docs_url|/ewoks-install.ps1))) demo.json

Without a :term:`workflow` at hand, try it with the demo :term:`workflow` of this
documentation, which only requires :term:`ewoks`

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSfO |docs_url|/demo.json
curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSfO |docs_url|/demo.json
curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: Windows

.. code-block:: powershell

irm |docs_url|/demo.json -OutFile demo.json
& ([scriptblock]::Create((irm |docs_url|/ewoks-install.ps1))) demo.json

Alternatively, download the script first, for example to read it before running it

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSf -o ewoks-install.sh |docs_url|/ewoks-install.sh
sh ewoks-install.sh demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSf -o ewoks-install.sh |docs_url|/ewoks-install.sh
sh ewoks-install.sh demo.json

.. group-tab:: Windows

.. code-block:: powershell

irm |docs_url|/ewoks-install.ps1 -OutFile ewoks-install.ps1
powershell -ExecutionPolicy Bypass -File ewoks-install.ps1 demo.json

* ``--package-manager-name`` and ``--package-manager-command`` select the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those the options of the scripts mentioned above?

If so, perhaps they should be in a section that could be referenced above.

I would have appreciated an answer to #348 (comment) to tell that you decided something else.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not decide something else. I kept it as it was. The bootstrap script installs the package manager so I think we cannot do without arguments.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those the options of the scripts mentioned above?

Yes, see usage() in the script or run it with --help.

:term:`package manager` that creates the bootstrap environment. Without them it is the first
one that is available of uv, pixi, conda, poetry and pip-venv.
* ``--bootstrap-requirement`` installs a package in the bootstrap environment instead of the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bootstrap feels like technical jargon.

Simply --requirement ?

@woutdenolf woutdenolf Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are talking about two environments (the bootstrap environment and the workflow environment) I think it is safer to keep the word bootstrap to avoid confusion.

version of :term:`ewoks` and the engine of the requirements, for example
``--bootstrap-requirement "ewoks>=7"``. Repeat it to install an engine as well, for example
``--bootstrap-requirement ewoks --bootstrap-requirement ewoksorange``. The latest version of
:term:`ewoks` is installed when the requirements do not provide one.
* ``--bootstrap-dir`` is the directory of the bootstrap environments.
* ``--install-package-manager`` installs the :term:`package manager` of
``--package-manager-name`` in the bootstrap directory when it is not installed. Conda
cannot be installed in a directory with spaces.

The script keeps the bootstrap environment in ``~/.ewoks/bootstrap`` and uses it again when
it installs another :term:`workflow` whose requirements were generated by the same version of
:term:`ewoks`. The bootstrap environment only runs ``ewoks install``:
it is not the environment of the :term:`workflow`. The script prints the ``ewoks install``
command before it runs it. Before the environment of the
:term:`workflow`, the script prints the python interpreter of the bootstrap environment, the
command to run ``ewoks install`` again and the command to remove the bootstrap environment. When the script fails to create the bootstrap
environment, it prints how to install without it.

Execute the workflow
--------------------

Expand Down
26 changes: 26 additions & 0 deletions doc/tutorials/install/conda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,32 @@ The environment of the :term:`workflow` is a conda environment in ``ewoks_envs/d
``--env-root`` it is created in the first environment directory of conda, where
``conda activate demo`` finds it.

Alternatively, the :ref:`ewoks-install script <install_bootstrap>` recreates the
environment without an environment with :term:`ewoks`

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: Windows

.. code-block:: powershell

& ([scriptblock]::Create((irm |docs_url|/ewoks-install.ps1))) demo.json

It selects the :term:`package manager` itself and prints the command to execute the
:term:`workflow` in the environment it creates.

Execute the workflow
--------------------

Expand Down
26 changes: 26 additions & 0 deletions doc/tutorials/install/pip_venv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,32 @@ Only ``ewoks`` itself is needed to recreate the environment of ``demo.json``

The environment of the :term:`workflow` is a virtual environment in ``ewoks_envs/demo``.

Alternatively, the :ref:`ewoks-install script <install_bootstrap>` recreates the
environment without an environment with :term:`ewoks`

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: Windows

.. code-block:: powershell

& ([scriptblock]::Create((irm |docs_url|/ewoks-install.ps1))) demo.json

It selects the :term:`package manager` itself and prints the command to execute the
:term:`workflow` in the environment it creates.

Execute the workflow
--------------------

Expand Down
26 changes: 26 additions & 0 deletions doc/tutorials/install/pixi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,32 @@ Only ``ewoks`` itself is needed to recreate the environment of ``demo.json``
The environment of the :term:`workflow` is a pixi workspace in ``ewoks_envs/demo`` with the
environment in its ``.pixi/envs/default`` directory.

Alternatively, the :ref:`ewoks-install script <install_bootstrap>` recreates the
environment without an environment with :term:`ewoks`

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: Windows

.. code-block:: powershell

& ([scriptblock]::Create((irm |docs_url|/ewoks-install.ps1))) demo.json

It selects the :term:`package manager` itself and prints the command to execute the
:term:`workflow` in the environment it creates.

Execute the workflow
--------------------

Expand Down
26 changes: 26 additions & 0 deletions doc/tutorials/install/poetry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,32 @@ Only ``ewoks`` itself is needed to recreate the environment of ``demo.json``
The environment of the :term:`workflow` is a poetry project in ``ewoks_envs/demo`` with the
virtual environment in its ``.venv`` directory.

Alternatively, the :ref:`ewoks-install script <install_bootstrap>` recreates the
environment without an environment with :term:`ewoks`

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: Windows

.. code-block:: powershell

& ([scriptblock]::Create((irm |docs_url|/ewoks-install.ps1))) demo.json

It selects the :term:`package manager` itself and prints the command to execute the
:term:`workflow` in the environment it creates.

Execute the workflow
--------------------

Expand Down
26 changes: 26 additions & 0 deletions doc/tutorials/install/uv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,32 @@ Only ``ewoks`` itself is needed to recreate the environment of ``demo.json``
The environment of the :term:`workflow` is a uv project in ``ewoks_envs/demo`` with the
virtual environment in its ``.venv`` directory.

Alternatively, the :ref:`ewoks-install script <install_bootstrap>` recreates the
environment without an environment with :term:`ewoks`

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: macOS

.. code-block:: bash

curl -LsSf |docs_url|/ewoks-install.sh | sh -s -- demo.json

.. group-tab:: Windows

.. code-block:: powershell

& ([scriptblock]::Create((irm |docs_url|/ewoks-install.ps1))) demo.json

It selects the :term:`package manager` itself and prints the command to execute the
:term:`workflow` in the environment it creates.
Comment thread
woutdenolf marked this conversation as resolved.
Resolved

Execute the workflow
--------------------

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ ewoks = "ewoks.__main__:main"

[tool.setuptools.package-data]
"ewoks.tests.notebooks" = ["*.ipynb"]
"ewoks._bootstrap" = ["*.sh", "*.ps1"]

[tool.ruff.lint]
select = [
Expand Down
Loading
Loading