Repository: kornia/kornia

Issue:
Cleanup on setup metadata
_Originally posted by @johnnv1 in https://github.com/kornia/kornia/pull/2225#discussion_r1117693700_


-----
right now I think we have some deadlines in the setup, for example:
- https://github.com/kornia/kornia/blob/master/setup.py#L16
- https://github.com/kornia/kornia/blob/master/setup.cfg#L57
- This isn't used anymore https://github.com/kornia/kornia/tree/master/packaging  


Discussion:

Resolving patch:
diff --git a/kornia/__init__.py b/kornia/__init__.py
--- a/kornia/__init__.py
+++ b/kornia/__init__.py
@@ -13,11 +13,4 @@
 from kornia.utils import eye_like, vec_like, create_meshgrid, image_to_tensor, tensor_to_image
 
 # Version variable
-import sys
-
-if sys.version_info >= (3, 8):  # pragma: >=3.8 cover
-    import importlib.metadata as importlib_metadata
-else:  # pragma: <3.8 cover
-    import importlib_metadata
-
-__version__ = importlib_metadata.version('kornia')
+__version__ = "0.6.11.dev"
diff --git a/kornia/utils/_compat.py b/kornia/utils/_compat.py
--- a/kornia/utils/_compat.py
+++ b/kornia/utils/_compat.py
@@ -1,9 +1,8 @@
 from typing import TYPE_CHECKING, Callable, ContextManager, List, Optional, Tuple, TypeVar
 
 import torch
-from torch import Tensor
-
 from packaging import version
+from torch import Tensor
 
 
 def torch_version() -> str:


Test patch:
diff --git a/test/augmentation/test_auto_operation.py b/test/augmentation/test_auto_operation.py
--- a/test/augmentation/test_auto_operation.py
+++ b/test/augmentation/test_auto_operation.py
@@ -1,5 +1,4 @@
 import inspect
-from test.augmentation.test_container import reproducibility_test
 from typing import List
 
 import pytest
@@ -14,6 +13,7 @@
 from kornia.augmentation.container import AugmentationSequential
 from kornia.geometry.bbox import bbox_to_mask
 from kornia.testing import assert_close
+from test.augmentation.test_container import reproducibility_test
 
 
 def _find_all_ops() -> List[OperationBase]:
diff --git a/test/color/test_hls.py b/test/color/test_hls.py
--- a/test/color/test_hls.py
+++ b/test/color/test_hls.py
@@ -3,11 +3,11 @@
 
 import pytest
 import torch
+from packaging import version
 from torch.autograd import gradcheck
 
 import kornia
 from kornia.testing import BaseTester
-from packaging import version
 
 
 class TestRgbToHls(BaseTester):
diff --git a/test/color/test_raw.py b/test/color/test_raw.py
--- a/test/color/test_raw.py
+++ b/test/color/test_raw.py
@@ -2,12 +2,12 @@
 
 import pytest
 import torch
+from packaging import version
 from torch.autograd import gradcheck
 
 import kornia
 from kornia.testing import BaseTester  # test utils
 from kornia.testing import assert_close
-from packaging import version
 
 
 class TestRawToRgb(BaseTester):
diff --git a/test/enhance/test_histogram.py b/test/enhance/test_histogram.py
--- a/test/enhance/test_histogram.py
+++ b/test/enhance/test_histogram.py
@@ -1,11 +1,11 @@
 import pytest
 import torch
+from packaging import version
 from torch.autograd import gradcheck
 
 import kornia
 import kornia.testing as utils  # test utils
 from kornia.testing import assert_close
-from packaging import version
 
 
 class TestImageHistogram2d:
diff --git a/test/nerf/test_data_utils.py b/test/nerf/test_data_utils.py
--- a/test/nerf/test_data_utils.py
+++ b/test/nerf/test_data_utils.py
@@ -1,11 +1,10 @@
-from test.nerf.test_rays import create_four_cameras
-
 import torch
 
 from kornia.core import Device
 from kornia.geometry.camera import PinholeCamera
 from kornia.nerf.data_utils import ImageTensors, RayDataset, instantiate_ray_dataloader
 from kornia.testing import assert_close
+from test.nerf.test_rays import create_four_cameras
 
 
 def create_random_images_for_cameras(cameras: PinholeCamera) -> ImageTensors:
diff --git a/test/nerf/test_nerf_solver.py b/test/nerf/test_nerf_solver.py
--- a/test/nerf/test_nerf_solver.py
+++ b/test/nerf/test_nerf_solver.py
@@ -1,10 +1,9 @@
-from test.nerf.test_data_utils import create_random_images_for_cameras, create_red_images_for_cameras
-from test.nerf.test_rays import create_four_cameras, create_one_camera
-
 import torch
 
 from kornia.nerf.nerf_solver import NerfSolver
 from kornia.testing import assert_close
+from test.nerf.test_data_utils import create_random_images_for_cameras, create_red_images_for_cameras
+from test.nerf.test_rays import create_four_cameras, create_one_camera
 
 
 class TestNerfSolver: