You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`venv sync` has been removed. Use `venv install <requirements>.lock` instead. [#17](https://github.com/SallingGroup-AI-and-ML/venv-cli/pull/17)
4
7
5
8
### Minor changes
6
9
*`venv sync` command marked as deprecated with removal planned for `v2.0`. Use `venv install <requirements>.lock` instead. [#14](https://github.com/SallingGroup-AI-and-ML/venv-cli/pull/14)
Copy file name to clipboardExpand all lines: README.md
+2-9Lines changed: 2 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,19 +126,12 @@ matplotlib
126
126
The `-r requirements.txt` will make sure that installing development requirements also install production requirements.
127
127
128
128
## Reproducing environment
129
-
To install a reproducible environment, you need to install from a `.lock`-file, since those have all versions of all requirements locked[^1]. From a clean environment (no packages installed yet), run
129
+
To install a reproducible environment, you need to install from a `.lock`-file, since those have all versions of all requirements locked[^1]:
130
130
```console
131
131
$ venv install requirements.lock
132
132
```
133
133
134
-
If you don't have a clean environment, but still want to recreate the environment as it was when the requirements were locked, you can run
135
-
```console
136
-
$ venv sync requirements.lock
137
-
```
138
-
139
-
This will first remove all installed packages, then run `venv install requirements.lock`.
140
-
141
-
**NOTE: Since this command is meant to create a reproducable environment, you cannot `sync` to a `.txt` file; it has to be a `.lock` file.**
134
+
This will first clear the environment of any installed packages, then install the packages and versions specified in `requirements.lock`.
142
135
143
136
## Clearing the environment
144
137
If you want to manually clear the environment, you can run
echo"Remove all installed packages from the environment (venv clear)"
313
-
echo"and install all packages specified in <lock file>."
314
-
echo"The <lock file> must be in the form '*requirements.lock'."
315
-
echo
316
-
echo"If no <lock file> is specified, defaults to 'requirements.lock'."
317
-
echo
318
-
echo"Examples:"
319
-
echo"$ venv sync dev-requirements.lock"
320
-
echo"Clears the environment and installs requirements from 'dev-requirements.lock'."
321
-
echo
322
-
echo"$ venv sync"
323
-
echo"Tries to install from 'requirements.lock'."
324
-
echo"Clears the environment and installs requirements from 'requirements.lock'."
325
-
return"${_success}"
326
-
fi
327
-
328
-
venv::color_echo "${_yellow}""DEPRECATED: This command is deprecated and will be removed in version 2.0. Use 'venv install <requirements.lock>' instead."
329
-
330
-
local lock_file
331
-
if [ -z"$1" ];then
332
-
# If no argument passed
333
-
lock_file="requirements.lock"
334
-
335
-
# If full lock file passed
336
-
else
337
-
if! venv::_check_lock_requirements_file "$1""Can only sync using .lock file";then
338
-
return"${_fail}"
339
-
fi
340
-
341
-
lock_file="$1"
342
-
shift
343
-
fi
344
-
345
-
venv::clear
346
-
venv::install "${lock_file}""$@"
347
-
return"$?"# Return exit status from venv::install command
348
-
}
349
-
350
-
351
305
venv::help() {
352
306
echo"Utility to help create and manage python virtual environments."
353
307
echo"Lightweight wrapper around pip and venv."
@@ -361,8 +315,6 @@ venv::help() {
361
315
echo"install Install requirements from a requirements file in the current environment"
362
316
echo"lock Lock installed requirements in a '.lock'-file"
363
317
echo"clear Remove all installed packages in the current environment"
364
-
echo"sync Run 'venv clear', then install locked requirements from a"
365
-
echo" '.lock'-file in the current environment"
366
318
echo"deactivate Deactivate the currently activated virtual environment"
367
319
echo"-h, --help Show this help and exit"
368
320
echo"-v, --version Show the venv-cli version number and exit"
0 commit comments