csspin-python 3.1.0__py3-none-any.whl → 3.1.1__py3-none-any.whl

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.
csspin_python/python.py CHANGED
@@ -159,33 +159,12 @@ defaults = config(
159
159
  key_duration=3600 * 10, # 10 hours
160
160
  static_oidc=False,
161
161
  index="16.0/simple",
162
+ # Need to set client secret to empty string, otherwise the string "None"
163
+ # would be handled as secret and obfucsated in logs.
164
+ client_secret="", # nosec: B106
162
165
  ),
163
166
  index_url="https://pypi.org/simple",
164
- requires=config(
165
- python=["build", "wheel"],
166
- system=config(
167
- debian=config(
168
- apt=[
169
- "build-essential",
170
- "curl",
171
- "git",
172
- "libbz2-dev",
173
- "libffi-dev",
174
- "libkrb5-dev",
175
- "liblzma-dev",
176
- "libncursesw5-dev",
177
- "libreadline-dev",
178
- "libsqlite3-dev",
179
- "libssl-dev",
180
- "libxml2-dev",
181
- "libxmlsec1-dev",
182
- "make",
183
- "xz-utils",
184
- "zlib1g-dev",
185
- ]
186
- )
187
- ),
188
- ),
167
+ requires=config(python=["build", "wheel"]),
189
168
  )
190
169
 
191
170
 
@@ -1018,7 +997,9 @@ def _obfuscate_index_url(index_url: str) -> None:
1018
997
  secrets.add(index_url.split(":")[2].split("@")[0]) # Codeartifact token
1019
998
 
1020
999
 
1021
- def _check_aws_token_validity(cfg: ConfigTree) -> None:
1000
+ def _check_aws_token_validity( # pylint: disable=too-many-locals
1001
+ cfg: ConfigTree,
1002
+ ) -> None:
1022
1003
  """
1023
1004
  If csspin-python[aws_auth] is installed, we can use csaccess to get the
1024
1005
  CodeArtifact authentication token.
@@ -1034,6 +1015,17 @@ def _check_aws_token_validity(cfg: ConfigTree) -> None:
1034
1015
 
1035
1016
  import time
1036
1017
 
1018
+ if not (
1019
+ client_secret := (
1020
+ interpolate1(cfg.python.aws_auth.client_secret)
1021
+ or os.getenv("CS_AWS_OIDC_CLIENT_SECRET")
1022
+ )
1023
+ ):
1024
+ die(
1025
+ "Please provide a client secret for CodeArtifact access via"
1026
+ " 'python.aws_auth.client_secret'."
1027
+ )
1028
+
1037
1029
  current_time = int(time.time())
1038
1030
  timestamp_key = "aws_auth_timestamp"
1039
1031
 
@@ -1059,18 +1051,24 @@ def _check_aws_token_validity(cfg: ConfigTree) -> None:
1059
1051
  memo.items().remove(item)
1060
1052
  else:
1061
1053
  info("Updating Codeartifact token.")
1054
+ from urllib.error import HTTPError
1062
1055
  from urllib.parse import urljoin
1063
1056
 
1064
1057
  opts = {
1058
+ "client_secret": client_secret,
1065
1059
  "static_oidc": interpolate1(cfg.python.aws_auth.static_oidc).lower()
1066
- == "true"
1060
+ == "true",
1067
1061
  }
1068
1062
  if cfg.python.aws_auth.client_id:
1069
1063
  opts["client_id"] = interpolate1(cfg.python.aws_auth.client_id)
1070
1064
  if cfg.python.aws_auth.role_arn:
1071
1065
  opts["aws_role_arn"] = interpolate1(cfg.python.aws_auth.role_arn)
1072
1066
 
1073
- index_base_url = get_ca_pypi_url_programmatic(**opts)
1067
+ try:
1068
+ index_base_url = get_ca_pypi_url_programmatic(**opts)
1069
+ except HTTPError as e:
1070
+ die(f"Failed to establish CodeArtifact connection: {e}")
1071
+
1074
1072
  index_url = urljoin(
1075
1073
  index_base_url + "/", interpolate1(cfg.python.aws_auth.index)
1076
1074
  )
@@ -148,10 +148,15 @@ python:
148
148
  CodeArtifact.
149
149
  index:
150
150
  type: str
151
- help: The Codeartifact repository index (e.g. "16.0/simple").
151
+ help: The CodeArtifact repository index (e.g. "16.0/simple").
152
152
  client_id:
153
153
  type: str
154
154
  help: The OIDC client ID to use.
155
+ client_secret:
156
+ type: secret
157
+ help: |
158
+ The OIDC client secret to use, defaults to the
159
+ environment variable 'CS_AWS_OIDC_CLIENT_SECRET'.
155
160
  role_arn:
156
161
  type: str
157
162
  help: The role ARN to assume when authenticating.
@@ -180,7 +180,7 @@ def _update_index_url_in_toml(cfg: ConfigTree) -> None:
180
180
  """
