Skip to content

Commit

Permalink
redo all the change in #1400
Browse files Browse the repository at this point in the history
  • Loading branch information
Jingru923 committed May 6, 2024
1 parent 158fd05 commit d97d984
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/core_testmodels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
pixi-version: "latest"
- name: Prepare pixi
run: pixi run --environment=dev install-ci
run: pixi run install-ci
- name: Run testmodels with Ribasim Core
run: |
pixi run ribasim-core-testmodels
2 changes: 1 addition & 1 deletion .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
pixi-version: "latest"
- name: Prepare pixi
run: pixi run --environment=dev install-ci
run: pixi run install-ci
- name: Test Ribasim Core
run: |
pixi run test-ribasim-core-cov
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
pixi-version: "latest"
- name: Prepare pixi
run: pixi run --environment=dev install-ci
run: pixi run install-ci

- name: Check Quarto installation and all engines
run: pixi run quarto-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
pixi-version: "latest"
- name: Prepare pixi
run: pixi run --environment=dev install-ci
run: pixi run install-ci
- name: Run mypy on python/ribasim
run: |
pixi run mypy-ribasim-python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python_codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
pixi-version: "latest"
- name: Prepare pixi
run: pixi run --environment=dev install-ci
run: pixi run install-ci
- name: Test if codegen runs without errors
run: pixi run codegen
- name: Ensure that no code has been generated
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qgis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
pixi-version: "latest"
- name: Prepare pixi
run: |
pixi run --environment=dev install-ci
pixi run install-ci
- name: Run tests
run: pixi run test-ribasim-qgis-cov
- name: Upload coverage to Codecov
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source /usr/share/Modules/init/bash

module load pixi
pixi --version
pixi run --environment=dev install-ci]]></param>
pixi run install-ci]]></param>
<param name="teamcity.build.workingDir" value="ribasim" />
<param name="teamcity.step.mode" value="default" />
<param name="use.custom.script" value="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ source /usr/share/Modules/init/bash

module load pixi
pixi --version
pixi run --environment=dev install-ci]]></param>
pixi run install-ci]]></param>
<param name="teamcity.build.workingDir" value="ribasim" />
<param name="teamcity.step.mode" value="default" />
<param name="use.custom.script" value="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pixi run install-python]]></param>
source /usr/share/Modules/init/bash

module load pixi
pixi run --environment=dev install
pixi run install
pixi run test-ribasim-api
pixi run test-ribasim-cli]]></param>
<param name="teamcity.build.workingDir" value="ribasim" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<runner id="RUNNER_2415" name="Set up pixi" type="simpleRunner">
<parameters>
<param name="script.content"><![CDATA[pixi --version
pixi run --environment=dev install-ci]]></param>
pixi run install-ci]]></param>
<param name="teamcity.build.workingDir" value="ribasim" />
<param name="teamcity.step.mode" value="default" />
<param name="use.custom.script" value="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</runner>
<runner id="RUNNER_1503" name="Run tests" type="simpleRunner">
<parameters>
<param name="script.content"><![CDATA[pixi run --environment=dev install
<param name="script.content"><![CDATA[pixi run install
pixi run test-ribasim-api
pixi run test-ribasim-cli]]></param>
<param name="teamcity.build.workingDir" value="ribasim" />
Expand Down
2 changes: 1 addition & 1 deletion docs/contribute/core.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You can let it start automatically by following these [instructions](https://tim
There is a section on editors and IDEs for Julia on <https://julialang.org/>, scroll down to see it.
We use and recommend Microsoft's free editor [Visual Studio Code](https://code.visualstudio.com/).
When combined with the [Julia extension](https://www.julia-vscode.org/) it provides a powerful and interactive development experience.
Make sure to have the correct environment when opening your IDE by running `open-vscode.bat`, or opening a `pixi --environment=dev shell` and then calling the command to open the editor of your choice.
Make sure to have the correct environment when opening your IDE by running `open-vscode.bat`, or opening a `pixi shell` and then calling the command to open the editor of your choice.

# Developing on Ribasim

Expand Down
2 changes: 1 addition & 1 deletion docs/contribute/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ First, set up pixi as described on their getting started [page](https://prefix.d
Then set up the environment by running the following commands:

```sh
pixi run --environment=dev install
pixi run install
```

This will automatically install all required packages for development.
Expand Down
4 changes: 2 additions & 2 deletions docs/contribute/qgis.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: "QGIS plugin development"
# Set up the developer environment

After you have installed the environment as described [here](index.qmd) you must still activate the QGIS plugins.
The simplest way to do this is by running `pixi run --environment=dev install-qgis-plugins`.
The simplest way to do this is by running `pixi run install-qgis-plugins`.
It grabs the latest version of the iMOD QGIS plugin and it makes a symlink to the ribasim_qgis folder so that QGIS can find it.
It also installs plugins that make it possible to reload and debug your plugin while QGIS is open.

Expand Down Expand Up @@ -36,7 +36,7 @@ Then simply call `pixi run test-ribasim-qgis`.

# Debugging

After installing the plugins via `pixi run --environment=dev install-qgis-plugins`.
After installing the plugins via `pixi run install-qgis-plugins`.
Extra debugging tools are also installed in QGIS that is installed within your pixi environment.

After you have started `pixi run qgis`, you can make alterations to the Python code and use the [Plugin Reloader](https://github.com/borysiasty/plugin_reloader) to reload the plugin without restarting QGIS.
Expand Down
2 changes: 1 addition & 1 deletion open-vscode.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pixi run --environment=dev code . | exit
pixi run code . | exit
14 changes: 4 additions & 10 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ documentation = "https://deltares.github.io/Ribasim/"
repository = "https://github.com/Deltares/Ribasim"

[tasks]
# Installation
install-ribasim-python = "pip install --no-build-isolation --no-deps --disable-pip-version-check --editable python/ribasim"
install-ribasim-api = "pip install --no-build-isolation --no-deps --disable-pip-version-check --editable python/ribasim_api"
install-ribasim-testmodels = "pip install --no-build-isolation --no-deps --disable-pip-version-check --editable python/ribasim_testmodels"
install-python = { depends_on = [
"install-ribasim-python",
"install-ribasim-api",
"install-ribasim-testmodels",
] }
# Tests
test-ribasim-python = "pytest --numprocesses=4 python/ribasim/tests"
test-ribasim-python-cov = "pytest --numprocesses=4 --cov=ribasim --cov-report=xml python/ribasim/tests"
Expand All @@ -32,7 +23,6 @@ test-ribasim-api = "pytest --basetemp=python/ribasim_api/tests/temp --junitxml=r
install-julia = "juliaup add 1.10.3 && juliaup default 1.10.3"
install-pre-commit = "pre-commit install"
install-ci = { depends_on = [
"install-python",
"install-julia",
"update-registry-julia",

Expand Down Expand Up @@ -184,6 +174,10 @@ xmipy = "*"
xugrid = "*"
xarray = "*"

[pypi-dependencies]
ribasim = { path = "python/ribasim", editable = true }
ribasim_api = { path = "python/ribasim_api", editable = true }
ribasim_testmodels = { path = "python/ribasim_testmodels", editable = true }

[feature.dev.dependencies]
build = "*"
Expand Down

0 comments on commit d97d984

Please sign in to comment.