Skip to content

Commit

Permalink
Remove support for Python 2.7 and 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ymyzk committed Sep 4, 2021
1 parent 1223231 commit 2d58011
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
- macos-latest # macOS-10.15
- windows-2016
- windows-latest # windows-2019
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy-2.7, pypy-3.6, pypy-3.7]
python-version: [3.6, 3.7, 3.8, 3.9, pypy-3.6, pypy-3.7]

steps:
- uses: actions/checkout@v1
Expand Down
19 changes: 6 additions & 13 deletions setup.cfg
Expand Up @@ -24,10 +24,8 @@ classifiers =
Topic :: Software Development :: Testing
Topic :: Software Development :: Libraries
Topic :: Utilities
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Expand All @@ -40,14 +38,11 @@ packages = find:
package_dir =
=src
zip_safe = True
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
python_requires = >=3.6
install_requires =
tox >=3.12, <4
typing; python_version<"3.5"
setup_requires =
# This is for backward compatibility
# Needs setuptools_scm v5 for Python <3.6
setuptools_scm[toml] >=5, <7
setuptools_scm[toml] >=6, <7

[options.packages.find]
where = src
Expand All @@ -58,12 +53,12 @@ tox =

[options.extras_require]
testing =
black; platform_python_implementation=='CPython' and python_version>='3.6'
black; platform_python_implementation=='CPython'
flake8 >=3, <4
pytest >=4, <6
pytest-cov >=2, <3
pytest-mock >=2, <3
pytest-randomly >=3; python_version>='3.5'
pytest-randomly >=3

[options.package_data]
tox_gh_actions =
Expand All @@ -79,12 +74,10 @@ skip_missing_interpreters = true
envlist =
black
flake8
{py27,py35,py36,py37,py38,py39,pypy2,pypy3}-tox{312,315,latest}
{py36,py37,py38,py39,pypy2,pypy3}-tox{312,315,latest}

