Skip to content

Commit 5486e7e

Browse files
coroatgilon
andauthored
feat: add windows installer (#333)
* feat: add windows installer * fix: use python unbuffered on windows * fix: install git into windows environment * fix: windows installer needs to locate binaries first * feat: add shell script for building windows installer * fix: Speed up uninstalling by batch removing directories first * fix: gitignore installer build artifacts * fix: small fixes to windows installer * fix(installer): clean up wording slightly * feat: bundle repository into windows installer * fix: make sure no spaces are in repository directory * feat: add gh workflow to build and attach the windows installer to releases * Add documentation and release notes * Update pixi.lock * Updates README.md * fix: remove pixi from installer name * fix: add INSTDIR to PATH * fix: install snakemake from open-tyndp channel * feat: make pixi environment install optional * fix: add version constraints * fix: update snakemake-minimal to 9.14.5+opentyndp.1 * fix: compatibility of build_gas_* rules with pyogrio >=0.12.0 pyogrio >=0.12.0 returns JSON fields directly as dicts/lists, so that loading them again as json fails. refer to https://github.com/geopandas/pyogrio/releases/tag/v0.12.0 . * fix: apply suggestions from thomas * Apply suggestion from Thomas on windows-installer Readme * fix(docs): fix installation heading levels * fix typo * Update pixi.toml * doc: add installer in the documentation * chore: solve merge conflicts --------- Co-authored-by: Thomas Gilon <thomas.gilon@openenergytransition.org>
1 parent 19cd028 commit 5486e7e

14 files changed

Lines changed: 5841 additions & 9908 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-FileCopyrightText: Contributors to Open-TYNDP <https://github.com/open-energy-transition/open-tyndp>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: Build and Attach Installer to Release
6+
7+
on:
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
inputs:
12+
release_tag:
13+
description: 'Release tag to attach installer to'
14+
required: true
15+
type: string
16+
17+
jobs:
18+
build-and-attach-installer:
19+
name: Build Windows Installer and Attach to Release
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
steps:
24+
- uses: actions/checkout@v6
25+
with:
26+
ref: ${{ github.event.release.tag_name || inputs.release_tag }}
27+
28+
- name: Setup Pixi
29+
uses: prefix-dev/setup-pixi@v0.9.3
30+
with:
31+
pixi-version: v0.59.0
32+
cache: true
33+
cache-write: false
34+
35+
- name: Get version from release tag
36+
id: get_version
37+
run: |
38+
TAG="${{ github.event.release.tag_name || inputs.release_tag }}"
39+
VERSION=${TAG#v}
40+
echo "version=$VERSION" >> $GITHUB_OUTPUT
41+
echo "tag=$TAG" >> $GITHUB_OUTPUT
42+
43+
- name: Build Windows installer
44+
env:
45+
VERSION: ${{ steps.get_version.outputs.version }}
46+
run: |
47+
utils/windows-installer/build_installer.sh
48+
49+
- name: Upload installer to release
50+
env:
51+
GH_TOKEN: ${{ github.token }}
52+
run: |
53+
gh release upload ${{ steps.get_version.outputs.tag }} utils/windows-installer/open-tyndp-*.exe --clobber

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,6 @@ CLAUDE.local.md
120120

121121
linopy-problem-*
122122
linopy-solve-*
123+
124+
# Installer build artifacts
125+
*.exe

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The back-casting of the 2024 TYNDP cycle involves developing new features based
5151
- Added the TOOT reference and project network preparation for CBA (see PRs [#199](https://github.com/open-energy-transition/open-tyndp/pull/199), [#211](https://github.com/open-energy-transition/open-tyndp/pull/211)).
5252
- Added weekly rolling horizon optimization for CBA networks (see PR [#217](https://github.com/open-energy-transition/open-tyndp/pull/217)).
5353
- Introduced calculation of B1 indicator in the CBA based on changes in total system costs (see PR [#186](https://github.com/open-energy-transition/open-tyndp/pull/186)).
54+
- Added automated Windows installer for easy setup on Windows systems (see PR [#333](https://github.com/open-energy-transition/open-tyndp/pull/333)).
5455

5556

5657

@@ -122,6 +123,12 @@ While multiple TYNDP features are already introduced to the Open-TYNDP model, th
122123

123124
## 1. Installation
124125

126+
### Option A: Windows Installer (Recommended for Windows)
127+
128+
For Windows users, download the latest installer (e.g., `open-tyndp-0.4.0-pixi-Windows-x86_64.exe`) from the [releases page](https://github.com/open-energy-transition/open-tyndp/releases) and run it. The installer automatically sets up everything you need, including pixi, the repository, and the conda environment. See `utils/windows-installer/README.md` for details.
129+
130+
### Option B: Manual Installation (All Platforms)
131+
125132
Clone the repository:
126133

127134
```sh

REUSE.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@ path = [
5050
]
5151
SPDX-FileCopyrightText = "Open Energy Transition gGmbH"
5252
SPDX-License-Identifier = "MIT"
53+
54+
[[annotations]]
55+
path = [
56+
"utils/windows-installer/oet_logo.*",
57+
]
58+
SPDX-FileCopyrightText = "Open Energy Transition gGmbH"
59+
SPDX-License-Identifier = "CC-BY-4.0"

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ The back-casting of the 2024 TYNDP cycle involves developing new features based
9898
- Added the TOOT reference and project network preparation for CBA (see PRs `#199 <https://github.com/open-energy-transition/open-tyndp/pull/199>`__, `#211 <https://github.com/open-energy-transition/open-tyndp/pull/211>`__).
9999
- Added weekly rolling horizon optimization for CBA networks (see PR `#217 <https://github.com/open-energy-transition/open-tyndp/pull/217>`__).
100100
- Introduced calculation of B1 indicator in the CBA based on changes in total system costs (see PR `#186 <https://github.com/open-energy-transition/open-tyndp/pull/186>`__).
101+
- Added automated Windows installer for easy setup on Windows systems (see PR `#333 <https://github.com/open-energy-transition/open-tyndp/pull/333>`__).
101102

102103

103104

doc/installation.rst

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,38 @@ The subsequently described installation steps are demonstrated as shell commands
1313
directory in which the commands following the ``%`` should be entered.
1414

1515

16+
.. _windows_installer:
17+
18+
Option A: Windows Installer (Recommended for Windows)
19+
=====================================================
20+
21+
For Windows users, the easiest way to install Open-TYNDP is using the automated installer. Download the latest installer executable (e.g., ``open-tyndp-0.4.0-pixi-Windows-x86_64.exe``) from the `GitHub releases page <https://github.com/open-energy-transition/open-tyndp/releases>`__ and run it.
22+
23+
The installer will:
24+
25+
1. Install pixi package manager to ``%LOCALAPPDATA%\open-tyndp``
26+
2. Extract the repository files to your chosen installation directory
27+
3. Set up the conda environment automatically via ``pixi install``
28+
4. Create Start Menu shortcuts for easy access:
29+
30+
- **Open-TYNDP PowerShell** - Launch PowerShell with environment activated
31+
- **Open-TYNDP Command Prompt** - Launch Command Prompt with environment activated
32+
33+
For more details about the installer, see ``utils/windows-installer/README.md`` in the repository.
34+
35+
.. note::
36+
If you prefer manual installation or need more control over the setup process, follow the instructions below for cloning the repository and installing dependencies manually.
37+
38+
39+
.. _manual_installation
40+
41+
Option B: Manual installation (All Platforms)
42+
=============================================
43+
1644
.. _clone_repo:
1745

1846
Clone the Repository
19-
====================
47+
--------------------
2048

2149
First of all, clone the `Open-TYNDP repository <https://github.com/open-energy-transition/open-tyndp>`__ using the version control system ``git`` in the command line.
2250

@@ -28,10 +56,10 @@ First of all, clone the `Open-TYNDP repository <https://github.com/open-energy-t
2856
.. _deps:
2957

3058
Install Python Dependencies
31-
===============================
59+
---------------------------
3260

3361
Preferred method: ``pixi``
34-
--------------------------
62+
~~~~~~~~~~~~~~~~~~~~~~~~~~
3563

3664
PyPSA-Eur, and consequently Open-TYNDP, relies on a set of other Python packages to function.
3765
We manage these using `pixi <https://pixi.sh/latest/>`_.
@@ -49,7 +77,7 @@ Once pixi is installed, you can activate the project environment for your operat
4977
We don't currently support linux operating systems using ARM processors since certain packages, such as ``PySCIPOpt``, require being built from source.
5078

5179
Legacy method: ``conda``
52-
------------------------
80+
~~~~~~~~~~~~~~~~~~~~~~~~
5381

5482
If you cannot access ``pixi`` on your machine, you can also install using `conda <https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html>`_ (or ``mamba``/``micromamba``).
5583
To do so, we highly recommend you install from one of our platform-specific environment files:
@@ -87,7 +115,7 @@ If you are having difficulties with the above files, you can also install direct
87115
88116
89117
Install a Solver
90-
================
118+
----------------
91119

92120
PyPSA passes the PyPSA-Eur network model to an external solver for performing the optimisation.
93121
PyPSA is known to work with the free software

doc/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Release Notes
1111
Upcoming Open-TYNDP Release
1212
================
1313

14+
* Added automated Windows installer for easy setup on Windows systems (https://github.com/open-energy-transition/open-tyndp/pull/333). The installer bundles pixi, the repository, and sets up the conda environment automatically. Installer executables are automatically built and attached to GitHub releases. See ``utils/windows-installer/`` for details.
15+
1416
* Docs: Add innovation roadmap comparison, mapping existing or new developments in PyPSA-Eur and Open TYNDP to desired features for TYNDP 2026 (https://github.com/open-energy-transition/open-tyndp/pull/341)
1517

1618
* Fix Windows compatibility issues and make other minor improvements (https://github.com/open-energy-transition/open-tyndp/pull/357).

0 commit comments

Comments
 (0)