hafnia 0.4.1__tar.gz → 0.4.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.
Files changed (154) hide show
  1. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/Dockerfile +4 -1
  2. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/build.yaml +5 -1
  3. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/ci_cd.yaml +7 -6
  4. {hafnia-0.4.1 → hafnia-0.4.2}/PKG-INFO +1 -1
  5. {hafnia-0.4.1 → hafnia-0.4.2}/pyproject.toml +3 -3
  6. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/dataset_recipe/dataset_recipe.py +3 -3
  7. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/dataset_upload_helper.py +1 -1
  8. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/platform/datasets.py +1 -1
  9. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/utils.py +1 -1
  10. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/__main__.py +2 -2
  11. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/config.py +2 -2
  12. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/dataset_cmds.py +2 -2
  13. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/dataset_recipe_cmds.py +1 -1
  14. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/experiment_cmds.py +1 -1
  15. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/profile_cmds.py +2 -2
  16. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/runc_cmds.py +1 -1
  17. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/trainer_package_cmds.py +2 -2
  18. {hafnia-0.4.1 → hafnia-0.4.2}/tests/integration/test_cli_integration.py +1 -1
  19. {hafnia-0.4.1 → hafnia-0.4.2}/tests/integration/test_dataset_recipes_with_platform.py +1 -1
  20. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/test_cli.py +9 -9
  21. {hafnia-0.4.1 → hafnia-0.4.2}/uv.lock +1 -1
  22. {hafnia-0.4.1 → hafnia-0.4.2}/.devcontainer/devcontainer.json +0 -0
  23. {hafnia-0.4.1 → hafnia-0.4.2}/.devcontainer/hooks/post_create +0 -0
  24. {hafnia-0.4.1 → hafnia-0.4.2}/.github/dependabot.yaml +0 -0
  25. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/check_release.yaml +0 -0
  26. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/lint.yaml +0 -0
  27. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/publish_docker.yaml +0 -0
  28. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/publish_pypi.yaml +0 -0
  29. {hafnia-0.4.1 → hafnia-0.4.2}/.github/workflows/tests.yaml +0 -0
  30. {hafnia-0.4.1 → hafnia-0.4.2}/.gitignore +0 -0
  31. {hafnia-0.4.1 → hafnia-0.4.2}/.pre-commit-config.yaml +0 -0
  32. {hafnia-0.4.1 → hafnia-0.4.2}/.python-version +0 -0
  33. {hafnia-0.4.1 → hafnia-0.4.2}/.trivyignore +0 -0
  34. {hafnia-0.4.1 → hafnia-0.4.2}/.vscode/extensions.json +0 -0
  35. {hafnia-0.4.1 → hafnia-0.4.2}/.vscode/launch.json +0 -0
  36. {hafnia-0.4.1 → hafnia-0.4.2}/.vscode/settings.json +0 -0
  37. {hafnia-0.4.1 → hafnia-0.4.2}/LICENSE +0 -0
  38. {hafnia-0.4.1 → hafnia-0.4.2}/README.md +0 -0
  39. {hafnia-0.4.1 → hafnia-0.4.2}/docs/cli.md +0 -0
  40. {hafnia-0.4.1 → hafnia-0.4.2}/docs/release.md +0 -0
  41. {hafnia-0.4.1 → hafnia-0.4.2}/examples/example_dataset_recipe.py +0 -0
  42. {hafnia-0.4.1 → hafnia-0.4.2}/examples/example_hafnia_dataset.py +0 -0
  43. {hafnia-0.4.1 → hafnia-0.4.2}/examples/example_logger.py +0 -0
  44. {hafnia-0.4.1 → hafnia-0.4.2}/examples/example_torchvision_dataloader.py +0 -0
  45. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/__init__.py +0 -0
  46. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/data/__init__.py +0 -0
  47. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/data/factory.py +0 -0
  48. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/dataset_helpers.py +0 -0
  49. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/dataset_names.py +0 -0
  50. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/dataset_recipe/recipe_transforms.py +0 -0
  51. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/dataset_recipe/recipe_types.py +0 -0
  52. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/format_conversions/format_image_classification_folder.py +0 -0
  53. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/format_conversions/format_yolo.py +0 -0
  54. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/format_conversions/torchvision_datasets.py +0 -0
  55. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/hafnia_dataset.py +0 -0
  56. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/license_types.py +0 -0
  57. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/operations/dataset_stats.py +0 -0
  58. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/operations/dataset_transformations.py +0 -0
  59. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/operations/table_transformations.py +0 -0
  60. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/__init__.py +0 -0
  61. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/bbox.py +0 -0
  62. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/bitmask.py +0 -0
  63. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/classification.py +0 -0
  64. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/point.py +0 -0
  65. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/polygon.py +0 -0
  66. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/primitive.py +0 -0
  67. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/segmentation.py +0 -0
  68. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/dataset/primitives/utils.py +0 -0
  69. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/experiment/__init__.py +0 -0
  70. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/experiment/hafnia_logger.py +0 -0
  71. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/http.py +0 -0
  72. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/log.py +0 -0
  73. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/platform/__init__.py +0 -0
  74. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/platform/builder.py +0 -0
  75. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/platform/dataset_recipe.py +0 -0
  76. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/platform/download.py +0 -0
  77. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/platform/experiment.py +0 -0
  78. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/platform/trainer_package.py +0 -0
  79. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/torch_helpers.py +0 -0
  80. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/visualizations/colors.py +0 -0
  81. {hafnia-0.4.1 → hafnia-0.4.2}/src/hafnia/visualizations/image_visualizations.py +0 -0
  82. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/__init__.py +0 -0
  83. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/consts.py +0 -0
  84. {hafnia-0.4.1/src/cli → hafnia-0.4.2/src/hafnia_cli}/keychain.py +0 -0
  85. {hafnia-0.4.1 → hafnia-0.4.2}/tests/__init__.py +0 -0
  86. {hafnia-0.4.1 → hafnia-0.4.2}/tests/conftest.py +0 -0
  87. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/data/000000000139.jpg +0 -0
  88. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/data/000000000139.txt +0 -0
  89. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/data/000000000285.jpg +0 -0
  90. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/data/000000000285.txt +0 -0
  91. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/data/000000000632.jpg +0 -0
  92. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/data/000000000632.txt +0 -0
  93. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/images.txt +0 -0
  94. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_formats/format_yolo/obj.names +0 -0
  95. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/dataset_image_metadata_schema.yaml +0 -0
  96. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_dataset_transformations/test_video_storage_format_read_image.png +0 -0
  97. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_format_yolo/test_format_yolo_import_export_tiny_dataset.png +0 -0
  98. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_format_yolo/test_import_yolo_format_visualized.png +0 -0
  99. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[caltech-101].png +0 -0
  100. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[caltech-256].png +0 -0
  101. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[cifar100].png +0 -0
  102. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[cifar10].png +0 -0
  103. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[coco-2017].png +0 -0
  104. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[midwest-vehicle-detection].png +0 -0
  105. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[mnist].png +0 -0
  106. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_check_dataset[tiny-dataset].png +0 -0
  107. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[caltech-101].png +0 -0
  108. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[caltech-256].png +0 -0
  109. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[cifar100].png +0 -0
  110. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[cifar10].png +0 -0
  111. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[coco-2017].png +0 -0
  112. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[midwest-vehicle-detection].png +0 -0
  113. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[mnist].png +0 -0
  114. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_samples/test_dataset_draw_image_and_target[tiny-dataset].png +0 -0
  115. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_visualizations/test_blur_anonymization[micro-coco-2017].png +0 -0
  116. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_visualizations/test_blur_anonymization[micro-tiny-dataset].png +0 -0
  117. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_visualizations/test_draw_annotations[micro-coco-2017].png +0 -0
  118. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_visualizations/test_draw_annotations[micro-tiny-dataset].png +0 -0
  119. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_visualizations/test_mask_region[micro-coco-2017].png +0 -0
  120. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/expected_images/test_visualizations/test_mask_region[micro-tiny-dataset].png +0 -0
  121. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-coco-2017/annotations.jsonl +0 -0
  122. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-coco-2017/annotations.parquet +0 -0
  123. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-coco-2017/data/657/657dff54d5175e2ae9f4b9629cf57646.jpg +0 -0
  124. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-coco-2017/data/825/825fa2d2d9416694b8e81a47ca38f580.jpg +0 -0
  125. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-coco-2017/data/aa3/aa3cc40b5cde88e5bd189c0b3e6c223c.jpg +0 -0
  126. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-coco-2017/dataset_info.json +0 -0
  127. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-tiny-dataset/annotations.jsonl +0 -0
  128. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-tiny-dataset/annotations.parquet +0 -0
  129. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-tiny-dataset/data/2da/2da1d8dbf2b60bdab8dff1d7f5c2dfb5.png +0 -0
  130. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-tiny-dataset/data/3dd/3ddec2275a02e79e3251d85443622e4c.png +0 -0
  131. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-tiny-dataset/data/4d8/4d8450b045e60e8f3657ababa44af9b6.png +0 -0
  132. {hafnia-0.4.1 → hafnia-0.4.2}/tests/data/micro_test_datasets/micro-tiny-dataset/dataset_info.json +0 -0
  133. {hafnia-0.4.1 → hafnia-0.4.2}/tests/helper_testing.py +0 -0
  134. {hafnia-0.4.1 → hafnia-0.4.2}/tests/integration/test_check_example_scripts.py +0 -0
  135. {hafnia-0.4.1 → hafnia-0.4.2}/tests/integration/test_dataset_merges.py +0 -0
  136. {hafnia-0.4.1 → hafnia-0.4.2}/tests/integration/test_samples.py +0 -0
  137. {hafnia-0.4.1 → hafnia-0.4.2}/tests/integration/test_torchvision_datasets.py +0 -0
  138. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/dataset_recipe/test_dataset_recipe_helpers.py +0 -0
  139. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/dataset_recipe/test_dataset_recipes.py +0 -0
  140. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/dataset_recipe/test_recipe_transformations.py +0 -0
  141. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/format_conversions/test_format_yolo.py +0 -0
  142. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/format_conversions/test_image_classification_directory.py +0 -0
  143. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/operations/test_dataset_stats.py +0 -0
  144. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/operations/test_dataset_transformations.py +0 -0
  145. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/operations/test_table_transformations.py +0 -0
  146. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/test_colors.py +0 -0
  147. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/test_dataset_helpers.py +0 -0
  148. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/test_dataset_names.py +0 -0
  149. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/test_hafnia_dataset.py +0 -0
  150. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/dataset/test_shape_primitives.py +0 -0
  151. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/test_builder.py +0 -0
  152. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/test_hafnia_logger.py +0 -0
  153. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/test_utils.py +0 -0
  154. {hafnia-0.4.1 → hafnia-0.4.2}/tests/unit/test_visualizations.py +0 -0
