Repository: conda/conda-build

Issue:
Drop Python 3.7 support
### Checklist

- [X] I added a descriptive title
- [X] I searched open requests and couldn't find a duplicate

### What is the idea?

Python 3.7 packages aren't built anymore in conda-forge and defaults and upstream security support for it will [run out in 3 months](https://endoflife.date/python).

This is the same request as https://github.com/conda/conda/issues/12436

### Why is this needed?

Neither `pkgs/main` (a.k.a., `defaults`) nor `conda-forge` package for Python 3.7 anymore.


### What should happen?

Update dependencies and remove Python 3.7 from the testing matrix.


### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/conda_build/cli/main_render.py b/conda_build/cli/main_render.py
--- a/conda_build/cli/main_render.py
+++ b/conda_build/cli/main_render.py
@@ -143,7 +143,7 @@ def get_render_parser():
                    nargs=1,
                    action=ParseYAMLArgument,
                    help=('Variants to extend the build matrix. Must be a valid YAML instance, '
-                         'such as "{python: [3.6, 3.7]}"'))
+                         'such as "{python: [3.8, 3.9]}"'))
     add_parser_channels(p)
     return p
 
diff --git a/conda_build/skeletons/pypi.py b/conda_build/skeletons/pypi.py
--- a/conda_build/skeletons/pypi.py
+++ b/conda_build/skeletons/pypi.py
@@ -489,7 +489,7 @@ def add_parser(repos):
         action='store',
         default=default_python,
         help="""Version of Python to use to run setup.py. Default is %(default)s.""",
-        choices=['2.7', '3.5', '3.6', '3.7', '3.8'],
+        choices=['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11'],
     )
 
     pypi.add_argument(
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -51,8 +51,6 @@
         "Intended Audience :: Developers",
         "Operating System :: OS Independent",
         "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.6",
-        "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10"


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -62,7 +62,7 @@ jobs:
       fail-fast: false
       matrix:
         # test all lower versions (w/ stable conda) and upper version (w/ canary conda)
-        python-version: ['3.7', '3.8', '3.9']
+        python-version: ['3.8', '3.9']
         conda-version: [release]
         test-type: [serial, parallel]
         include:
@@ -167,7 +167,7 @@ jobs:
       fail-fast: false
       matrix:
         # test lower version (w/ stable conda) and upper version (w/ canary conda)
-        python-version: ['3.7']
+        python-version: ['3.8']
         conda-version: [release]
         test-type: [serial, parallel]
         include:
@@ -279,7 +279,7 @@ jobs:
       fail-fast: false
       matrix:
         # test lower version (w/ stable conda) and upper version (w/ canary conda)
-        python-version: ['3.7']
+        python-version: ['3.8']
         conda-version: [release]
         test-type: [serial, parallel]
         include:
diff --git a/tests/test_index.py b/tests/test_index.py
--- a/tests/test_index.py
+++ b/tests/test_index.py
@@ -606,7 +606,6 @@ def _build_test_index(workdir):
     """
     Copy repodata.json, packages to workdir for testing.
     """
-
     # Python 3.7 workaround "no dirs_exist_ok flag"
     index_hotfix_pkgs = join(here, "index_hotfix_pkgs")
     for path in os.scandir(index_hotfix_pkgs):