Skip to content

Commit 97c1fc7

Browse files
committed
support: remove support for python 3.6
1 parent 4565443 commit 97c1fc7

15 files changed

+102
-105
lines changed

.github/workflows/linux_ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
3939
pyenv --version
4040
41-
pyenv install 3.6.13
4241
pyenv install 3.7.10
4342
pyenv install 3.8.10
4443
pyenv install 3.9.5
@@ -52,7 +51,6 @@ jobs:
5251
set -e
5352
5453
pyenv versions
55-
V36=$(pyenv whence python3.6)
5654
V37=$(pyenv whence python3.7)
5755
V38=$(pyenv whence python3.8)
5856
V39=$(pyenv whence python3.9)
@@ -63,7 +61,6 @@ jobs:
6361
6462
cat <<EOF > pythons.json
6563
{
66-
"python3.6": "$ROOT/versions/$V36/bin/python",
6764
"python3.7": "$ROOT/versions/$V37/bin/python",
6865
"python3.8": "$ROOT/versions/$V38/bin/python",
6966
"python3.9": "$ROOT/versions/$V39/bin/python",

.github/workflows/mac_ci.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
id: python_cache
3333
uses: actions/cache@v2
3434
with:
35-
key: python3.6.13_3.7.10_3.8.10_3.9.5_3.10.13_3.11.6
35+
key: python3.7.10_3.8.10_3.9.5_3.10.13_3.11.6
3636
path: |
3737
/opt/hostedtoolcache/pyenv_root
3838
~/hostedtoolcache/pyenv_root
@@ -48,9 +48,6 @@ jobs:
4848
unset LDFLAGS
4949
unset CFLAGS
5050
51-
curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1 > /tmp/patch
52-
53-
pyenv install --patch 3.6.13 < /tmp/patch
5451
for version in 3.7.10 3.8.10 3.9.5 3.10.13 3.11.6; do
5552
pyenv install $version
5653
done
@@ -62,7 +59,6 @@ jobs:
6259
set -e
6360
6461
pyenv versions
65-
V36=$(pyenv whence python3.6)
6662
V37=$(pyenv whence python3.7)
6763
V38=$(pyenv whence python3.8)
6864
V39=$(pyenv whence python3.9)
@@ -73,7 +69,6 @@ jobs:
7369
7470
cat <<eof > pythons.json
7571
{
76-
"python3.6": "$ROOT/versions/$V36/bin/python",
7772
"python3.7": "$ROOT/versions/$V37/bin/python",
7873
"python3.8": "$ROOT/versions/$V38/bin/python",
7974
"python3.9": "$ROOT/versions/$V39/bin/python",

.github/workflows/windows_ci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
id: python_cache
2929
uses: actions/cache@v2
3030
with:
31-
key: python3.6.8_3.7.9_3.8.10_3.9.6_3.10.13_3.11.6
31+
key: python3.7.9_3.8.10_3.9.6_3.10.13_3.11.6
3232
path: |
3333
~/.pyenv
3434
@@ -47,7 +47,6 @@ jobs:
4747
4848
pyenv --version
4949
50-
pyenv install 3.6.8
5150
pyenv install 3.7.9
5251
pyenv install 3.8.10
5352
pyenv install 3.9.6
@@ -64,7 +63,6 @@ jobs:
6463
ROOT=~/.pyenv
6564
ls $ROOT
6665
pyenv whence python
67-
V36=$(pyenv whence python3.6)
6866
V37=$(pyenv whence python3.7)
6967
V38=$(pyenv whence python3.8)
7068
V39=$(pyenv whence python3.9)
@@ -73,7 +71,6 @@ jobs:
7371
7472
cat <<EOF > pythons.json
7573
{
76-
"python3.6": "~/.pyenv/pyenv-win/versions/$V36/python.exe",
7774
"python3.7": "~/.pyenv/pyenv-win/versions/$V37/python.exe",
7875
"python3.8": "~/.pyenv/pyenv-win/versions/$V38/python.exe",
7976
"python3.9": "~/.pyenv/pyenv-win/versions/$V39/python.exe",

README.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Python:
1515
.. code-block:: python
1616
1717
{
18-
"python3.6": "~/.pyenv/versions/3.6.13/bin/python",
1918
"python3.7": "~/.pyenv/versions/3.7.12/bin/python",
2019
"python3.8": "~/.pyenv/versions/3.8.12/bin/python",
2120
"python3.9": "~/.pyenv/versions/3.9.6/bin/python"
@@ -26,7 +25,7 @@ Python:
2625
In this example I'm using pyenv to get copies of each Python. Using pyenv isn't
2726
a requirement, but it does make it easy! There is nothing in the tests that rely
2827
on features in any particular version, and so the minor patch of each version is
29-
irrelevant. All that matters is having some version of 3.6, 3.7, 3.8, 3.9 and 3.10.
28+
irrelevant. All that matters is having some version of 3.7, 3.8, 3.9, 3.10 and 3.11.
3029

3130
I recommend running the tests in a virtualenv. I use virtualenvwrapper for this
3231
but you can also do a ``python3 -m venv my_venv`` somewhere and use that.

docs/changelog.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
---------
33

4+
.. _release-0.12.0:
5+
6+
0.12.0 - TBD
7+
* Removed support for python3.6
8+
* Changed packaging to use hatch
9+
410
.. _release-0.11.0:
511

612
0.11.0 - 17 Feburary 2022

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "Tool to create virtualenvs, manage versions of packages in it and use it start a particular program"
99
readme = "README.rst"
1010
license = "MIT"
11-
requires-python = ">= 3.6"
11+
requires-python = ">= 3.7"
1212
authors = [
1313
{ name = "Stephen Moore", email = "[email protected]" },
1414
]

tests/conftest.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
this_dir = Path(__file__).parent
1919

20-
regexes = {"version": re.compile(r"3\.(6|7|8|9|10)")}
20+
regexes = {"version": re.compile(r"3\.(6|7|8|9|10|11)")}
2121

2222

2323
class Pythons:
@@ -32,13 +32,13 @@ def __getitem__(self, key):
3232
if not isinstance(key, (float, str)):
3333
assert (
3434
False
35-
), f"Can only get a python location using a float or string of 3.6, 3.7, etc. Used {key}"
35+
), f"Can only get a python location using a float or string of 3.7, 3.8, etc. Used {key}"
3636

3737
key = str(key)
3838
if not regexes["version"].match(key):
3939
assert (
4040
False
41-
), f"Can only get a python location using a float or string of 3.6, 3.7, etc. Used {key}"
41+
), f"Can only get a python location using a float or string of 3.7, 3.8, etc. Used {key}"
4242

4343
return self.locations[f"python{key}"]
4444

@@ -58,7 +58,7 @@ def pythons_json(self, want):
5858

5959
if not isinstance(pythons, dict):
6060
pytest.exit(
61-
'The pythons.json must be a dictionary of {"python3.6": <location>, "python3.7": <location>, ...}'
61+
'The pythons.json must be a dictionary of {"python3.7": <location>, "python3.7": <location>, ...}'
6262
)
6363

6464
missing = want - set(pythons)
@@ -122,6 +122,10 @@ def ensure_venvstarter(self, python_exe):
122122
with tempfile.TemporaryDirectory() as tmpdir:
123123
PythonHandler().run_command(python_exe, "import venvstarter", cwd=tmpdir)
124124
except FailedToGetOutput:
125+
subprocess.run(
126+
[str(python_exe), "-m", "pip", "install", "pip", "--upgrade"],
127+
check=True,
128+
)
125129
subprocess.run(
126130
[str(python_exe), "-m", "pip", "install", "-e", str(this_dir.parent)],
127131
check=True,
@@ -150,7 +154,7 @@ def ensure_venvstarter_version(self, python_exe, venv_location, errors):
150154
return False
151155

152156
def find(self):
153-
want = set(["python3.6", "python3.7", "python3.8", "python3.9", "python3.10"])
157+
want = set(["python3.7", "python3.8", "python3.9", "python3.10", "python3.11"])
154158
pythons = self.pythons_json(want)
155159
for k in want:
156160
location = self.normalise_python_location(pythons, k)

tests/test_creation.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010

1111
describe "Finding the right version":
1212

13-
@pytest.mark.parametrize("version", [3.7, 3.8, 3.9, "3.10"])
13+
@pytest.mark.parametrize("version", [3.8, 3.9, "3.10", "3.11"])
1414
it "will always use current version if no max is specified", version:
1515

1616
def script():
17-
__import__("venvstarter").manager("python").min_python("3.6").run()
17+
__import__("venvstarter").manager("python").min_python("3.7").run()
1818

1919
with pytest.helpers.PATH.configure(version, python="3.10", python3="3.10"):
2020
exe = pytest.helpers.pythons[version]
2121
with pytest.helpers.make_script(script, exe=exe, prepare_venv=True) as filename:
2222
pytest.helpers.assertPythonVersion(filename, str(version))
2323

24-
@pytest.mark.parametrize("version", [3.7, 3.8, 3.9, "3.10"])
24+
@pytest.mark.parametrize("version", [3.7, 3.8, 3.9, "3.10", "3.11"])
2525
it "will use the only version available if within min and max", version:
2626

2727
def script(version):
@@ -32,7 +32,7 @@ def script(version):
3232
with pytest.helpers.PATH.configure(use, python3=use, python=use):
3333
exe = pytest.helpers.pythons[use]
3434
with pytest.helpers.make_script(
35-
script, str(version), exe=exe, prepare_venv=True
35+
script, repr(str(version)), exe=exe, prepare_venv=True
3636
) as filename:
3737
pytest.helpers.assertPythonVersion(filename, str(use))
3838

@@ -41,7 +41,7 @@ def script(version):
4141
def script():
4242
__import__("venvstarter").manager("python").min_python(3.7).run()
4343

44-
with pytest.helpers.PATH.configure(3.6, 3.7, python3=3.6, python=3.6, mock_sys=3.6):
44+
with pytest.helpers.PATH.configure(3.7, 3.8, python3=3.7, python=3.7, mock_sys=3.7):
4545
with pytest.helpers.make_script(script, prepare_venv=True) as filename:
4646
pytest.helpers.assertPythonVersion(filename, "3.7")
4747

@@ -74,17 +74,17 @@ def break_location(location):
7474
def script():
7575
__import__("venvstarter").manager("python").min_python(3.7).run()
7676

77-
with pytest.helpers.PATH.configure(3.6, 3.7, python3=3.6, python=3.6, mock_sys=3.6):
77+
with pytest.helpers.PATH.configure(3.7, 3.8, python3=3.7, python=3.7, mock_sys=3.7):
7878
with pytest.helpers.make_script(script, prepare_venv=True) as filename:
7979
pytest.helpers.assertPythonVersion(filename, "3.7")
8080

8181
with pytest.helpers.PATH.configure(
82-
3.6, 3.7, 3.8, python3=3.8, python=3.8, mock_sys=3.8
82+
3.7, 3.8, 3.9, python3=3.9, python=3.9, mock_sys=3.9
8383
):
8484
pytest.helpers.assertPythonVersion(filename, "3.7")
8585

8686
def script():
8787
__import__("venvstarter").manager("python").min_python(3.8).run()
8888

8989
pytest.helpers.write_script(script, filename=filename)
90-
pytest.helpers.assertPythonVersion(filename, "3.8")
90+
pytest.helpers.assertPythonVersion(filename, "3.9")

tests/test_finding_python.py

+23-23
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,62 @@
88
describe "finding the right python":
99
it "defaults max version to whatever python3, python and sys.executable are":
1010
with pytest.helpers.PATH.configure(
11-
3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.8
11+
3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys=3.9
1212
):
13-
PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.8]
13+
PythonHandler("3.7", None).find() == pytest.helpers.pythons[3.9]
1414

1515
with pytest.helpers.PATH.configure(
16-
3.6, 3.8, 3.9, python3=3.9, python=3.8, mock_sys=3.8
16+
3.7, 3.9, "3.10", python3=3.10, python=3.9, mock_sys=3.9
1717
):
18-
PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.9]
18+
PythonHandler("3.7", None).find() == pytest.helpers.pythons["3.10"]
1919

2020
with pytest.helpers.PATH.configure(
21-
3.6, 3.8, 3.9, python3=3.8, python=3.9, mock_sys=3.8
21+
3.7, 3.9, "3.10", python3=3.9, python="3.10", mock_sys=3.9
2222
):
23-
PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.9]
23+
PythonHandler("3.7", None).find() == pytest.helpers.pythons["3.10"]
2424

