From dd9216885cece6fdf5d624abdcb8fc0f50beaf73 Mon Sep 17 00:00:00 2001 From: Bryn Pickering <17178478+brynpickering@users.noreply.github.com> Date: Fri, 26 Jan 2024 19:51:20 +0100 Subject: [PATCH] Pre-release fixes (#550) * Fix CI version getter and add pip build tests * Update dependencies --- .github/workflows/pr-ci.yml | 30 +++++++++++++++++++++++++++--- CHANGELOG.md | 3 +-- docs/index.md | 7 +++++++ docs/installation.md | 23 ++++++++++++++--------- pyproject.toml | 2 +- requirements/base.txt | 3 +-- 6 files changed, 51 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 8ec52c30..d2b838a6 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b6410be..be6217d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. @@ -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. diff --git a/docs/index.md b/docs/index.md index efda8fe6..a04dc6d1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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: @@ -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)). diff --git a/docs/installation.md b/docs/installation.md index 02341875..d12d6a4c 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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 @@ -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. @@ -38,7 +42,8 @@ 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 @@ -46,7 +51,7 @@ Read the next section for more information on installing alternative solvers. 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 diff --git a/pyproject.toml b/pyproject.toml index 05d657f0..a6852eae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/requirements/base.txt b/requirements/base.txt index 17bccb74..449438dd 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,12 +1,10 @@ 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 @@ -14,4 +12,5 @@ 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 \ No newline at end of file