Skip to content

Commit

Permalink
Revert "Make cmk-shared-typing a proper python module"
Browse files Browse the repository at this point in the history
This reverts commit 4f3c598.

As discussed, we would rather have a package that copies
files into cmk/ instead of an incomplete/incorrect bazel BUILD.

Since the python module has no runtime dependencies, the requirements.txt was completely removed. We added the dev dependencies
to  requirements_dev.txt instead.

This solution is far from optimal.

CMK-20927

Change-Id: Ia826e92e9bd40598324f6625aeea35c450485dc3
  • Loading branch information
cellador authored and Synss committed Jan 2, 2025
1 parent 119f54e commit 47a5f91
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 456 deletions.
3 changes: 0 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ REQUIREMENTS_CMK = [
"//packages/cmk-mkp-tool:requirements.txt",
"//packages/cmk-rulesets:requirements.txt",
"//packages/cmk-server-side-calls:requirements.txt",
# TODO: Move python related files to the python subdir in cmk-shared-typing
"//packages/cmk-shared-typing:requirements.txt",
"//packages/cmk-trace:requirements.txt",
"//packages/cmk-werks:requirements.txt",
] + select({
Expand Down Expand Up @@ -170,7 +168,6 @@ write_file(
"import sys",
"dirname = os.path.dirname(__file__)",
'sys.path.append(os.path.abspath(os.path.join(dirname, "../../../../")))',
'sys.path.append(os.path.abspath(os.path.join(dirname, "../../../../packages/cmk-shared-typing/python")))',
'relative_packages_path = "../../../../packages"',
"for p in os.listdir(os.path.join(dirname, relative_packages_path)):",
" sys.path.append(os.path.abspath(os.path.join(dirname, relative_packages_path, p)))",
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion buildscripts/scripts/stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ VARIABLES:
SH: "echo '${CHANGED_FILES_REL}' | grep '^packages/cmk-frontend-vue/' || true"

- NAME: CHANGED_SHARED_TYPING_FILES
SH: "echo '${CHANGED_FILES_REL}' | grep '^packages/cmk-shared-typing/' || true"
SH: "echo '${CHANGED_FILES_REL}' | grep '^packages/cmk-shared-typing/\\|^cmk/shared_typing/' || true"

- NAME: CHANGED_CMK_FRONTEND_FILES
SH: "echo '${CHANGED_FILES_REL}' | grep '^packages/cmk-frontend/' || true"
Expand Down
1 change: 0 additions & 1 deletion cmk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ CMK_PACKAGES = [
"//packages/cmk-mkp-tool",
"//packages/cmk-rulesets",
"//packages/cmk-server-side-calls",
"//packages/cmk-shared-typing",
"//packages/cmk-trace",
"//packages/cmk-werks",
] + select({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
# Copyright (C) 2024 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
#
# This file is auto-generated via the cmk-shared-typing package.
# Do not edit manually.
#
# fmt: off
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion omd/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ load("@aspect_rules_py//py:defs.bzl", "py_binary")
"//packages/cmk-mkp-tool:pkg_tar",
"//packages/cmk-rulesets:pkg_tar",
"//packages/cmk-server-side-calls:pkg_tar",
"//packages/cmk-shared-typing:pkg_tar",
"//packages/cmk-trace:pkg_tar",
"//packages/cmk-werks:pkg_tar",
] + edition_deps[edition],
Expand Down
14 changes: 0 additions & 14 deletions packages/cmk-shared-typing/.f12
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@

./run -b

../../scripts/run-bazel.sh build ":wheel"

# 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 \
"$(bazel info workspace)/$(bazel cquery :wheel --output=starlark --starlark:expr="target.files.to_list()[0].path")"

if [ -z "$ONLY_COPY" ]; then
sudo --login -u "$SITE" -- bash -c "omd reload apache"
fi
44 changes: 0 additions & 44 deletions packages/cmk-shared-typing/BUILD

This file was deleted.

17 changes: 0 additions & 17 deletions packages/cmk-shared-typing/pyproject.toml

This file was deleted.

202 changes: 0 additions & 202 deletions packages/cmk-shared-typing/python/cmk/shared_typing/graph_designer.py

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions packages/cmk-shared-typing/requirements.txt

This file was deleted.

Loading

0 comments on commit 47a5f91

Please sign in to comment.