2525
with pytest.helpers.PATH.configure(
26-
3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.9
26+
3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys="3.10"
2727
):
28-
PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.9]
28+
PythonHandler("3.7", None).find() == pytest.helpers.pythons["3.10"]
2929

3030
it "respects the actual max":
3131
with pytest.helpers.PATH.configure(
32-
3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.8
32+
3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys=3.9
3333
):
34-
PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7]
34+
PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8]
3535

3636
with pytest.helpers.PATH.configure(
37-
3.6, 3.8, 3.9, python3=3.9, python=3.8, mock_sys=3.8
37+
3.7, 3.9, "3.10", python3="3.10", python=3.9, mock_sys=3.9
3838
):
39-
PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7]
39+
PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8]
4040

4141
with pytest.helpers.PATH.configure(
42-
3.6, 3.8, 3.9, python3=3.8, python=3.9, mock_sys=3.8
42+
3.7, 3.9, "3.10", python3=3.9, python="3.10", mock_sys=3.9
4343
):
44-
PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7]
44+
PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8]
4545

4646
with pytest.helpers.PATH.configure(
47-
3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.9
47+
3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys="3.10"
4848
):
49-
PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7]
49+
PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8]
5050

5151
it "defaults max to the specified min if the main ones are less":
5252
with pytest.helpers.PATH.configure(
53-
3.6, 3.8, 3.9, python3=3.6, python=3.6, mock_sys=3.6
53+
3.7, 3.9, "3.10", python3=3.7, python=3.7, mock_sys=3.7
5454
):
5555
with pytest.raises(
5656
Exception,
57-
match="Couldn't find a suitable python!\nWanted between 3.7.0 and 3.7.0",
57+
match="Couldn't find a suitable python!\nWanted between 3.8.0 and 3.8.0",
5858
):
59-
PythonHandler("3.7", None).find()
59+
PythonHandler("3.8", None).find()
6060

