ssb-pubmd 0.0.17__tar.gz → 0.0.19__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ssb-pubmd
3
- Version: 0.0.17
3
+ Version: 0.0.19
4
4
  Summary: SSB Pubmd
5
5
  License: MIT
6
6
  Author: Olav Landsverk
@@ -14,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Dist: click (>=8.0.1)
17
+ Requires-Dist: cryptography (>=45.0.4,<46.0.0)
17
18
  Requires-Dist: google-cloud-secret-manager (>=2.24.0,<3.0.0)
18
19
  Requires-Dist: nbformat (>=5.10.4,<6.0.0)
19
20
  Requires-Dist: platformdirs (>=4.3.8,<5.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ssb-pubmd"
3
- version = "0.0.17"
3
+ version = "0.0.19"
4
4
  description = "SSB Pubmd"
5
5
  authors = ["Olav Landsverk <stud-oll@ssb.no>"]
6
6
  license = "MIT"
@@ -23,6 +23,7 @@ playwright = "^1.51.0"
23
23
  platformdirs = "^4.3.8"
24
24
  pyjwt = "^2.10.1"
25
25
  google-cloud-secret-manager = "^2.24.0"
26
+ cryptography = "^45.0.4"
26
27
 
27
28
  [tool.poetry.group.dev.dependencies]
28
29
  pygments = ">=2.10.0"
@@ -4,7 +4,6 @@ import json
4
4
  import os
5
5
  from enum import Enum
6
6
  from pathlib import Path
7
- from typing import cast
8
7
  from urllib.parse import urlparse
9
8
 
10
9
  import click
@@ -35,18 +34,21 @@ def get_config_value(config_key: ConfigKey) -> str:
35
34
  def get_env_value() -> str:
36
35
  """Get value from environment variable, by uppercasing the key and adding prefix."""
37
36
  prefix = f"{APP_NAME.upper()}_"
38
- value = os.getenv(f"{prefix}{key.upper()}")
37
+ value = os.getenv(f"{prefix}{key.upper()}", "")
39
38
 
40
- return cast(str, value)
39
+ return value
41
40
 
42
41
  def get_config_file_value() -> str:
43
42
  """Get value from the config file."""
44
- with open(CONFIG_FILE) as f:
45
- data = json.load(f)
43
+ try:
44
+ with open(CONFIG_FILE) as f:
45
+ data = json.load(f)
46
46
 
47
- value = data.get(key)
47
+ value = data.get(key)
48
+ except Exception:
49
+ value = ""
48
50
 
49
- return cast(str, value)
51
+ return str(value)
50
52
 
51
53
  return get_env_value() or get_config_file_value()
52
54
 
File without changes
File without changes