Skip to content

Commit 17a45db

Browse files
Add instructions for correct usage of setup_miniconda.sh. (#126)
* Add instructions for correct usage of setup_miniconda.sh. Update Conda to 23 and adapt README.md and tmpl/README.md.j2 accordingly. * Update README with copier version * update miniconda version --------- Co-authored-by: Claire Merker <34312518+clairemerker@users.noreply.github.com> Co-authored-by: clairemerker <claire.merker@meteoswiss.ch>
1 parent 1c7d6f2 commit 17a45db

2 files changed

Lines changed: 55 additions & 4 deletions

File tree

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,39 @@ More information on the tools, intended workflow, etc. can be found on
88
GH pages of this repository (https://meteoswiss-apn.github.io/mch-python-blueprint/).
99

1010
## Preparation
11+
1112
Ensure that your active Python version is 3.7 or higher.
12-
The recommended way to manage Python versions is with `Conda` (https://docs.conda.io/en/latest/). On CSCS machines it is recommended to install the leaner `Miniconda` (https://docs.conda.io/en/latest/miniconda.html), which offers enough functionality for most of our use cases. If you don't want to do this step manually, you can also use the script that is provided in the copier template `tmpl/tools/setup_miniconda.sh`.
13+
The recommended way to manage Python versions is with `Conda`
14+
(https://docs.conda.io/en/latest/).
15+
On CSCS machines it is recommended to install the leaner `Miniconda`
16+
(https://docs.conda.io/en/latest/miniconda.html),
17+
which offers enough functionality for most of our use cases.
18+
If you don't want to do this step manually, you may use the script that is
19+
provided in the copier template `tmpl/tools/setup_miniconda.sh`.
20+
The default installation path of this script is the current working directory,
21+
you might want to change that with the `-p` option to a common location for all
22+
environments, like e.g. `$SCRATCH`. If you want the script to immediately
23+
initialize conda (executing `conda init` and thereby adding a few commands at the
24+
end of your `.bashrc`) after installation, add the `-u` option:
25+
26+
```bash
27+
tmpl/tools/setup_miniconda.sh -p $SCRATCH -u
28+
```
29+
30+
In case you ever need to uninstall miniconda, do the following:
31+
32+
```bash
33+
conda init --reverse --all
34+
rm -rf $SCRATCH/miniconda
35+
```
1336

1437
## Install Copier
1538

16-
First you have to install copier and its requirements. Ideally you do it in a conda environment. Either manually
39+
First you have to install copier and its requirements. Ideally you do this in a conda environment:
1740
```bash
1841
conda create --name blueprint
1942
conda activate blueprint
20-
conda install pip
21-
pip install copier
43+
conda install "copier<8.0"
2244
```
2345

2446
## Create your Python package from our template

tmpl/README.md.j2

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# {{ project_name }}: {{ project_short_description }}
22

3+
## Preparation
4+
5+
This project has been created from the
6+
[MeteoSwiss Python blueprint](https://github.com/MeteoSwiss-APN/mch-python-blueprint)
7+
for the CSCS.
8+
The recommended way to manage Python versions is with `Conda`
9+
(https://docs.conda.io/en/latest/).
10+
On CSCS machines it is recommended to install the leaner `Miniconda`
11+
(https://docs.conda.io/en/latest/miniconda.html),
12+
which offers enough functionality for most of our use cases.
13+
If you don't want to do this step manually, you may use the script
14+
`tools/setup_miniconda.sh`.
15+
The default installation path of this script is the current working directory,
16+
you might want to change that with the `-p` option to a common location for all
17+
environments, like e.g. `$SCRATCH`. If you want the script to immediately
18+
initialize conda (executing `conda init` and thereby adding a few commands at the
19+
end of your `.bashrc`) after installation, add the `-u` option:
20+
21+
```bash
22+
tmpl/tools/setup_miniconda.sh -p $SCRATCH -u
23+
```
24+
25+
In case you ever need to uninstall miniconda, do the following:
26+
27+
```bash
28+
conda init --reverse --all
29+
rm -rf $SCRATCH/miniconda
30+
```
31+
332
## Start developing
433

534
Once you created or cloned this repository, make sure the installation is running properly. Install the package dependencies with the provided script `setup_env.sh`.

0 commit comments

Comments
 (0)