Skip to content

Commit f9ca8e8

Browse files
authored
Release v1.4.0 (#19)
2 parents fca82d7 + dd3ea53 commit f9ca8e8

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.github/workflows/run_tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ name: Linting and tests
55

66
on:
77
push:
8-
branches: [ "main", "release/*" ]
8+
branches: [ "main" ]
99
pull_request:
10+
branches: [ "main", "release/**", "develop" ]
1011

1112
permissions:
1213
contents: read

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
## [Unreleased](https://github.com/SallingGroup-AI-and-ML/venv-cli/tree/develop)
44

5+
## [v1.4.0](https://github.com/SallingGroup-AI-and-ML/venv-cli/releases/tag/v1.4.0) (2023-10-30)
6+
7+
### Minor changes
8+
* `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)
9+
* `venv install` now runs `venv clear` before installation. This ensures that the enrivonment doesn't end up with orphaned packages after making changes to `requirements.txt`. [#9](https://github.com/SallingGroup-AI-and-ML/venv-cli/issues/9)
10+
511
## [v1.3.0](https://github.com/SallingGroup-AI-and-ML/venv-cli/releases/tag/v1.3.0) (2023-10-30)
612

7-
## Major changes
13+
### Major changes
814
* `venv lock` no longer tries to fill in credentials for packages installed via VCS. This behavior was undocumented and difficult to maintain and ultimately tried to alleviate a shortcoming of the way `pip` handles these credentials. [#11](https://github.com/SallingGroup-AI-and-ML/venv-cli/pull/11)
915
For users who have credentials as part of URLs in their `requirements.txt` files, there are other ways to handle credentials, e.g. filling them in `requirements.lock` manually, using a `.netrc` file to store the credetials or using a keyring. See https://pip.pypa.io/en/stable/topics/authentication/ for more info.
1016

src/venv-cli/venv.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _yellow="\033[01;33m"
99
_red="\033[31m"
1010

1111
# Version number has to follow pattern "^v\d+\.\d+\.\d+.*$"
12-
_version="v1.3.0"
12+
_version="v1.4.0"
1313

1414
# Valid VCS URL environment variable pattern
1515
# https://peps.python.org/pep-0610/#specification
@@ -167,8 +167,8 @@ venv::install() {
167167
if venv::_check_if_help_requested "$1"; then
168168
echo "venv install [<requirements file>] [--skip-lock] [<install args>]"
169169
echo
170-
echo "Install requirements from <requirements file>, like 'requirements.txt'"
171-
echo "or 'requirements.lock'."
170+
echo "Clear the environment, then install requirements from <requirements file>,"
171+
echo "like 'requirements.txt' or 'requirements.lock'."
172172
echo "Installed packages are then locked into the corresponding .lock-file,"
173173
echo "e.g. 'venv install requirements.txt' will lock packages into 'requirements.lock'."
174174
echo "This step is skipped if '--skip-lock' is specified, or when installing"
@@ -211,6 +211,10 @@ venv::install() {
211211
shift
212212
fi
213213

214+
# Clear the environment before running pip install to avoid orphaned packages
215+
# https://github.com/SallingGroup-AI-and-ML/venv-cli/issues/9
216+
venv::clear
217+
214218
venv::color_echo "${_green}" "Installing requirements from ${requirements_file}"
215219
if ! pip install --require-virtualenv --use-pep517 -r "${requirements_file}" "$@"; then
216220
return "${_fail}"
@@ -301,7 +305,10 @@ venv::clear() {
301305
venv::sync() {
302306
if venv::_check_if_help_requested "$1"; then
303307
echo "venv sync [<lock file>]"
304-
echo
308+
echo ""
309+
echo "DEPRECATED: This command is deprecated and will be removed in version 2.0."
310+
echo "Use 'venv install <requirements.lock>' instead."
311+
echo ""
305312
echo "Remove all installed packages from the environment (venv clear)"
306313
echo "and install all packages specified in <lock file>."
307314
echo "The <lock file> must be in the form '*requirements.lock'."
@@ -318,6 +325,8 @@ venv::sync() {
318325
return "${_success}"
319326
fi
320327

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+
321330
local lock_file
322331
if [ -z "$1" ]; then
323332
# If no argument passed

0 commit comments

Comments
 (0)