From c0661388a856eb05159e204c3355be7587282586 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Tue, 22 Nov 2022 10:23:01 -0800 Subject: [PATCH] Revert "Python: skip flaky poetry spec with issue comment" The associated ticket on Poetry (https://github.com/python-poetry/poetry/issues/3010) was closed because the underlying triggers were mostly resolved in `poetry` `1.2` using the new installer. In particular, see https://github.com/python-poetry/poetry/issues/3010#issuecomment-1207683271. We flipped to the new installer in https://github.com/dependabot/dependabot-core/pull/5838, so this skip should no longer be necessary. This reverts commit ceb57007bc2ca8c403e36bce7c4580a538366dc1. Additionally, this flips the fixture from a Python 2 to a Python 3 fixture. We dropped support for Python 2 a while ago, but didn't notice this test needed updating because it was skipped. Another test still needs a python 2 fixture to ensure that lockfiles still pinned to python 2 throw the correct exception. So copied the existing fixture, updated it to specify a python 3 version, and then regenerated the lockfile using: ``` PYENV_VERSION=3.10.7 pyenv exec poetry lock --no-update ``` --- .../file_updater/poetry_file_updater_spec.rb | 10 +-- .../fixtures/pyproject_files/python_310.toml | 12 +++ .../fixtures/pyproject_locks/python_310.lock | 80 +++++++++++++++++++ 3 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 python/spec/fixtures/pyproject_files/python_310.toml create mode 100644 python/spec/fixtures/pyproject_locks/python_310.lock diff --git a/python/spec/dependabot/python/file_updater/poetry_file_updater_spec.rb b/python/spec/dependabot/python/file_updater/poetry_file_updater_spec.rb index a9fca8374d9..34c3a8aed43 100644 --- a/python/spec/dependabot/python/file_updater/poetry_file_updater_spec.rb +++ b/python/spec/dependabot/python/file_updater/poetry_file_updater_spec.rb @@ -80,11 +80,9 @@ to start_with("8cea4ecb5b2230fbd4a33a67a4da004f1ccabad48352aaf040") end - # TODO: Fix flaky spec caused by an issue in poetry: - # https://github.com/python-poetry/poetry/issues/3010) - context "with a specified Python version" do - let(:pyproject_fixture_name) { "python_2.toml" } - let(:lockfile_fixture_name) { "python_2.lock" } + context "with a specified Python version", :slow do + let(:pyproject_fixture_name) { "python_310.toml" } + let(:lockfile_fixture_name) { "python_310.lock" } let(:dependency) do Dependabot::Dependency.new( @@ -107,7 +105,7 @@ ) end - skip "updates the lockfile successfully" do + it "updates the lockfile successfully" do updated_lockfile = updated_files.find { |f| f.name == "pyproject.lock" } lockfile_obj = TomlRB.parse(updated_lockfile.content) diff --git a/python/spec/fixtures/pyproject_files/python_310.toml b/python/spec/fixtures/pyproject_files/python_310.toml new file mode 100644 index 00000000000..5c5acd86ce4 --- /dev/null +++ b/python/spec/fixtures/pyproject_files/python_310.toml @@ -0,0 +1,12 @@ +[tool.poetry] +name = "PythonProjects" +version = "2.0.0" +homepage = "https://github.com/roghu/py3_projects" +license = "MIT" +readme = "README.md" +authors = ["Dependabot "] +description = "Various small python projects." + +[tool.poetry.dependencies] +python = "3.10.7" +requests = "2.18.0" diff --git a/python/spec/fixtures/pyproject_locks/python_310.lock b/python/spec/fixtures/pyproject_locks/python_310.lock new file mode 100644 index 00000000000..8acd3f85922 --- /dev/null +++ b/python/spec/fixtures/pyproject_locks/python_310.lock @@ -0,0 +1,80 @@ +[[package]] +name = "certifi" +version = "2022.9.24" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = ">=3.6" + +[[package]] +name = "chardet" +version = "3.0.4" +description = "Universal encoding detector for Python 2 and 3" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "idna" +version = "2.5" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "requests" +version = "2.18.0" +description = "Python HTTP for Humans." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +certifi = ">=2017.4.17" +chardet = ">=3.0.2,<3.1.0" +idna = ">=2.5,<2.6" +urllib3 = ">=1.21.1,<1.22" + +[package.extras] +security = ["cryptography (>=1.3.4)", "idna (>=2.0.0)", "pyOpenSSL (>=0.14)"] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] + +[[package]] +name = "urllib3" +version = "1.21.1" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = false +python-versions = "*" + +[package.extras] +secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[metadata] +lock-version = "1.1" +python-versions = "3.10.7" +content-hash = "f56ecb5b0d42f75b0c0992902acd1847a2f182b4088da95353f9bfbecc3308eb" + +[metadata.files] +certifi = [ + {file = "certifi-2022.9.24-py3-none-any.whl", hash = "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"}, + {file = "certifi-2022.9.24.tar.gz", hash = "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"}, +] +chardet = [ + {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, + {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, +] +idna = [ + {file = "idna-2.5-py2.py3-none-any.whl", hash = "sha256:cc19709fd6d0cbfed39ea875d29ba6d4e22c0cebc510a76d6302a28385e8bb70"}, + {file = "idna-2.5.tar.gz", hash = "sha256:3cb5ce08046c4e3a560fc02f138d0ac63e00f8ce5901a56b32ec8b7994082aab"}, +] +requests = [ + {file = "requests-2.18.0-py2.py3-none-any.whl", hash = "sha256:5e88d64aa56ac0fda54e77fb9762ebc65879e171b746d5479a33c4082519d6c6"}, + {file = "requests-2.18.0.tar.gz", hash = "sha256:cd0189f962787284bff715fddaad478eb4d9c15aa167bd64e52ea0f661e7ea5c"}, +] +urllib3 = [ + {file = "urllib3-1.21.1-py2.py3-none-any.whl", hash = "sha256:8ed6d5c1ff9d6ba84677310060d6a3a78ca3072ce0684cb3c645023009c114b1"}, + {file = "urllib3-1.21.1.tar.gz", hash = "sha256:b14486978518ca0901a76ba973d7821047409d7f726f22156b24e83fd71382a5"}, +]