Commit a1fa874
swancustomenvironments: Add support for
Some constraints need to be taken into account:
- `pyproject.toml` does not use `-r` for installing its requirements. Instead, needs to be specified by its folder path.
- For this reason, the `REQ_PATH` must be changed right before it is used for installation. Since it is also used for checking the presence of `nxcals` in it.
- The precedence must follow the following order:
- `requirements.txt` -> `pyproject.toml` -> `requirements.in`
- One of the packages included in the environment is the project's package itself, which will point to its path during the installation process. However, as we later on move the project to `SWAN_projects`, the reference will still point to `/tmp/<project_name>`.
- This represents a problem because after the first clone of the project, if the user generates a `requirements.txt` file, it will still be pointing to `/tmp`. And since the project is no longer there, the next creation of the environment will continuously fail.
- For fixing this, the simplest way is to reinstall the requirements right after moving the project out of `/tmp`. Since all its dependencies are installed already, they will be automatically skipped and only the project package's reference will get updated, which makes this reinstallation process way faster
- Example of a well referenced package `acc-py-example-package @ file:///eos/user/r/rhenriqu/SWAN_projects/python-package`pyproject.toml
1 parent a99e31a commit a1fa874
3 files changed
+33
-6
lines changedLines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | | - | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| 185 | + | |
184 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
185 | 191 | | |
186 | 192 | | |
187 | 193 | | |
| 194 | + | |
188 | 195 | | |
189 | 196 | | |
190 | | - | |
191 | | - | |
| 197 | + | |
| 198 | + | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
| |||
249 | 256 | | |
250 | 257 | | |
251 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
252 | 266 | | |
253 | 267 | | |
254 | 268 | | |
| |||
0 commit comments