Repository: kornia/kornia

Issue:
Deprecate Python 3.6 support
## 🚀 Feature

Deprecate python 3.6 -- support Python >= 3.7

______________________________________________________________________

#### Consider also to contribute to Kornia universe projects :)

<sub>

- [**Tutorials**](https://github.com/kornia/tutorials): our repository containing the tutorials.

</sub>



Discussion:
I think this can help:
```diff
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
@@ -1,5 +1,5 @@
 default_language_version:
-  python: python3.8
+  python: python3.7
 
 ci:
   autofix_prs: true
@@ -45,7 +45,7 @@ repos:
     rev: v2.37.3
     hooks:
       - id: pyupgrade
-        args: [--py36-plus]
+        args: [--py37-plus]
 
   - repo: https://github.com/PyCQA/bandit
     rev: 1.7.4

diff --git a/pyproject.toml b/pyproject.toml
@@ -17,3 +17,4 @@ skip_glob = []
 skip = [
     "kornia/__init__.py"
 ]
+add_imports = ["from __future__ import annotations"]
```

and then just run:

```bash
$ pre-commit run -a
```

A previous result is:

```bash
$ git diff --shortstat
416 files changed, 2165 insertions(+), 1338 deletions(-)
```


With this, the `isort` will add 'from __future__ import annotations' at all files, and the `pyupgrade` will do all work. Probably the changes will be just the tying annotations.

Resolving patch:
diff --git a/kornia/utils/_compat.py b/kornia/utils/_compat.py
--- a/kornia/utils/_compat.py
+++ b/kornia/utils/_compat.py
@@ -33,12 +33,9 @@ def torch_version_ge(major: int, minor: int, patch: int) -> bool:
 
 
 if version.parse(torch_version()) > version.parse("1.7.1"):
-    # TODO: remove the type: ignore once Python 3.6 is deprecated.
-    # It turns out that Pytorch has no attribute `torch.linalg` for
-    # Python 3.6 / PyTorch 1.7.0, 1.7.1
-    from torch.linalg import qr as linalg_qr  # type: ignore
+    from torch.linalg import qr as linalg_qr
 else:
-    from torch import qr as linalg_qr  # type: ignore # noqa: F401
+    from torch import qr as linalg_qr  # noqa: F401
 
 
 if torch_version_ge(1, 10, 0):
diff --git a/kornia/x/utils.py b/kornia/x/utils.py
--- a/kornia/x/utils.py
+++ b/kornia/x/utils.py
@@ -1,5 +1,4 @@
-# TODO: remove the type: ignore in below after deprecating python 3.6
-from dataclasses import dataclass, field  # type: ignore
+from dataclasses import dataclass, field
 from enum import Enum
 from typing import Dict
 
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,11 @@
 # Welcome to the Kornia setup.py.
 import sys
 
-# Make sure that kornia is running on Python 3.6.0 or later
+# Make sure that kornia is running on Python 3.7.0 or later
 # (to avoid running into this bug: https://bugs.python.org/issue29246)
 
-if sys.version_info < (3, 6, 0):
-    raise RuntimeError("Kornia requires Python 3.6.0 or later.")
+if sys.version_info < (3, 7, 0):
+    raise RuntimeError("Kornia requires Python 3.7.0 or later.")
 
 
 from setuptools import setup


Test patch:
diff --git a/.github/workflows/tests_nightly.yml b/.github/workflows/tests_nightly.yml
--- a/.github/workflows/tests_nightly.yml
+++ b/.github/workflows/tests_nightly.yml
@@ -15,7 +15,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
-        python-version: [3.6, 3.7, 3.8]
+        python-version: [3.7, 3.8]
     steps:
     - uses: actions/checkout@v2
     - name: Setup conda dependencies