From ba8e8df78ff21cf60a4c0fdc649d0cd070c60df6 Mon Sep 17 00:00:00 2001 From: Bill Sager Date: Thu, 26 Oct 2023 11:55:47 -0700 Subject: [PATCH] eliminate lint and build error: ERROR: setuptools==58.1.0 is used in combination with setuptools_scm>=8.x --- pyproject.toml | 5 +++-- requirements.txt | 3 +-- rsconnect/main.py | 2 +- tests/test_main.py | 21 ++++++++------------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2da6e227..070d5d68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ dependencies = [ "pip>=10.0.0", "semver>=2.0.0,<3.0.0", "pyjwt>=2.4.0", + "click>=8.0.0", ] dynamic = ["version"] @@ -33,9 +34,9 @@ test = [ "pytest-cov", "pytest-mypy", "pytest", - "setuptools_scm[toml]", + "setuptools>=61", + "setuptools_scm[toml]>=3.4", "twine", - "types-click", "types-Flask", "types-six", ] diff --git a/requirements.txt b/requirements.txt index d7965153..ad2badc6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ wheel # project.dependencies six>=1.14.0 -click>=7.0.0 +click>=8.0.0 pip>=10.0.0 semver>=2.0.0,<3.0.0 pyjwt>=2.4.0 @@ -29,6 +29,5 @@ pytest-mypy pytest setuptools_scm[toml] twine -types-click types-Flask types-six diff --git a/rsconnect/main.py b/rsconnect/main.py index e61e775b..784c8bb2 100644 --- a/rsconnect/main.py +++ b/rsconnect/main.py @@ -123,7 +123,7 @@ def output_params( varName = k.replace("-", "_") if varName in {"api_key"}: val = "**********" - source = ctx.get_parameter_source(varName) + source = ctx.get_parameter_source(varName) # type: ignore if source: click.echo(" {}:\t{} (from {})".format(k, val, source.name)) # type: ignore else: diff --git a/tests/test_main.py b/tests/test_main.py index 071ecaa3..0f87752c 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1152,11 +1152,9 @@ def test_bootstrap_invalid_server(self): result = runner.invoke(cli, ["bootstrap", "--server", "123.some.ip.address", "--jwt-keypath", self.jwt_keypath]) self.assertEqual(result.exit_code, 1, result.output) self.assertGreater( - result.output.find("Error: Server URL expected to begin with transfer protocol (ex. http/https).\n"), - -1 + result.output.find("Error: Server URL expected to begin with transfer protocol (ex. http/https).\n"), -1 ) - def test_boostrap_missing_jwt_option(self): """ If jwt keyfile is not specified, it needs to be set using an environment variable @@ -1165,8 +1163,7 @@ def test_boostrap_missing_jwt_option(self): result = runner.invoke(cli, ["bootstrap", "--server", "http://a_server"]) self.assertEqual(result.exit_code, 1, result.output) self.assertGreater( - result.output.find("Error: Must specify secret key using either a keyfile or environment variable.\n"), - -1 + result.output.find("Error: Must specify secret key using either a keyfile or environment variable.\n"), -1 ) def test_bootstrap_conflicting_jwt_option(self): @@ -1179,8 +1176,7 @@ def test_bootstrap_conflicting_jwt_option(self): result = runner.invoke(cli, self.default_cli_args) self.assertEqual(result.exit_code, 1, result.output) self.assertGreater( - result.output.find("Error: Cannot specify secret key using both a keyfile and environment variable."), - -1 + result.output.find("Error: Cannot specify secret key using both a keyfile and environment variable."), -1 ) del os.environ[SECRET_KEY_ENV] @@ -1195,8 +1191,10 @@ def test_bootstrap_invalid_env_secret_key(self): result = runner.invoke(cli, ["bootstrap", "--server", "http://a_server"]) self.assertEqual(result.exit_code, 1, result.output) self.assertGreater( - result.output.find("Error: Unable to decode base64 data from environment variable: CONNECT_BOOTSTRAP_SECRETKEY\n"), - -1 + result.output.find( + "Error: Unable to decode base64 data from environment variable: CONNECT_BOOTSTRAP_SECRETKEY\n" + ), + -1, ) del os.environ[SECRET_KEY_ENV] @@ -1238,7 +1236,4 @@ def test_boostrap_raw_output_nonsuccess(self): self.assertEqual(result.exit_code, 0, result.output) - self.assertEqual( - result.output.find("Error:"), - -1 - ) + self.assertEqual(result.output.find("Error:"), -1)