From 9b5c62c109b36580b8dc4be32fe77e104c1617cd Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 3 Feb 2022 12:53:56 -0600 Subject: [PATCH] Deprecate Python 3.6 (#263) * Vendors: Bump min python 3.6 -> 3.7 * ci: Remove python 3.6 * ci[pre-commit]: Update pyupgrade arg 3.6 -> 3.7 * chore(flake8): Add min_python_version * deps(pyproject): Bump minimum python 3.6 -> 3.7 * deps: Remove PEP 557 (dataclasses) backport for 3.6 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore(tox): remove python 3.6 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore: Remove PY36 * CI(integration): Remove 3.6 * chore(testutils.py): Unused args Co-authored-by: Branch Vincent * build(deps): Simplify isort markers Co-authored-by: Branch Vincent * build(deps): Simplify pre-commit marker Co-authored-by: Branch Vincent * chore: Cleanup unused condition, import * chore: Remove PY37 checks (unused) * chore: Fix codesmell See also: https://sonarcloud.io/project/issues?id=poetry-core&open=AX5towEhmZqnEonFAx80&pullRequest=263&resolved=false&types=CODE_SMELL * chore: Remove FileNotFoundError Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Branch Vincent --- .flake8 | 1 + .github/workflows/integration.yml | 2 +- .github/workflows/tests.yml | 2 +- .pre-commit-config.yaml | 2 +- poetry.lock | 45 ++++++++++++++++---------- pyproject.toml | 9 +++--- src/poetry/core/utils/_compat.py | 9 ------ tests/masonry/builders/test_builder.py | 5 ++- tests/testutils.py | 10 ++---- tox.ini | 2 +- vendors/poetry.lock | 4 +-- vendors/pyproject.toml | 2 +- 12 files changed, 45 insertions(+), 48 deletions(-) diff --git a/.flake8 b/.flake8 index 36b38b391..3570a55cc 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,5 @@ [flake8] +min_python_version = 3.7.0 max-line-length = 88 ignore = E501, E203, W503, ANN101, ANN102, SIM106 ban-relative-imports = True diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3eb106895..59f1e020a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [Ubuntu, MacOS, Windows] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9] experimental: [false] include: - os: Ubuntu diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e91a4a846..d95780c9f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [Ubuntu, MacOS, Windows] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9] experimental: [false] bootstrap-args: [""] include: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f9859a994..b6d7ede73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,7 @@ repos: hooks: - id: pyupgrade args: - - --py36-plus + - --py37-plus - repo: https://github.com/pycqa/isort rev: 5.10.1 diff --git a/poetry.lock b/poetry.lock index 7ffaa3075..08ec7aea3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -45,7 +45,6 @@ python-versions = ">=3.6.2" [package.dependencies] click = ">=7.1.2" -dataclasses = {version = ">=0.6", markers = "python_version < \"3.7\""} mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0,<1" platformdirs = ">=2" @@ -122,14 +121,6 @@ python-versions = ">=3.6" [package.extras] toml = ["tomli"] -[[package]] -name = "dataclasses" -version = "0.8" -description = "A backport of the dataclasses module for Python 3.6" -category = "main" -optional = false -python-versions = ">=3.6, <3.7" - [[package]] name = "distlib" version = "0.3.3" @@ -233,6 +224,7 @@ python-versions = ">=3.7" [package.dependencies] attrs = ">=17.4.0" +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" @@ -327,7 +319,6 @@ python-versions = ">=3.6.1" cfgv = ">=2.0.0" identify = ">=1.0.0" importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} -importlib-resources = {version = "*", markers = "python_version < \"3.7\""} nodeenv = ">=0.11.1" pyyaml = ">=5.1" toml = "*" @@ -551,7 +542,6 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" distlib = ">=0.3.1,<1" filelock = ">=3.2,<4" importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} -importlib-resources = {version = ">=1.0", markers = "python_version < \"3.7\""} platformdirs = ">=2,<3" six = ">=1.9.0,<2" @@ -573,8 +563,8 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" -python-versions = "^3.6" -content-hash = "d6dcc07ec4c705a59047df646ad7d09ed999967e540d71b6a63a0b16daacf704" +python-versions = "^3.7" +content-hash = "f7ffed8e4e719c5e387551e29dc7d3abfe7cec72bf2c2b29a6830b092022a0ba" [metadata.files] atomicwrites = [ @@ -662,10 +652,6 @@ coverage = [ {file = "coverage-6.1.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:eab14fdd410500dae50fd14ccc332e65543e7b39f6fc076fe90603a0e5d2f929"}, {file = "coverage-6.1.2.tar.gz", hash = "sha256:d9a635114b88c0ab462e0355472d00a180a5fbfd8511e7f18e4ac32652e7d972"}, ] -dataclasses = [ - {file = "dataclasses-0.8-py3-none-any.whl", hash = "sha256:0201d89fa866f68c8ebd9d08ee6ff50c0b255f8ec63a71c16fda7af82bb887bf"}, - {file = "dataclasses-0.8.tar.gz", hash = "sha256:8479067f342acf957dc82ec415d355ab5edb7e7646b90dc6e2fd1d96ad084c97"}, -] distlib = [ {file = "distlib-0.3.3-py2.py3-none-any.whl", hash = "sha256:c8b54e8454e5bf6237cc84c20e8264c3e991e824ef27e8f1e81049867d861e31"}, {file = "distlib-0.3.3.zip", hash = "sha256:d982d0751ff6eaaab5e2ec8e691d949ee80eddf01a62eaa96ddb11531fe16b05"}, @@ -821,6 +807,11 @@ regex = [ {file = "regex-2021.11.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:30ab804ea73972049b7a2a5c62d97687d69b5a60a67adca07eb73a0ddbc9e29f"}, {file = "regex-2021.11.10-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:68a067c11463de2a37157930d8b153005085e42bcb7ad9ca562d77ba7d1404e0"}, {file = "regex-2021.11.10-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:162abfd74e88001d20cb73ceaffbfe601469923e875caf9118333b1a4aaafdc4"}, + {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b9ed0b1e5e0759d6b7f8e2f143894b2a7f3edd313f38cf44e1e15d360e11749b"}, + {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:473e67837f786404570eae33c3b64a4b9635ae9f00145250851a1292f484c063"}, + {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2fee3ed82a011184807d2127f1733b4f6b2ff6ec7151d83ef3477f3b96a13d03"}, + {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:d5fd67df77bab0d3f4ea1d7afca9ef15c2ee35dfb348c7b57ffb9782a6e4db6e"}, + {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5d408a642a5484b9b4d11dea15a489ea0928c7e410c7525cd892f4d04f2f617b"}, {file = "regex-2021.11.10-cp310-cp310-win32.whl", hash = "sha256:98ba568e8ae26beb726aeea2273053c717641933836568c2a0278a84987b2a1a"}, {file = "regex-2021.11.10-cp310-cp310-win_amd64.whl", hash = "sha256:780b48456a0f0ba4d390e8b5f7c661fdd218934388cde1a974010a965e200e12"}, {file = "regex-2021.11.10-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:dba70f30fd81f8ce6d32ddeef37d91c8948e5d5a4c63242d16a2b2df8143aafc"}, @@ -830,6 +821,11 @@ regex = [ {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5537f71b6d646f7f5f340562ec4c77b6e1c915f8baae822ea0b7e46c1f09b733"}, {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed2e07c6a26ed4bea91b897ee2b0835c21716d9a469a96c3e878dc5f8c55bb23"}, {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ca5f18a75e1256ce07494e245cdb146f5a9267d3c702ebf9b65c7f8bd843431e"}, + {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:74cbeac0451f27d4f50e6e8a8f3a52ca074b5e2da9f7b505c4201a57a8ed6286"}, + {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:3598893bde43091ee5ca0a6ad20f08a0435e93a69255eeb5f81b85e81e329264"}, + {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:50a7ddf3d131dc5633dccdb51417e2d1910d25cbcf842115a3a5893509140a3a"}, + {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:61600a7ca4bcf78a96a68a27c2ae9389763b5b94b63943d5158f2a377e09d29a"}, + {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:563d5f9354e15e048465061509403f68424fef37d5add3064038c2511c8f5e00"}, {file = "regex-2021.11.10-cp36-cp36m-win32.whl", hash = "sha256:93a5051fcf5fad72de73b96f07d30bc29665697fb8ecdfbc474f3452c78adcf4"}, {file = "regex-2021.11.10-cp36-cp36m-win_amd64.whl", hash = "sha256:b483c9d00a565633c87abd0aaf27eb5016de23fed952e054ecc19ce32f6a9e7e"}, {file = "regex-2021.11.10-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fff55f3ce50a3ff63ec8e2a8d3dd924f1941b250b0aac3d3d42b687eeff07a8e"}, @@ -839,6 +835,11 @@ regex = [ {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5ca078bb666c4a9d1287a379fe617a6dccd18c3e8a7e6c7e1eb8974330c626a"}, {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd33eb9bdcfbabab3459c9ee651d94c842bc8a05fabc95edf4ee0c15a072495e"}, {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:05b7d6d7e64efe309972adab77fc2af8907bb93217ec60aa9fe12a0dad35874f"}, + {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:42b50fa6666b0d50c30a990527127334d6b96dd969011e843e726a64011485da"}, + {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:6e1d2cc79e8dae442b3fa4a26c5794428b98f81389af90623ffcc650ce9f6732"}, + {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:0416f7399e918c4b0e074a0f66e5191077ee2ca32a0f99d4c187a62beb47aa05"}, + {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:ce298e3d0c65bd03fa65ffcc6db0e2b578e8f626d468db64fdf8457731052942"}, + {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dc07f021ee80510f3cd3af2cad5b6a3b3a10b057521d9e6aaeb621730d320c5a"}, {file = "regex-2021.11.10-cp37-cp37m-win32.whl", hash = "sha256:e71255ba42567d34a13c03968736c5d39bb4a97ce98188fafb27ce981115beec"}, {file = "regex-2021.11.10-cp37-cp37m-win_amd64.whl", hash = "sha256:07856afef5ffcc052e7eccf3213317fbb94e4a5cd8177a2caa69c980657b3cb4"}, {file = "regex-2021.11.10-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ba05430e819e58544e840a68b03b28b6d328aff2e41579037e8bab7653b37d83"}, @@ -849,6 +850,11 @@ regex = [ {file = "regex-2021.11.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85bfa6a5413be0ee6c5c4a663668a2cad2cbecdee367630d097d7823041bdeec"}, {file = "regex-2021.11.10-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f23222527b307970e383433daec128d769ff778d9b29343fb3496472dc20dabe"}, {file = "regex-2021.11.10-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:da1a90c1ddb7531b1d5ff1e171b4ee61f6345119be7351104b67ff413843fe94"}, + {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f5be7805e53dafe94d295399cfbe5227f39995a997f4fd8539bf3cbdc8f47ca8"}, + {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a955b747d620a50408b7fdf948e04359d6e762ff8a85f5775d907ceced715129"}, + {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:139a23d1f5d30db2cc6c7fd9c6d6497872a672db22c4ae1910be22d4f4b2068a"}, + {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:ca49e1ab99593438b204e00f3970e7a5f70d045267051dfa6b5f4304fcfa1dbf"}, + {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:96fc32c16ea6d60d3ca7f63397bff5c75c5a562f7db6dec7d412f7c4d2e78ec0"}, {file = "regex-2021.11.10-cp38-cp38-win32.whl", hash = "sha256:0617383e2fe465732af4509e61648b77cbe3aee68b6ac8c0b6fe934db90be5cc"}, {file = "regex-2021.11.10-cp38-cp38-win_amd64.whl", hash = "sha256:a3feefd5e95871872673b08636f96b61ebef62971eab044f5124fb4dea39919d"}, {file = "regex-2021.11.10-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f7f325be2804246a75a4f45c72d4ce80d2443ab815063cdf70ee8fb2ca59ee1b"}, @@ -859,6 +865,11 @@ regex = [ {file = "regex-2021.11.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:962b9a917dd7ceacbe5cd424556914cb0d636001e393b43dc886ba31d2a1e449"}, {file = "regex-2021.11.10-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fa8c626d6441e2d04b6ee703ef2d1e17608ad44c7cb75258c09dd42bacdfc64b"}, {file = "regex-2021.11.10-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3c5fb32cc6077abad3bbf0323067636d93307c9fa93e072771cf9a64d1c0f3ef"}, + {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:cd410a1cbb2d297c67d8521759ab2ee3f1d66206d2e4328502a487589a2cb21b"}, + {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e6096b0688e6e14af6a1b10eaad86b4ff17935c49aa774eac7c95a57a4e8c296"}, + {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:529801a0d58809b60b3531ee804d3e3be4b412c94b5d267daa3de7fadef00f49"}, + {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0f594b96fe2e0821d026365f72ac7b4f0b487487fb3d4aaf10dd9d97d88a9737"}, + {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2409b5c9cef7054dde93a9803156b411b677affc84fca69e908b1cb2c540025d"}, {file = "regex-2021.11.10-cp39-cp39-win32.whl", hash = "sha256:3b5df18db1fccd66de15aa59c41e4f853b5df7550723d26aa6cb7f40e5d9da5a"}, {file = "regex-2021.11.10-cp39-cp39-win_amd64.whl", hash = "sha256:83ee89483672b11f8952b158640d0c0ff02dc43d9cb1b70c1564b49abe92ce29"}, {file = "regex-2021.11.10.tar.gz", hash = "sha256:f341ee2df0999bfdf7a95e448075effe0db212a59387de1a70690e4acb03d4c6"}, diff --git a/pyproject.toml b/pyproject.toml index fea5d16c3..61acd127a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,14 +33,13 @@ exclude = [ "Bug Tracker" = "https://github.com/python-poetry/poetry/issues" [tool.poetry.dependencies] -python = "^3.6" +python = "^3.7" # required for compatibility importlib-metadata = {version = ">=1.7.0", python = "<3.8"} -dataclasses = {version = ">=0.8", python = "~3.6"} [tool.poetry.dev-dependencies] -pre-commit = {version = "^2.15.0", python = "^3.6.1"} +pre-commit = "^2.15.0" pyrsistent = "^0.18.0" pytest = "^6.2" pytest-cov = "^2.8" @@ -48,8 +47,8 @@ pytest-mock = "^3.5" tox = "^3.0" vendoring = {version = "^0.3", python = "^3.8"} pep517 = "^0.11.0" -black = {version = "^21.9b0", markers = "python_version >= '3.6.2' and python_version < '4.0' and implementation_name != 'pypy'"} -isort = {version = "^5.9.3", python = "^3.6.1"} +black = {version = "^21.9b0", markers = "python_version >= '3.7.0' and python_version < '4.0' and implementation_name != 'pypy'"} +isort = "^5.9.3" [tool.black] line-length = 88 diff --git a/src/poetry/core/utils/_compat.py b/src/poetry/core/utils/_compat.py index 9943beca2..638ae0ea9 100644 --- a/src/poetry/core/utils/_compat.py +++ b/src/poetry/core/utils/_compat.py @@ -3,18 +3,9 @@ from typing import List -PY36 = sys.version_info >= (3, 6) -PY37 = sys.version_info >= (3, 7) - WINDOWS = sys.platform == "win32" -try: - FileNotFoundError -except NameError: - FileNotFoundError = IOError - - def list_to_shell_command(cmd: List[str]) -> str: executable = cmd[0] diff --git a/tests/masonry/builders/test_builder.py b/tests/masonry/builders/test_builder.py index f672bef6e..2f5ba5e9f 100644 --- a/tests/masonry/builders/test_builder.py +++ b/tests/masonry/builders/test_builder.py @@ -10,7 +10,6 @@ from poetry.core.factory import Factory from poetry.core.masonry.builders.builder import Builder -from poetry.core.utils._compat import PY37 if TYPE_CHECKING: @@ -29,7 +28,7 @@ def test_builder_find_excluded_files(mocker: "MockerFixture"): @pytest.mark.xfail( - sys.platform == "win32" and not PY37, + sys.platform == "win32", reason="Windows is case insensitive for the most part", ) def test_builder_find_case_sensitive_excluded_files(mocker: "MockerFixture"): @@ -54,7 +53,7 @@ def test_builder_find_case_sensitive_excluded_files(mocker: "MockerFixture"): @pytest.mark.xfail( - sys.platform == "win32" and not PY37, + sys.platform == "win32", reason="Windows is case insensitive for the most part", ) def test_builder_find_invalid_case_sensitive_excluded_files(mocker: "MockerFixture"): diff --git a/tests/testutils.py b/tests/testutils.py index d62a80c9f..0f21e7b42 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -7,13 +7,12 @@ from contextlib import contextmanager from pathlib import Path from typing import Any -from typing import ContextManager from typing import Dict +from typing import Generator from typing import List from typing import Optional from poetry.core.toml import TOMLFile -from poetry.core.utils._compat import PY37 __toml_build_backend_patch__ = { @@ -27,7 +26,7 @@ @contextmanager def temporary_project_directory( path: Path, toml_patch: Optional[Dict[str, Any]] = None -) -> ContextManager[str]: +) -> Generator[str, None, None]: """ Context manager that takes a project source directory, copies content to a temporary directory, patches the `pyproject.toml` using the provided patch, or using the default @@ -56,10 +55,7 @@ def subprocess_run(*args: str, **kwargs: Any) -> subprocess.CompletedProcess: """ Helper method to run a subprocess. Asserts for success. """ - compat_kwargs = {"text" if PY37 else "universal_newlines": True} - result = subprocess.run( - args, **compat_kwargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs - ) + result = subprocess.run(args, text=True, capture_output=True, **kwargs) assert result.returncode == 0 return result diff --git a/tox.ini b/tox.ini index 709ed18ba..a49750a38 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 3.3.0 isolated_build = True -envlist = py36, py37, py38, py39, pypy3, integration +envlist = py37, py38, py39, pypy3, integration [testenv] whitelist_externals = poetry diff --git a/vendors/poetry.lock b/vendors/poetry.lock index ea3e4b636..14b83367f 100644 --- a/vendors/poetry.lock +++ b/vendors/poetry.lock @@ -125,8 +125,8 @@ testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake [metadata] lock-version = "1.1" -python-versions = "^3.6" -content-hash = "6790cea1370c2296b96f05af2218de159499268429c0c81757de8e4e90bfa9b0" +python-versions = "^3.7" +content-hash = "15291fd8e716868c668d60ce4df667ed983daea247aa87c9f71a7d83748e516e" [metadata.files] attrs = [ diff --git a/vendors/pyproject.toml b/vendors/pyproject.toml index 2671380a7..53e4fe4d4 100644 --- a/vendors/pyproject.toml +++ b/vendors/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.6" +python = "^3.7" jsonschema = "^3.2.0" lark-parser = "^0.9.0"