Skip to content

Commit

Permalink
Pre-release fixes (#550)
Browse files Browse the repository at this point in the history
* Fix CI version getter and add pip build tests
* Update dependencies
  • Loading branch information
brynpickering committed Jan 26, 2024
1 parent a5b83ba commit dd92168
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 17 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,35 @@ jobs:
version: ${{ steps.get-version.outputs.version }}
steps:
- id: get-version
run: echo "version=${${{github.event.pull_request.title}}#"Release "}" >> $GITHUB_OUTPUT
run: |
fullname="${{github.event.pull_request.title}}"
echo "version=${fullname#"Release "}" >> $GITHUB_OUTPUT
pip-test:
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.title, 'Release v')
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: latest
environment-name: pipbuild
create-args: >-
python=3.11
pip
build
post-cleanup: all
cache-environment: true
- name: Build package
run: python -m build
- name: Test package install
run: |
pip install dist/calliope-*.tar.gz
calliope --help
pre-release:
needs: [test, pre-release-version]
if: needs.test.result == 'success' && startsWith(github.event.pull_request.title, 'Release v')
needs: [test, pre-release-version, pip-test]
if: needs.pip-test.result == 'success' && needs.test.result == 'success' && startsWith(github.event.pull_request.title, 'Release v')
uses: arup-group/actions-city-modelling-lab/.github/workflows/pip-build.yml@main
secrets:
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.7.0.dev1 (dev)
## 0.7.0.dev2 (dev)

v0.7 includes a major change to how Calliope internally operates.
Along with this, there are multiple changes to how Calliope models are defined and configured.
Expand All @@ -10,7 +10,6 @@ We group changes into those that are primarily user-facing and relevant for all
This section gives a brief summary of changes.
For more detail, see our migrating from v0.6 to v0.7 section in our [documentation](https://calliope.readthedocs.io/en/latest/migrating/).


|new| Storage buffers available in all technology base classes.

|new| Multiple carriers and different carriers in/out available in all technology base classes.
Expand Down
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
!!! warning

Calliope version 0.7 is available as a pre-release with the purpose of gathering feedback from users.
To install the pre-release as a user:

```shell
mamba create -n calliope -c conda-forge/label/calliope_dev -c conda-forge calliope
```

Some functionality is not yet available in 0.7, notably:

Expand All @@ -11,6 +16,8 @@

To see a full list of changes, read our [page on migrating between v0.6 and v0.7](migrating.md).

If you want to install the most recent _stable_ version of Calliope, see our [v0.6.10 documentation](https://calliope.readthedocs.io/en/v0.6.10/).

!!! note

This is the documentation for version {{ calliope_version }} ([version history](version_history.md)).
Expand Down
23 changes: 14 additions & 9 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Calliope has been tested on Linux, macOS, and Windows.

Running Calliope requires four things:

1. The Python programming language, version {{ min_python_version }} to {{ max_python_version }}.
2. A number of Python add-on modules (see [below for the complete list](#python-module-requirements)).
3. A solver: Calliope has been tested with CBC, GLPK, Gurobi, and CPLEX. Any other solver that is compatible with Pyomo should also work.
4. The Calliope software itself.
1. The Python programming language, version {{ min_python_version }} to {{ max_python_version }}.
2. A number of Python add-on modules (see [below for the complete list](#python-module-requirements)).
3. A solver: Calliope has been tested with CBC, GLPK, Gurobi, and CPLEX. Any other solver that is compatible with Pyomo should also work.
4. The Calliope software itself.

## Recommended installation method

Expand All @@ -19,16 +19,20 @@ To get `mamba`, [download and install the "Mambaforge" distribution for your ope

With mamba installed, you can create a new environment called `calliope` with all the necessary modules, including the free and open source GLPK solver, by running the following command in a terminal or command-line window

```bash
$ mamba create -c conda-forge -n calliope calliope
```shell
mamba create -n calliope -c conda-forge/label/calliope_dev -c conda-forge calliope
```

!!! note
The `conda-forge/label/calliope_dev` channel allows you to access the pre-release of Calliope v0.7, with which this version of the documentation aligns.
To install the most recent _stable_ version of Calliope, see our [v0.6.10 documentation](https://calliope.readthedocs.io/en/v0.6.10/).

This will install calliope with Python version {{ max_python_version }}.

To use Calliope, you need to activate the `calliope` environment each time

```bash
$ mamba activate calliope
mamba activate calliope
```

You are now ready to use Calliope together with the free and open source GLPK solver.
Expand All @@ -38,15 +42,16 @@ Read the next section for more information on installing alternative solvers.

!!! warning

Although possible, we do not recommend installing Calliope directly via `pip` (`pip install calliope`). Non-python binaries are not installed with `pip`, some of which are necessary for stable operation (e.g., `libnetcdf`).
Although possible, we do not recommend installing Calliope directly via `pip` (`pip install calliope`).
Non-python binaries are not installed with `pip`, some of which are necessary for stable operation (e.g., `libnetcdf`).


## Updating an existing installation

If following the recommended installation method above, the following command, assuming the mamba environment is active, will update Calliope to the newest version

```bash
$ mamba update -c conda-forge calliope
mamba update -c conda-forge calliope
```

## Solvers
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ maintainers = [
]
description = "A multi-scale energy systems modelling framework."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["energy systems", "optimisation", "mathematical programming"]
license = { text = "Apache 2.0" }
classifiers = [
Expand Down
3 changes: 1 addition & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
bottleneck >= 1, < 2
click >= 8, < 9
geographiclib >= 2, < 3
hdf5 < 2
ipdb >= 0.13, < 0.14
ipykernel < 7
jinja2 >= 3, < 4
jsonschema >= 4, < 5
libnetcdf < 5
natsort >= 8, < 9
netcdf4 >= 1.2, < 1.7
numpy >= 1, < 2
pandas >= 2.1.3, < 2.2
pyomo >= 6.5, < 7
pyparsing >= 3.0, < 3.1
ruamel.yaml >= 0.17, < 0.18
typing-extensions >= 4, < 5
xarray >= 2023.10, < 2024.3

0 comments on commit dd92168

Please sign in to comment.