6161
it "steps through versions":
6262
with pytest.helpers.PATH.configure(
63-
3.6, 3.8, 3.9, python3=3.9, python=3.6, mock_sys=3.9
63+
3.7, 3.9, "3.10", python3="3.10", python=3.7, mock_sys="3.10"
6464
):
65-
PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8]
65+
PythonHandler("3.8", "3.9").find() == pytest.helpers.pythons[3.9]
6666

6767
it "works when there is only one version":
68-
with pytest.helpers.PATH.configure(3.7, python3=3.7, python=3.7, mock_sys=3.7):
69-
PythonHandler(3.7, 3.7).find() == pytest.helpers.pythons[3.7]
68+
with pytest.helpers.PATH.configure(3.8, python3=3.8, python=3.8, mock_sys=3.8):
69+
PythonHandler(3.8, 3.8).find() == pytest.helpers.pythons[3.8]

tests/test_ignite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
describe "ignite":
88

9-
@pytest.mark.parametrize("version", [3.6, 3.7, 3.8, 3.9])
9+
@pytest.mark.parametrize("version", [3.7, 3.8, 3.9, "3.10", "3.11"])
1010
it "works", version:
1111

1212
def script():
@@ -21,7 +21,7 @@ def script():
2121
).run()
2222

2323
with pytest.helpers.PATH.configure(
24-
3.6, 3.7, 3.8, 3.9, python=version, python3=version, mock_sys=version
24+
3.7, 3.8, 3.9, "3.10", "3.11", python=version, python3=version, mock_sys=version
2525
):
2626
with pytest.helpers.make_script(script) as filename:
2727
assert not (Path(filename).parent / ".blah").exists()

0 commit comments

Comments
 (0)