[gh-actions]
python =
2.7: py27, flake8
3.5: py35
3.6: py36
3.7: py37
3.8: py38, black, flake8
Expand Down
2 changes: 0 additions & 2 deletions src/tox_gh_actions/plugin.py
Expand Up @@ -116,9 +116,7 @@ def get_python_version_keys():
"""Get Python version in string for getting factors from gh-action's config
Examples:
- CPython 2.7.z => [2.7, 2]
- CPython 3.8.z => [3.8, 3]
- PyPy 2.7 (v7.3.z) => [pypy-2.7, pypy-2, pypy2]
- PyPy 3.6 (v7.3.z) => [pypy-3.6, pypy-3, pypy3]
- Pyston based on Python CPython 3.8.8 (v2.2) => [pyston-3.8, pyston-3]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/tox.ini
@@ -1,10 +1,10 @@
[tox]
envlist = py27, py39, unused
envlist = py38, py39, unused
skipsdist = True

[gh-actions]
python =
2.7: py27
3.8: py38
3.9: py39

[testenv]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration.py
Expand Up @@ -26,7 +26,7 @@ def test_integration():
expected_envs_map = defaultdict(
list,
[
((2, 7), ["py27"]),
((3, 8), ["py38"]),
((3, 9), ["py39"]),
],
)
Expand Down
94 changes: 43 additions & 51 deletions tests/test_plugin.py
Expand Up @@ -10,26 +10,24 @@
(
{
"gh-actions": {
"python": """2.7: py27
3.5: py35
3.6: py36
3.7: py37, flake8"""
"python": """3.7: py37
3.8: py38
3.9: py39, flake8"""
}
},
{
"python": {
"2.7": ["py27"],
"3.5": ["py35"],
"3.6": ["py36"],
"3.7": ["py37", "flake8"],
"3.7": ["py37"],
"3.8": ["py38"],
"3.9": ["py39", "flake8"],
},
"env": {},
},
),
(
{
"gh-actions": {
"python": """2.7: py27
"python": """3.7: py37
3.8: py38"""
},
"gh-actions:env": {
Expand All @@ -40,7 +38,7 @@
},
{
"python": {
"2.7": ["py27"],
"3.7": ["py37"],
"3.8": ["py38"],
},
"env": {
Expand Down Expand Up @@ -78,14 +76,14 @@ def test_parse_config(config, expected):
(
{
"python": {
"2.7": ["py27", "flake8"],
"3.7": ["py37", "flake8"],
"3.8": ["py38", "flake8"],
},
"unknown": {},
},
["2.7", "2"],
["3.7", "3"],
{},
["py27", "flake8"],
["py37", "flake8"],
),
# Get factors using less precise Python version
(
Expand Down Expand Up @@ -117,7 +115,7 @@ def test_parse_config(config, expected):
(
{
"python": {
"2.7": ["py27", "flake8"],
"3.7": ["py37", "flake8"],
"3.8": ["py38", "flake8"],
},
"env": {
Expand All @@ -127,17 +125,17 @@ def test_parse_config(config, expected):
},
},
},
["2.7", "2"],
["3.7", "3"],
{
"SAMPLE": "VALUE1",
"HOGE": "VALUE3",
},
["py27-fact1", "py27-fact2", "flake8-fact1", "flake8-fact2"],
["py37-fact1", "py37-fact2", "flake8-fact1", "flake8-fact2"],
),
(
{
"python": {
"2.7": ["py27", "flake8"],
"3.7": ["py37", "flake8"],
"3.8": ["py38", "flake8"],
},
"env": {
Expand All @@ -151,16 +149,16 @@ def test_parse_config(config, expected):
},
},
},
["2.7", "2"],
["3.7", "3"],
{
"SAMPLE": "VALUE1",
"HOGE": "VALUE3",
},
[
"py27-fact1-fact5",
"py27-fact1-fact6",
"py27-fact2-fact5",
"py27-fact2-fact6",
"py37-fact1-fact5",
"py37-fact1-fact6",
"py37-fact2-fact5",
"py37-fact2-fact6",
"flake8-fact1-fact5",
"flake8-fact1-fact6",
"flake8-fact2-fact5",
Expand All @@ -170,7 +168,7 @@ def test_parse_config(config, expected):
(
{
"python": {
"2.7": ["py27", "flake8"],
"3.7": ["py37", "flake8"],
"3.8": ["py38", "flake8"],
},
"env": {
Expand All @@ -180,22 +178,22 @@ def test_parse_config(config, expected):
},
},
},
["2.7", "2"],
["3.7", "3"],
{
"SAMPLE": "VALUE1",
"HOGE": "VALUE3",
},
[
"py27-django18",
"py27-flake8",
"py37-django18",
"py37-flake8",
"flake8-django18",
"flake8-flake8",
],
),
(
{
"python": {
"2.7": ["py27", "flake8"],
"3.7": ["py37", "flake8"],
"3.8": ["py38", "flake8"],
},
"env": {
Expand All @@ -206,16 +204,16 @@ def test_parse_config(config, expected):
},
"unknown": {},
},
["2.7", "2"],
["3.7", "3"],
{
"SAMPLE": "VALUE3",
},
["py27", "flake8"],
["py37", "flake8"],
),
(
{
"python": {
"2.7": ["py27", "flake8"],
"3.7": ["py37", "flake8"],
"3.8": ["py38", "flake8"],
},
"env": {
Expand All @@ -237,7 +235,7 @@ def test_parse_config(config, expected):
"3.8": ["py38", "flake8"],
},
},
["2.7", "2"],
["3.7", "3"],
{},
[],
),
Expand Down Expand Up @@ -269,12 +267,12 @@ def normalize_factors_list(factors):
"envlist,factors,expected",
[
(
["py27", "py37", "flake8"],
["py37", "flake8"],
["py37", "flake8"],
["py37", "py38", "flake8"],
["py38", "flake8"],
["py38", "flake8"],
),
(
["py27", "py37", "flake8"],
["py37", "py38", "flake8"],
[],
[],
),
Expand All @@ -284,19 +282,19 @@ def normalize_factors_list(factors):
[],
),
(
["py27-dj111", "py37-dj111", "py37-dj20", "flake8"],
["py37", "flake8"],
["py37-dj111", "py37-dj20", "flake8"],
["py37-dj111", "py38-dj111", "py38-dj20", "flake8"],
["py38", "flake8"],
["py38-dj111", "py38-dj20", "flake8"],
),
(
["py27-django18", "py37-django18", "flake8"],
["py37-django18", "py38-django18", "flake8"],
[
"py27-django18",
"py27-flake8",
"py37-django18",
"py37-flake8",
"flake8-django18",
"flake8-flake8",
],
["py27-django18", "flake8"],
["py37-django18", "flake8"],
),
],
)
Expand All @@ -318,12 +316,6 @@ def test_get_envlist_from_factors(envlist, factors, expected):
(3, 6, 9, "final", 0),
["pypy-3.6", "pypy-3", "pypy3"],
),
(
"2.7.13 (724f1a7d62e8, Dec 23 2019, 15:36:24)\n"
"[PyPy 7.3.0 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]",
(2, 7, 13, "final", 42),
["pypy-2.7", "pypy-2", "pypy2"],
),
],
)
def test_get_version_keys(mocker, version, info, expected):
Expand Down Expand Up @@ -367,9 +359,9 @@ def test_is_running_on_actions(mocker, environ, expected):
"option_env,environ,expected",
[
(None, {"TOXENV": "flake8"}, True),
(["py27,py38"], {}, True),
(["py27", "py38"], {}, True),
(["py27"], {"TOXENV": "flake8"}, True),
(["py37,py38"], {}, True),
(["py37", "py38"], {}, True),
(["py37"], {"TOXENV": "flake8"}, True),
(None, {}, False),
],
)
Expand Down

0 comments on commit 2d58011

Please sign in to comment.