grz-cli 1.1.1__tar.gz → 1.1.2__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,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.2](https://github.com/BfArM-MVH/grz-tools/compare/grz-cli-v1.1.1...grz-cli-v1.1.2) (2025-08-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **grz-cli,grz-common,grzctl:** fix logging and migrate to grz-common ([#319](https://github.com/BfArM-MVH/grz-tools/issues/319)) ([51ada07](https://github.com/BfArM-MVH/grz-tools/commit/51ada073a2af93ba1a1c48f069b4546ce9bd2975))
9
+
3
10
  ## [1.1.1](https://github.com/BfArM-MVH/grz-tools/compare/grz-cli-v1.1.0...grz-cli-v1.1.1) (2025-07-23)
4
11
 
5
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: grz-cli
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Tool for validation, encryption and upload of MV submissions to GDCs.
5
5
  Project-URL: Homepage, https://github.com/BfArM-MVH/grz-tools
6
6
  Project-URL: Repository, https://github.com/BfArM-MVH/grz-tools
@@ -16,7 +16,7 @@ Requires-Python: >=3.12
16
16
  Requires-Dist: boto3<2,>=1.36
17
17
  Requires-Dist: click<9,>=8.2
18
18
  Requires-Dist: crypt4gh<2,>=1.7
19
- Requires-Dist: grz-common<2,>=1.1.1
19
+ Requires-Dist: grz-common<2,>=1.2.1
20
20
  Requires-Dist: grz-pydantic-models<3,>=2.1.2
21
21
  Requires-Dist: jsonschema<5,>=4.23.0
22
22
  Requires-Dist: platformdirs<5,>=4.3.6
@@ -220,7 +220,16 @@ Alternatively, install `uv` and `tox` and run `uv run tox`.
220
220
 
221
221
  ## Contributing
222
222
 
223
- <!-- Add details about how others can contribute to the project -->
223
+ ### Running unreleased/development versions
224
+
225
+ First, install `uv`.
226
+ We recommend using Conda or [Pixi](https://pixi.sh/latest).
227
+
228
+ After cloning the desired branch of the `grz-tools` repo locally, you can run `grz-cli` directly from the repo using:
229
+
230
+ ```
231
+ uv run --project path/to/cloned/grz-tools grz-cli --help
232
+ ```
224
233
 
225
234
  ## License
226
235
 
@@ -189,7 +189,16 @@ Alternatively, install `uv` and `tox` and run `uv run tox`.
189
189
 
190
190
  ## Contributing
191
191
 
192
- <!-- Add details about how others can contribute to the project -->
192
+ ### Running unreleased/development versions
193
+
194
+ First, install `uv`.
195
+ We recommend using Conda or [Pixi](https://pixi.sh/latest).
196
+
197
+ After cloning the desired branch of the `grz-tools` repo locally, you can run `grz-cli` directly from the repo using:
198
+
199
+ ```
200
+ uv run --project path/to/cloned/grz-tools grz-cli --help
201
+ ```
193
202
 
194
203
  ## License
195
204
 
@@ -26,7 +26,7 @@ dependencies = [
26
26
  "pysam ==0.23.*",
27
27
  "rich ==13.*",
28
28
  "requests >=2.32.3,<3",
29
- "grz-common >=1.1.1,<2",
29
+ "grz-common >=1.2.1,<2",
30
30
  ]
31
31
  classifiers = [
32
32
  "Programming Language :: Python :: 3",
@@ -0,0 +1 @@
1
+ __version__ = "1.1.2"
@@ -8,15 +8,14 @@ from importlib.metadata import version
8
8
 
9
9
  import click
10
10
  import grz_pydantic_models.submission.metadata
11
+ from grz_common.logging import setup_cli_logging
11
12
 
12
13
  from .commands.encrypt import encrypt
13
14
  from .commands.submit import submit
14
15
  from .commands.upload import upload
15
16
  from .commands.validate import validate
16
- from .constants import PACKAGE_ROOT
17
- from .logging_setup import add_filelogger
18
17
 
19
- log = logging.getLogger(PACKAGE_ROOT + ".cli")
18
+ log = logging.getLogger(__name__)
20
19
 
21
20
 
22
21
  class OrderedGroup(click.Group):
@@ -58,21 +57,7 @@ def build_cli():
58
57
  :param log_level: Log level for the logger. It should be one of the following:
59
58
  DEBUG, INFO, WARNING, ERROR, CRITICAL.
60
59
  """
61
- if log_file:
62
- add_filelogger(
63
- log_file,
64
- log_level.upper(),
65
- ) # Add file logger
66
-
67
- # show only time and log level in STDOUT
68
- logging.basicConfig(
69
- format="%(asctime)s - %(levelname)s - %(message)s",
70
- )
71
-
72
- # set the log level for this package
73
- logging.getLogger(PACKAGE_ROOT).setLevel(log_level.upper())
74
-
75
- log.debug("Logging setup complete.")
60
+ setup_cli_logging(log_file, log_level)
76
61
 
77
62
  cli.add_command(validate)
78
63
  cli.add_command(encrypt)
@@ -1 +0,0 @@
1
- __version__ = "1.1.1"
@@ -1,38 +0,0 @@
1
- """Constants for logging configuration, JSON schema validation, and other settings."""
2
-
3
- PACKAGE_ROOT = "grz_cli"
4
-
5
- LOGGING_FORMAT = "%(asctime)s [%(levelname)s] %(name)s: %(message)s"
6
- LOGGING_DATEFMT = "%Y-%m-%d %I:%M %p"
7
- LOGGING_CONFIG = {
8
- "version": 1,
9
- "disable_existing_loggers": True,
10
- "formatters": {
11
- "standard": {
12
- "format": LOGGING_FORMAT,
13
- "datefmt": LOGGING_DATEFMT,
14
- },
15
- },
16
- "handlers": {
17
- "default": {
18
- "level": "INFO",
19
- "formatter": "standard",
20
- "class": "logging.StreamHandler",
21
- },
22
- },
23
- "loggers": {
24
- "": { # root logger
25
- "handlers": ["default"],
26
- "level": "WARNING",
27
- "propagate": False,
28
- },
29
- PACKAGE_ROOT: {"handlers": ["default"], "level": "INFO", "propagate": False},
30
- "__main__": { # if __name__ == '__main__'
31
- "handlers": ["default"],
32
- "level": "DEBUG",
33
- "propagate": False,
34
- },
35
- },
36
- }
37
-
38
- TQDM_SMOOTHING: float = 0.0001
@@ -1,59 +0,0 @@
1
- """
2
- Module: logging_setup
3
-
4
- This module provides functions for setting up logging configuration.
5
- """
6
-
7
- from __future__ import annotations
8
-
9
- import logging
10
- from os import PathLike
11
- from pathlib import Path
12
-
13
- from .constants import LOGGING_DATEFMT, LOGGING_FORMAT, PACKAGE_ROOT
14
-
15
- log = logging.getLogger(__name__)
16
-
17
-
18
- def add_filelogger(
19
- file_path: str | PathLike | None = None,
20
- level: str = "INFO",
21
- logger_name: str = PACKAGE_ROOT,
22
- ) -> None:
23
- """
24
- Add file logging for the specified package.
25
-
26
- This function configures a file logger to capture log messages
27
- for the package specified by _PACKAGE_ROOT. If no file path
28
- is provided, a default log file will be created in the user's
29
- home directory.
30
-
31
- :param file_path: Optional; the path to the log file. If None,
32
- a default path will be used.
33
- :param level: Optional; the logging level. Default is 'INFO'.
34
- Must be a valid logging level name (e.g., 'DEBUG', 'INFO').
35
- :param logger_name:
36
- """
37
- logger = logging.getLogger(logger_name)
38
-
39
- if file_path is None:
40
- default_log_dir = Path.home() / "logs"
41
- default_log_dir.mkdir(parents=True, exist_ok=True)
42
- file_path = default_log_dir / f"{PACKAGE_ROOT}.log"
43
- log.warning("No log file path provided, using default: %s", file_path)
44
- else:
45
- file_path = Path(file_path)
46
-
47
- try:
48
- fh = logging.FileHandler(file_path)
49
- fh.setLevel(level.upper())
50
- fh.setFormatter(logging.Formatter(LOGGING_FORMAT, LOGGING_DATEFMT))
51
- logger.addHandler(fh)
52
- log.info(
53
- "File logger added for %s at %s with level %s.",
54
- logger.name,
55
- file_path,
56
- level.upper(),
57
- )
58
- except Exception as e:
59
- log.error("Failed to add file logger: %s", e)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes