Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add '--no-update' option #27

Merged
merged 2 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,13 @@ jobs:
- name: Remove venv "${{ matrix.venv-name }}"
run: |
rm -rf ${{ matrix.venv-name }}

- name: Setup default venv with --no-update option
run: |
. cvmfs-venv --no-update
echo "# Python runtime: $(command -v python)"
python --version --version
echo "# python -m pip list"
python -m pip list
echo "# python -m pip list --local"
python -m pip list --local
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Usage: cvmfs-venv [-s|--setup] <virtual environment name>
Options:
-h --help Print this help message
-s --setup String of setup options to be parsed
--no-update After venv creation don't update pip, setuptools, and wheel
to the latest releases. Use of this option is not recommended,
but is faster.

Note: cvmfs-venv extends the Python venv module and so requires Python 3.3+.

Expand Down
14 changes: 12 additions & 2 deletions cvmfs-venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ export PIP_REQUIRE_VIRTUALENV=true

_help_options () {
cat <<EOF
Usage: cvmfs-venv [-s|--setup] <virtual environment name>
Usage: cvmfs-venv [-s|--setup] [--no-update] <virtual environment name>

Options:
-h --help Print this help message
-s --setup String of setup options to be parsed
--no-update After venv creation don't update pip, setuptools, and wheel
to the latest releases. Use of this option is not recommended,
but is faster.

Note: cvmfs-venv extends the Python venv module and so requires Python 3.3+.

Expand Down Expand Up @@ -62,6 +65,10 @@ while [ $# -gt 0 ]; do
_setup_command="${2}"
shift 2
;;
--no-update)
_no_update=true
shift
;;
--)
shift
break
Expand Down Expand Up @@ -318,10 +325,13 @@ fi

# Get latest pip, setuptools, wheel
# Hide not-real errors from CVMFS by sending to /dev/null
python -m pip --quiet install --upgrade pip setuptools wheel &> /dev/null
if [ -z "${_no_update}" ]; then
python -m pip --quiet install --upgrade pip setuptools wheel &> /dev/null
fi

unset _venv_name

fi # _return_break if statement end

unset _return_break
unset _no_update