@@ -1,5 +1,8 @@
1
1
  ARG PYTHON_VERSION
2
2
  FROM python:${PYTHON_VERSION}-slim
3
+
4
+ RUN apt-get update && apt-get install -y pigz && rm -rf /var/lib/apt/lists/*
5
+
3
6
  WORKDIR /opt/ml/processing
4
7
 
5
8
  COPY dist/*.whl .
@@ -8,4 +11,4 @@ RUN pip install --no-cache-dir *.whl && \
8
11
 
9
12
  RUN mkdir -p /opt/ml/processing/input \
10
13
  /opt/ml/processing/output \
11
- /opt/ml/processing/tmp
14
+ /opt/ml/processing/tmp
@@ -6,6 +6,10 @@ on:
6
6
  python-version-file:
7
7
  required: true
8
8
  type: string
9
+ pyproject-toml-file:
10
+ required: false
11
+ type: string
12
+ default: "pyproject.toml"
9
13
  outputs:
10
14
  package-version:
11
15
  description: "The extracted package version"
@@ -25,7 +29,7 @@ jobs:
25
29
  - name: Extract package version
26
30
  id: extract-version
27
31
  run: |
28
- VERSION=$(grep -m 1 'version = ' ${{ inputs.python-version-file }} | sed -e 's/version = "\(.*\)"/\1/')
32
+ VERSION=$(grep -m 1 'version = ' ${{ inputs.pyproject-toml-file }} | sed -e 's/version = "\(.*\)"/\1/')
29
33
  echo "package_version=$VERSION" >> $GITHUB_OUTPUT
30
34
 
31
35
  - name: Install uv
@@ -5,14 +5,14 @@ on:
5
5
  branches: [main]
6
6
  pull_request:
7
7
  branches: [main]
8
- paths: ["src/**", "tests/**", "pyproject.toml"]
8
+ paths: ["src/**", "tests/**", "pyproject.toml", ".python-version", "uv.lock", ".github/workflows/**"]
9
9
 
10
10
  jobs:
11
11
  lint:
12
12
  name: Lint Code
13
13
  uses: ./.github/workflows/lint.yaml
14
14
  with:
15
- python-version-file: "pyproject.toml"
15
+ python-version-file: ".python-version"
16
16
 
17
17
  security-scan:
18
18
  name: Security Scan
@@ -36,14 +36,15 @@ jobs:
36
36
  secrets: inherit
37
37
  uses: ./.github/workflows/tests.yaml
38
38
  with:
39
- python-version-file: "pyproject.toml"
39
+ python-version-file: ".python-version"
40
40
 
41
41
  build:
42
42
  name: Build Package
43
43
  needs: [test, security-scan]
44
44
  uses: ./.github/workflows/build.yaml
45
45
  with:
46
- python-version-file: "pyproject.toml"
46
+ python-version-file: ".python-version"
47
+ pyproject-toml-file: "pyproject.toml"
47
48
 
48
49
  publish-docker-staging:
49
50
  name: Publish Docker Image to Staging
@@ -52,7 +53,7 @@ jobs:
52
53
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
53
54
  uses: ./.github/workflows/publish_docker.yaml
54
55
  with:
55
- python-version-file: "pyproject.toml"
56
+ python-version-file: ".python-version"
56
57
  package-version: ${{ needs.build.outputs.package-version }}
57
58
  environment: "staging"
58
59
 
@@ -80,7 +81,7 @@ jobs:
80
81
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
81
82
  uses: ./.github/workflows/publish_docker.yaml
82
83
  with:
83
- python-version-file: "pyproject.toml"
84
+ python-version-file: ".python-version"
84
85
  package-version: ${{ needs.build.outputs.package-version }}
85
86
  environment: "production"
86
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hafnia
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Python SDK for communication with Hafnia platform.
5
5
  Author-email: Milestone Systems <hafniaplatform@milestone.dk>
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hafnia"
3
- version = "0.4.1"
3
+ version = "0.4.2"
4
4
  description = "Python SDK for communication with Hafnia platform."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -44,14 +44,14 @@ dev = [
44
44
  test = ["pytest>=8.3.4", "pre-commit>=4.2.0", "ruff>=0.9.1"]
45
45
 
46
46
  [project.scripts]
47
- hafnia = 'cli.__main__:main'
47
+ hafnia = 'hafnia_cli.__main__:main'
48
48
 
49
49
  [build-system]
50
50
  requires = ["hatchling"]
51
51
  build-backend = "hatchling.build"
52
52
 
53
53
  [tool.hatch.build.targets.wheel]
54
- packages = ["src/cli", "src/hafnia"]
54
+ packages = ["src/hafnia_cli", "src/hafnia"]
55
55
 
56
56
  [tool.uv]
57
57
  default-groups = ["test"]
@@ -98,8 +98,8 @@ class DatasetRecipe(Serializable):
98
98
  @staticmethod
99
99
  def from_recipe_id(recipe_id: str) -> "DatasetRecipe":
100
100
  """Loads a dataset recipe by id from the hafnia platform."""
101
- from cli.config import Config
102
101
  from hafnia.platform.dataset_recipe import get_dataset_recipe_by_id
102
+ from hafnia_cli.config import Config
103
103
 
104
104
  cfg = Config()
105
105
  endpoint_dataset = cfg.get_platform_endpoint("dataset_recipes")
@@ -114,8 +114,8 @@ class DatasetRecipe(Serializable):
114
114
  @staticmethod
115
115
  def from_recipe_name(name: str) -> "DatasetRecipe":
116
116
  """Loads a dataset recipe by name from the hafnia platform"""
117
- from cli.config import Config
118
117
  from hafnia.platform.dataset_recipe import get_dataset_recipe_by_name
118
+ from hafnia_cli.config import Config
119
119
 
120
120
  cfg = Config()
121
121
  endpoint_dataset = cfg.get_platform_endpoint("dataset_recipes")
@@ -239,8 +239,8 @@ class DatasetRecipe(Serializable):
239
239
 
240
240
  def as_platform_recipe(self, recipe_name: Optional[str], overwrite: bool = False) -> Dict:
241
241
  """Uploads dataset recipe to the hafnia platform."""
242
- from cli.config import Config
243
242
  from hafnia.platform.dataset_recipe import get_or_create_dataset_recipe
243
+ from hafnia_cli.config import Config
244
244
 
245
245
  recipe = self.as_dict()
246
246
  cfg = Config()
@@ -11,7 +11,6 @@ import polars as pl
11
11
  from PIL import Image
12
12
  from pydantic import BaseModel, ConfigDict, field_validator
13
13
 
14
- from cli.config import Config
15
14
  from hafnia.dataset import primitives
16
15
  from hafnia.dataset.dataset_names import (
17
16
  DatasetVariant,
@@ -33,6 +32,7 @@ from hafnia.dataset.primitives.primitive import Primitive
33
32
  from hafnia.http import post
34
33
  from hafnia.log import user_logger
35
34
  from hafnia.platform.datasets import get_dataset_id
35
+ from hafnia_cli.config import Config
36
36
 
37
37
 
38
38
  def generate_bucket_name(dataset_name: str, deployment_stage: DeploymentStage) -> str:
@@ -11,7 +11,6 @@ import rich
11
11
  from rich import print as rprint
12
12
  from rich.progress import track
13
13
 
14
- from cli.config import Config
15
14
  from hafnia import http, utils
16
15
  from hafnia.dataset.dataset_names import DATASET_FILENAMES_REQUIRED
17
16
  from hafnia.dataset.dataset_recipe.dataset_recipe import (
@@ -23,6 +22,7 @@ from hafnia.http import fetch
23
22
  from hafnia.log import sys_logger, user_logger
24
23
  from hafnia.platform.download import get_resource_credentials
25
24
  from hafnia.utils import timed
25
+ from hafnia_cli.config import Config
26
26
 
27
27
 
28
28
  @timed("Fetching dataset list.")
@@ -207,7 +207,7 @@ def is_hafnia_configured() -> bool:
207
207
  """
208
208
  Check if Hafnia is configured by verifying if the API key is set.
209
209
  """
210
- from cli.config import Config
210
+ from hafnia_cli.config import Config
211
211
 
212
212
  return Config().is_configured()
213
213
 
@@ -2,7 +2,7 @@
2
2
  import click
3
3
 
4
4
  import hafnia
5
- from cli import (
5
+ from hafnia_cli import (
6
6
  consts,
7
7
  dataset_cmds,
8
8
  dataset_recipe_cmds,
@@ -11,7 +11,7 @@ from cli import (
11
11
  runc_cmds,
12
12
  trainer_package_cmds,
13
13
  )
14
- from cli.config import Config, ConfigSchema
14
+ from hafnia_cli.config import Config, ConfigSchema
15
15
 
16
16
 
17
17
  @click.group()
@@ -5,8 +5,8 @@ from typing import Dict, List, Optional
5
5
 
6
6
  from pydantic import BaseModel, field_validator
7
7
 
8
- import cli.consts as consts
9
- import cli.keychain as keychain
8
+ import hafnia_cli.consts as consts
9
+ import hafnia_cli.keychain as keychain
10
10
  from hafnia.log import sys_logger, user_logger
11
11
 
12
12
  PLATFORM_API_MAPPING = {
@@ -3,9 +3,9 @@ from typing import Optional
3
3
 
4
4
  import click
5
5
 
6
- from cli import consts
7
- from cli.config import Config
8
6
  from hafnia import utils
7
+ from hafnia_cli import consts
8
+ from hafnia_cli.config import Config
9
9
 
10
10
 
11
11
  @click.group()
@@ -4,7 +4,7 @@ from typing import Dict, Optional
4
4
  import click
5
5
  from rich import print as rprint
6
6
 
7
- from cli.config import Config
7
+ from hafnia_cli.config import Config
8
8
 
9
9
 
10
10
  @click.group(name="dataset-recipe")
@@ -3,7 +3,6 @@ from typing import Dict, Optional
3
3
 
4
4
  import click
5
5
 
6
- from cli.config import Config
7
6
  from hafnia import utils
8
7
  from hafnia.platform.dataset_recipe import (
9
8
  get_dataset_recipe_by_id,
@@ -11,6 +10,7 @@ from hafnia.platform.dataset_recipe import (
11
10
  get_or_create_dataset_recipe_by_dataset_name,
12
11
  )
13
12
  from hafnia.platform.trainer_package import create_trainer_package
13
+ from hafnia_cli.config import Config
14
14
 
15
15
 
16
16
  @click.group(name="experiment")
@@ -2,8 +2,8 @@ import click
2
2
  from rich.console import Console
3
3
  from rich.table import Table
4
4
 
5
- import cli.consts as consts
6
- from cli.config import Config, ConfigSchema
5
+ import hafnia_cli.consts as consts
6
+ from hafnia_cli.config import Config, ConfigSchema
7
7
 
8
8
 
9
9
  @click.group()
@@ -7,8 +7,8 @@ from typing import Optional
7
7
 
8
8
  import click
9
9
 
10
- from cli.config import Config
11
10
  from hafnia.log import sys_logger, user_logger
11
+ from hafnia_cli.config import Config
12
12
 
13
13
 
14
14
  @click.group(name="runc")
@@ -3,8 +3,8 @@ from typing import Optional
3
3
 
4
4
  import click
5
5
 
6
- import cli.consts as consts
7
- from cli.config import Config
6
+ import hafnia_cli.consts as consts
7
+ from hafnia_cli.config import Config
8
8
 
9
9
 
10
10
  @click.group(name="trainer")
@@ -13,7 +13,7 @@ def test_cli_integration_test():
13
13
  Run actual CLI commands against Hafnia platform to ensure end-to-end functionality
14
14
  using simple smoke tests
15
15
  """
16
- from cli.__main__ import main as hafnia_cli
16
+ from hafnia_cli.__main__ import main as hafnia_cli
17
17
 
18
18
  if not is_hafnia_configured():
19
19
  pytest.skip("Hafnia platform not configured. Skipping CLI integration test.")
@@ -1,7 +1,6 @@
1
1
  import pytest
2
2
  import urllib3
3
3
 
4
- from cli.config import Config
5
4
  from hafnia.dataset.dataset_names import OPS_REMOVE_CLASS
6
5
  from hafnia.dataset.dataset_recipe.dataset_recipe import (
7
6
  DatasetRecipe,
@@ -12,6 +11,7 @@ from hafnia.platform.dataset_recipe import (
12
11
  get_dataset_recipe_by_id,
13
12
  )
14
13
  from hafnia.utils import is_hafnia_configured
14
+ from hafnia_cli.config import Config
15
15
 
16
16
 
17
17
  def test_dataset_recipe_on_platform():
@@ -4,9 +4,9 @@ from typing import Dict
4
4
  import pytest
5
5
  from click.testing import CliRunner
6
6
 
7
- import cli.__main__ as cli
8
- import cli.consts as consts
9
- from cli.config import Config, ConfigFileSchema, ConfigSchema
7
+ import hafnia_cli.__main__ as cli
8
+ import hafnia_cli.consts as consts
9
+ from hafnia_cli.config import Config, ConfigFileSchema, ConfigSchema
10
10
 
11
11
 
12
12
  @pytest.fixture
@@ -99,13 +99,13 @@ class TestProfile:
99
99
  ) -> None:
100
100
  """Test list of profiles functionality."""
101
101
  with pytest.MonkeyPatch.context() as mp:
102
- mp.setattr("cli.__main__.Config", lambda *args, **kwargs: empty_config)
102
+ mp.setattr("hafnia_cli.__main__.Config", lambda *args, **kwargs: empty_config)
103
103
  result = cli_runner.invoke(cli.main, ["profile", "ls"])
104
104
  assert result.exit_code != 0
105
105
  assert consts.ERROR_CONFIGURE in result.output
106
106
 
107
107
  with pytest.MonkeyPatch.context() as mp:
108
- mp.setattr("cli.__main__.Config", lambda *args, **kwargs: config_with_profiles)
108
+ mp.setattr("hafnia_cli.__main__.Config", lambda *args, **kwargs: config_with_profiles)
109
109
  result = cli_runner.invoke(cli.main, ["profile", "ls"])
110
110
  assert result.exit_code == 0
111
111
  assert "default" in result.output
@@ -115,13 +115,13 @@ class TestProfile:
115
115
 
116
116
  def test_switch_profile(self, cli_runner: CliRunner, empty_config: Config, config_with_profiles: Config) -> None:
117
117
  with pytest.MonkeyPatch.context() as mp:
118
- mp.setattr("cli.__main__.Config", lambda *args, **kwargs: empty_config)
118
+ mp.setattr("hafnia_cli.__main__.Config", lambda *args, **kwargs: empty_config)
119
119
  result = cli_runner.invoke(cli.main, ["profile", "use", "default"])
120
120
  assert result.exit_code != 0
121
121
  assert f"Error: {consts.ERROR_CONFIGURE}" in result.output
122
122
 
123
123
  with pytest.MonkeyPatch.context() as mp:
124
- mp.setattr("cli.__main__.Config", lambda *args, **kwargs: config_with_profiles)
124
+ mp.setattr("hafnia_cli.__main__.Config", lambda *args, **kwargs: config_with_profiles)
125
125
  result = cli_runner.invoke(cli.main, ["profile", "active"])
126
126
  assert result.exit_code == 0
127
127
  assert f"{consts.PROFILE_TABLE_HEADER} default" in result.output
@@ -140,13 +140,13 @@ class TestProfile:
140
140
 
141
141
  def test_remove_profile(self, cli_runner: CliRunner, empty_config: Config, config_with_profiles: Config) -> None:
142
142
  with pytest.MonkeyPatch.context() as mp:
143
- mp.setattr("cli.__main__.Config", lambda *args, **kwargs: empty_config)
143
+ mp.setattr("hafnia_cli.__main__.Config", lambda *args, **kwargs: empty_config)
144
144
  result = cli_runner.invoke(cli.main, ["profile", "rm", "default"])
145
145
  assert result.exit_code != 0
146
146
  assert consts.ERROR_CONFIGURE in result.output
147
147
 
148
148
  with pytest.MonkeyPatch.context() as mp:
149
- mp.setattr("cli.__main__.Config", lambda *args, **kwargs: config_with_profiles)
149
+ mp.setattr("hafnia_cli.__main__.Config", lambda *args, **kwargs: config_with_profiles)
150
150
  result = cli_runner.invoke(cli.main, ["profile", "rm", "staging"])
151
151
  assert result.exit_code == 0
152
152
  assert f"{consts.PROFILE_REMOVED_SUCCESS} staging" in result.output
@@ -1076,7 +1076,7 @@ wheels = [
1076
1076
 
1077
1077
  [[package]]
1078
1078
  name = "hafnia"
1079
- version = "0.4.1"
1079
+ version = "0.4.2"
1080
1080
  source = { editable = "." }
1081
1081
  dependencies = [
1082
1082
  { name = "boto3" },
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