Skip to content

Commit

Permalink
Fixing .f12 scripts for python packages
Browse files Browse the repository at this point in the history
There were two problems:

1. The `*` glob pattern was not functioning because of the quotes

2. The `--target` option does not work in combination with namespace
   packages: pypa/pip#10110

Both problems would have been caught in the first place if this has been
thoroughly tested. Sorry.

Change-Id: I2e0829cb9fbe160289e7340d79087a62563121a1
  • Loading branch information
BenediktSeidl committed Mar 26, 2024
1 parent 86d2e57 commit 88914a1
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 8 deletions.
6 changes: 5 additions & 1 deletion packages/cmk-agent-based/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation.
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl
6 changes: 5 additions & 1 deletion packages/cmk-agent-receiver/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site.
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl

if [ -z "$ONLY_COPY" ]; then
Expand Down
6 changes: 5 additions & 1 deletion packages/cmk-graphing/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site.
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl

if [ -z "$ONLY_COPY" ]; then
Expand Down
6 changes: 5 additions & 1 deletion packages/cmk-livestatus-client/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site.
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl

if [ -z "$ONLY_COPY" ]; then
Expand Down
6 changes: 5 additions & 1 deletion packages/cmk-mkp-tool/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site.
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl

if [ -z "$ONLY_COPY" ]; then
Expand Down
6 changes: 5 additions & 1 deletion packages/cmk-rulesets/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site.
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl

if [ -z "$ONLY_COPY" ]; then
Expand Down
6 changes: 5 additions & 1 deletion packages/cmk-server-side-calls/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site.
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl

if [ -z "$ONLY_COPY" ]; then
Expand Down
6 changes: 5 additions & 1 deletion packages/cmk-werks/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@

pipenv run pip wheel --no-deps --wheel-dir build .

# pip installs the package in the user directory in case of missing permissions
# this might be surprising and hard to spot, so we force the global installation
# hint: use `omd-setup-version-for-dev` to fix permissions of the checkmk site.
export PYTHONNOUSERSITE=1

"/omd/sites/${SITE}/bin/python3" -m pip install \
--no-deps \
--upgrade \
--force-reinstall \
--isolated \
--target "/omd/sites/${SITE}/lib/python3.*/site-packages/" \
./build/*-*-py3-none-any.whl

if [ -z "$ONLY_COPY" ]; then
Expand Down

0 comments on commit 88914a1

Please sign in to comment.