181
181
  Update the index-url in the uv.toml in case it changed.
182
182
  """
183
- if (uv_toml_path := interpolate1(cfg.uv_provisioner.uv_toml_path)).exists():
183
+ if (uv_toml_path := interpolate1(Path(cfg.uv_provisioner.uv_toml_path))).exists():
184
184
  with open(uv_toml_path, mode="r+b") as fd:
185
185
  toml_content = tomllib.load(fd)
186
186
  if toml_content.get("index-url") != cfg.python.index_url:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csspin-python
3
- Version: 3.1.0
3
+ Version: 3.1.1
4
4
  Summary: Plugin-package for csspin providing Python related plugins
5
5
  Author-email: CONTACT Software GmbH <info@contact-software.com>
6
6
  Maintainer-email: Waleri Enns <waleri.enns@contact-software.com>, Benjamin Thomas Schwertfeger <benjaminthomas.schwertfeger@contact-software.com>, Fabian Hafer <fabian.hafer@contact-software.com>
@@ -8,14 +8,14 @@ csspin_python/playwright.py,sha256=oFfphLqa4AB6K9vasCUFHN0kFXu63n3ocrsqVuRp4-0,5
8
8
  csspin_python/playwright_schema.yaml,sha256=TSeR16YHa7m7bfO59F2eMV-jXcglluTJdEpUeL16saY,1178
9
9
  csspin_python/pytest.py,sha256=pTOb5zFd9RINZwJsHNaRuSGVDkPMABzaAhwpAJo1nQE,4574
10
10
  csspin_python/pytest_schema.yaml,sha256=tzXtdF6MvGC9v59EVRJFfLeMMHqPsXcFXy2zJtRECBI,1535
11
- csspin_python/python.py,sha256=Hht9TcBhIcHU4PdicB5W7s-9OYepUnxK1bdpxzob1Ro,34697
12
- csspin_python/python_schema.yaml,sha256=J9GEr5023cUHvfvSRiD1572eSVvfXt8-XEk9uhowhlc,5939
11
+ csspin_python/python.py,sha256=32L4S6fKMWh5tbU-Rv5l6NVqrjjPLAiL25cB5gfeiC4,34784
12
+ csspin_python/python_schema.yaml,sha256=_EBDglOM9AuXOvYUjFRJkUmtezCHcObEYmO64f-FOHI,6176
13
13
  csspin_python/radon.py,sha256=uFqm6FEi5oWj-_XVaAm3s9cam0cUmr1_FwRf40K6xWs,1876
14
14
  csspin_python/radon_schema.yaml,sha256=rlRzXw5z4XbjOVznRiUxWGP4E9hx1Jm-gGw1iQiYzE0,548
15
- csspin_python/uv_provisioner.py,sha256=8d_24xyofO_6wU7bkomAH1FfY6P_Am0Yy6CXbzLxWN4,5993
15
+ csspin_python/uv_provisioner.py,sha256=MGedx4e286ZE1miwh70y6b3wePw3mmc0m1kG6H_738I,5999
16
16
  csspin_python/uv_provisioner_schema.yaml,sha256=Y8ZNC2OMnhR8Us3WUXAXK9hMjqGWAKFJB2puX4X5XNQ,727
17
- csspin_python-3.1.0.dist-info/licenses/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
18
- csspin_python-3.1.0.dist-info/METADATA,sha256=YIDI67iYHouz4I8dVqCkMtcpXgQTXqmXlz3yUwjbeaM,4715
19
- csspin_python-3.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- csspin_python-3.1.0.dist-info/top_level.txt,sha256=QSeglMEGbFu1z4L6MCQYwo01NgL0KojWvC4rzgMQ8gU,14
21
- csspin_python-3.1.0.dist-info/RECORD,,
17
+ csspin_python-3.1.1.dist-info/licenses/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
18
+ csspin_python-3.1.1.dist-info/METADATA,sha256=OsIblHbaQVC9ybAydVQ1L-YEzqKtzw3qyJZnXqc-nZs,4715
19
+ csspin_python-3.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ csspin_python-3.1.1.dist-info/top_level.txt,sha256=QSeglMEGbFu1z4L6MCQYwo01NgL0KojWvC4rzgMQ8gU,14
21
+ csspin_python-3.1.1.dist-info/RECORD,,