c2cciutils 1.7.0.dev323__tar.gz → 1.7.0.dev326__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of c2cciutils might be problematic. Click here for more details.
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/PKG-INFO +1 -1
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/__init__.py +0 -8
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/audit.py +1 -2
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/env.py +0 -7
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/lib/docker.py +0 -2
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/publish.py +7 -5
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/clean.py +0 -1
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/docker_versions_gen.py +0 -1
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/download_applications.py +0 -2
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/trigger_image_update.py +0 -1
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/version.py +0 -1
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/pyproject.toml +5 -4
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/LICENSE +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/README.md +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/applications-versions.yaml +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/applications.yaml +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/applications_definition.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/branches.graphql +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/commits.graphql +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/configuration.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/default_branch.graphql +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/lib/oidc.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/package-lock.json +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/package.json +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/pr_checks.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/schema-applications.json +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/schema.json +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/__init__.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/audit.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/docker_logs.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/env.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/k8s/__init__.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/k8s/db.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/k8s/install.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/k8s/logs.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/k8s/wait.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/main.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/pin_pipenv.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/pr_checks.py +0 -0
- {c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/publish.py +0 -0
|
@@ -22,7 +22,6 @@ def get_repository() -> str:
|
|
|
22
22
|
"""
|
|
23
23
|
Get the current GitHub repository like `organization/project`.
|
|
24
24
|
"""
|
|
25
|
-
|
|
26
25
|
if "GITHUB_REPOSITORY" in os.environ:
|
|
27
26
|
return os.environ["GITHUB_REPOSITORY"]
|
|
28
27
|
|
|
@@ -47,7 +46,6 @@ def merge(default_config: Any, config: Any) -> Any:
|
|
|
47
46
|
default_config: The default config that will be applied
|
|
48
47
|
config: The base config, will be modified
|
|
49
48
|
"""
|
|
50
|
-
|
|
51
49
|
if not isinstance(default_config, dict) or not isinstance(config, dict):
|
|
52
50
|
return config
|
|
53
51
|
|
|
@@ -79,7 +77,6 @@ def get_config() -> c2cciutils.configuration.Configuration:
|
|
|
79
77
|
"""
|
|
80
78
|
Get the configuration, with project and auto detections.
|
|
81
79
|
"""
|
|
82
|
-
|
|
83
80
|
config: c2cciutils.configuration.Configuration = {}
|
|
84
81
|
if os.path.exists("ci/config.yaml"):
|
|
85
82
|
with open("ci/config.yaml", encoding="utf-8") as open_file:
|
|
@@ -279,7 +276,6 @@ def print_versions(config: c2cciutils.configuration.PrintVersions) -> bool:
|
|
|
279
276
|
Arguments:
|
|
280
277
|
config: The print configuration
|
|
281
278
|
"""
|
|
282
|
-
|
|
283
279
|
for version in config.get("versions", c2cciutils.configuration.PRINT_VERSIONS_VERSIONS_DEFAULT):
|
|
284
280
|
try:
|
|
285
281
|
sys.stdout.flush()
|
|
@@ -383,7 +379,6 @@ def graphql(query_file: str, variables: dict[str, Any], default: Any = None) ->
|
|
|
383
379
|
Return the data result
|
|
384
380
|
In case of error it throw an exception
|
|
385
381
|
"""
|
|
386
|
-
|
|
387
382
|
with open(os.path.join(os.path.dirname(__file__), query_file), encoding="utf-8") as query_open:
|
|
388
383
|
query = query_open.read()
|
|
389
384
|
|
|
@@ -460,7 +455,6 @@ def get_branch(branch: Optional[str], master_branch: str = "master") -> str:
|
|
|
460
455
|
|
|
461
456
|
Return the branch name
|
|
462
457
|
"""
|
|
463
|
-
|
|
464
458
|
if branch is not None:
|
|
465
459
|
return branch
|
|
466
460
|
try:
|
|
@@ -573,7 +567,6 @@ def get_codespell_command(config: c2cciutils.configuration.Configuration, fix: b
|
|
|
573
567
|
|
|
574
568
|
def snyk_exec() -> tuple[str, dict[str, str]]:
|
|
575
569
|
"""Get the Snyk cli executable path."""
|
|
576
|
-
|
|
577
570
|
if not os.path.exists(os.path.join(os.path.dirname(__file__), "node_modules")):
|
|
578
571
|
subprocess.run(["npm", "install"], cwd=os.path.dirname(__file__), check=True) # nosec
|
|
579
572
|
|
|
@@ -598,7 +591,6 @@ def create_pull_request_if_needed(
|
|
|
598
591
|
"""
|
|
599
592
|
Create a pull request if there are changes.
|
|
600
593
|
"""
|
|
601
|
-
|
|
602
594
|
if pull_request_extra_arguments is None:
|
|
603
595
|
pull_request_extra_arguments = ["--fill"]
|
|
604
596
|
|
|
@@ -7,8 +7,6 @@ import subprocess # nosec
|
|
|
7
7
|
import sys
|
|
8
8
|
from argparse import Namespace
|
|
9
9
|
|
|
10
|
-
import security_md
|
|
11
|
-
|
|
12
10
|
import c2cciutils
|
|
13
11
|
import c2cciutils.configuration
|
|
14
12
|
|
|
@@ -160,6 +158,7 @@ def snyk(
|
|
|
160
158
|
snyk_fix_message = snyk_fix_proc.stdout.strip()
|
|
161
159
|
print("::endgroup::")
|
|
162
160
|
|
|
161
|
+
has_diff = False
|
|
163
162
|
if not args.fix:
|
|
164
163
|
current_branch = c2cciutils.get_branch(args.branch)
|
|
165
164
|
fix_github_create_pull_request_arguments = config.get(
|
|
@@ -43,7 +43,6 @@ def print_environment_variables() -> None:
|
|
|
43
43
|
"""
|
|
44
44
|
Print the environment variables.
|
|
45
45
|
"""
|
|
46
|
-
|
|
47
46
|
for name, value in sorted(os.environ.items()):
|
|
48
47
|
if name != "GITHUB_EVENT":
|
|
49
48
|
print(f"{name}: {value}")
|
|
@@ -53,7 +52,6 @@ def print_github_event_file() -> None:
|
|
|
53
52
|
"""
|
|
54
53
|
Print the GitHub event file.
|
|
55
54
|
"""
|
|
56
|
-
|
|
57
55
|
if "GITHUB_EVENT_PATH" in os.environ:
|
|
58
56
|
with open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8") as event:
|
|
59
57
|
print(event.read())
|
|
@@ -63,7 +61,6 @@ def print_github_event_object() -> None:
|
|
|
63
61
|
"""
|
|
64
62
|
Print the GitHub event object.
|
|
65
63
|
"""
|
|
66
|
-
|
|
67
64
|
github_event = json.loads(os.environ["GITHUB_EVENT"])
|
|
68
65
|
print(yaml.dump(github_event, indent=2))
|
|
69
66
|
|
|
@@ -72,7 +69,6 @@ def print_python_package_version() -> None:
|
|
|
72
69
|
"""
|
|
73
70
|
Print the version of the Python packages.
|
|
74
71
|
"""
|
|
75
|
-
|
|
76
72
|
subprocess.run(["python3", "-m", "pip", "freeze", "--all"]) # pylint: disable=subprocess-run-check
|
|
77
73
|
|
|
78
74
|
|
|
@@ -80,7 +76,6 @@ def print_node_package_version() -> None:
|
|
|
80
76
|
"""
|
|
81
77
|
Print the version of the Python packages.
|
|
82
78
|
"""
|
|
83
|
-
|
|
84
79
|
subprocess.run(["npm", "list", "--global"]) # pylint: disable=subprocess-run-check
|
|
85
80
|
|
|
86
81
|
|
|
@@ -88,13 +83,11 @@ def print_debian_package_version() -> None:
|
|
|
88
83
|
"""
|
|
89
84
|
Print the version of the Python packages.
|
|
90
85
|
"""
|
|
91
|
-
|
|
92
86
|
subprocess.run(["dpkg", "--list"]) # pylint: disable=subprocess-run-check
|
|
93
87
|
|
|
94
88
|
|
|
95
89
|
def print_environment(config: c2cciutils.configuration.Configuration, prefix: str = "Print ") -> None:
|
|
96
90
|
"""Print the GitHub environment information."""
|
|
97
|
-
|
|
98
91
|
functions = [
|
|
99
92
|
(
|
|
100
93
|
"version",
|
|
@@ -26,7 +26,6 @@ def get_dpkg_packages_versions(
|
|
|
26
26
|
Where `debian_11` corresponds on last path element for 'Debian 11'
|
|
27
27
|
from https://repology.org/repositories/statistics
|
|
28
28
|
"""
|
|
29
|
-
|
|
30
29
|
dpkg_configuration = c2cciutils.get_config().get("dpkg", {})
|
|
31
30
|
|
|
32
31
|
os_release = {}
|
|
@@ -127,7 +126,6 @@ def check_versions(
|
|
|
127
126
|
The versions of packages in the image should be present in the config file.
|
|
128
127
|
The versions of packages in the image shouldn't be older than the versions of the config file.
|
|
129
128
|
"""
|
|
130
|
-
|
|
131
129
|
result, versions_image = get_dpkg_packages_versions(image, default_distribution, default_release)
|
|
132
130
|
if not result:
|
|
133
131
|
return False
|
|
@@ -72,7 +72,7 @@ class GoogleCalendar:
|
|
|
72
72
|
with open(self.credentials_pickle_file, "rb") as token:
|
|
73
73
|
creds = pickle.load(token) # nosec
|
|
74
74
|
# If there are no (valid) credentials available, let the user log in.
|
|
75
|
-
if not creds or not creds.valid:
|
|
75
|
+
if not creds or not creds.valid: # pylint: disable=possibly-used-before-assignment
|
|
76
76
|
if creds and creds.expired and creds.refresh_token:
|
|
77
77
|
creds.refresh(Request()) # type: ignore
|
|
78
78
|
else:
|
|
@@ -194,6 +194,9 @@ class GoogleCalendar:
|
|
|
194
194
|
c2cciutils.gopass_put(secret, key)
|
|
195
195
|
|
|
196
196
|
def __del__(self) -> None:
|
|
197
|
+
"""
|
|
198
|
+
Delete the credentials file.
|
|
199
|
+
"""
|
|
197
200
|
if os.path.exists(self.credentials_pickle_file):
|
|
198
201
|
os.remove(self.credentials_pickle_file)
|
|
199
202
|
|
|
@@ -228,7 +231,9 @@ def main_calendar() -> None:
|
|
|
228
231
|
parser.print_help()
|
|
229
232
|
|
|
230
233
|
if args.show_events_since:
|
|
231
|
-
google_calendar.print_latest_events(
|
|
234
|
+
google_calendar.print_latest_events( # pylint: disable=possibly-used-before-assignment
|
|
235
|
+
args.show_events_since
|
|
236
|
+
)
|
|
232
237
|
|
|
233
238
|
if args.refresh_gopass_credentials:
|
|
234
239
|
google_calendar.save_credentials_to_gopass()
|
|
@@ -250,7 +255,6 @@ def pip(
|
|
|
250
255
|
publish: If False only check the package
|
|
251
256
|
package: The package configuration
|
|
252
257
|
"""
|
|
253
|
-
|
|
254
258
|
print(f"::group::{'Publishing' if publish else 'Checking'} '{package.get('path')}' to pypi")
|
|
255
259
|
sys.stdout.flush()
|
|
256
260
|
sys.stderr.flush()
|
|
@@ -349,7 +353,6 @@ def docker(
|
|
|
349
353
|
dst_tags: Publish using the provided tags
|
|
350
354
|
images_full: The list of published images (with tag), used to build the dispatch event
|
|
351
355
|
"""
|
|
352
|
-
|
|
353
356
|
print(
|
|
354
357
|
f"::group::Publishing {image_config['name']} to the server {name} using the tags {', '.join(dst_tags)}"
|
|
355
358
|
)
|
|
@@ -409,7 +412,6 @@ def helm(folder: str, version: str, owner: str, repo: str, commit_sha: str, toke
|
|
|
409
412
|
commit_sha: The sha of the current commit
|
|
410
413
|
token: The GitHub token
|
|
411
414
|
"""
|
|
412
|
-
|
|
413
415
|
print(f"::group::Publishing Helm chart from '{folder}' to GitHub release")
|
|
414
416
|
sys.stdout.flush()
|
|
415
417
|
sys.stderr.flush()
|
{c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/docker_versions_gen.py
RENAMED
|
@@ -7,7 +7,6 @@ import c2cciutils.lib.docker
|
|
|
7
7
|
|
|
8
8
|
def main() -> None:
|
|
9
9
|
"""Dump the actual versions of packages in image to file ci/dpkg-versions.yaml."""
|
|
10
|
-
|
|
11
10
|
argparser = argparse.ArgumentParser(
|
|
12
11
|
description="Dump the actual versions of packages in image to file ci/dpkg-versions.yaml."
|
|
13
12
|
)
|
{c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/download_applications.py
RENAMED
|
@@ -17,7 +17,6 @@ from c2cciutils import applications_definition
|
|
|
17
17
|
|
|
18
18
|
def main() -> None:
|
|
19
19
|
"""Download applications from GitHub releases or any other URLs to the ~/.local/bin folder."""
|
|
20
|
-
|
|
21
20
|
argparser = argparse.ArgumentParser(
|
|
22
21
|
description="""Download applications from GitHub releases or any other URLs to the ~/.local/bin folder.
|
|
23
22
|
Based on tow files, the first contains the information about from where to download the applications,
|
|
@@ -60,7 +59,6 @@ def download_applications(
|
|
|
60
59
|
applications: applications_definition.ApplicationsConfiguration, versions: dict[str, str]
|
|
61
60
|
) -> None:
|
|
62
61
|
"""Download the versions of applications specified in the configuration."""
|
|
63
|
-
|
|
64
62
|
bin_path = os.path.join(os.environ["HOME"], ".local", "bin")
|
|
65
63
|
if not os.path.exists(bin_path):
|
|
66
64
|
os.makedirs(bin_path)
|
{c2cciutils-1.7.0.dev323 → c2cciutils-1.7.0.dev326}/c2cciutils/scripts/trigger_image_update.py
RENAMED
|
@@ -63,7 +63,6 @@ def dispatch(repository: str, event_type: str, images_full: list[str]) -> None:
|
|
|
63
63
|
"""
|
|
64
64
|
Trigger an image update on the argocd repository.
|
|
65
65
|
"""
|
|
66
|
-
|
|
67
66
|
id_ = random.randint(1, 100000) # nosec
|
|
68
67
|
print(f"Triggering {event_type}:{id_} on {repository} with {','.join(images_full)}")
|
|
69
68
|
|
|
@@ -19,7 +19,7 @@ strict = true
|
|
|
19
19
|
|
|
20
20
|
[tool.poetry]
|
|
21
21
|
name = "c2cciutils"
|
|
22
|
-
version = "1.7.0.
|
|
22
|
+
version = "1.7.0.dev326"
|
|
23
23
|
description = "Common utilities for Camptocamp CI"
|
|
24
24
|
readme = "README.md"
|
|
25
25
|
authors = ["Camptocamp <info@camptocamp.com>"]
|
|
@@ -70,7 +70,7 @@ markdown-table = "2020.12.3"
|
|
|
70
70
|
python-magic = "0.4.27"
|
|
71
71
|
requests = "2.32.3"
|
|
72
72
|
Markdown = "3.7"
|
|
73
|
-
google-api-python-client = { version = "2.
|
|
73
|
+
google-api-python-client = { version = "2.148.0", optional = true }
|
|
74
74
|
google-auth-httplib2 = { version = "0.2.0", optional = true }
|
|
75
75
|
google-auth-oauthlib = { version = "1.2.1", optional = true }
|
|
76
76
|
"ruamel.yaml" = "0.18.6"
|
|
@@ -95,14 +95,15 @@ version = ["multi-repo-automation"]
|
|
|
95
95
|
|
|
96
96
|
[tool.poetry.group.dev.dependencies]
|
|
97
97
|
# pylint = "2.15.6"
|
|
98
|
-
prospector = { version = "1.
|
|
98
|
+
prospector = { version = "1.12.0", extras = ["with-bandit", "with-mypy", "with-pyroma"] }
|
|
99
|
+
prospector-profile-duplicated = "1.6.0"
|
|
100
|
+
prospector-profile-utils = "1.9.1"
|
|
99
101
|
types-requests = "2.32.0.20240914"
|
|
100
102
|
types-pyyaml = "6.0.12.20240917"
|
|
101
103
|
types-setuptools = "75.1.0.20240917"
|
|
102
104
|
types-markdown = "3.7.0.20240822"
|
|
103
105
|
types-toml = "0.10.8.20240310"
|
|
104
106
|
typing-extensions = "4.12.2"
|
|
105
|
-
prospector-profile-duplicated = "1.5.0"
|
|
106
107
|
|
|
107
108
|
[build-system]
|
|
108
109
|
requires = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|