Skip to content

Commit 4d4b9f1

Browse files
committed
MB-57341 Fix typecheck stage in CV
Change-Id: I5b687458cbe373f678da82efb20bcf6a6c578b89 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/192464 Well-Formed: Restriction Checker Reviewed-by: James Lee <james.lee@couchbase.com> Tested-by: Safian Ali <safian.ali@couchbase.com>
1 parent 73715f3 commit 4d4b9f1

7 files changed

Lines changed: 199 additions & 156 deletions

File tree

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pipeline {
5454

5555
timeout(time: 10, unit: "MINUTES") {
5656
// Install the tools required to lint and fetch coverage profiles
57-
sh "pip3 install --user pylint==2.10.2 mypy==0.730 coverage==5.2 pytest==5.4.3 autopep8==1.5.7"
57+
sh "pip3 install --user pylint==2.10.2 mypy==1.3.0 coverage==5.2 pytest==5.4.3 autopep8==1.5.7"
5858

5959
// Install the dependencies required to build/run the cli tools
6060
sh "pip3 install --user cryptography==3.4.8 pem==21.2.0 pycryptodome==3.10.1 pyopenssl==20.0.1 python-snappy==0.6.0 requests==2.26.0 requests-toolbelt==0.9.1"

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ requests-toolbelt = "==0.9.1"
1515
[dev-packages]
1616
autopep8 = "==1.5.7"
1717
jedi = "==0.18.0"
18-
mypy = "==0.910"
18+
mypy = "==1.3.0"
1919
pylint = "==2.10.2"
2020
rope = "==0.19.0"
2121
types-pyopenssl = "==20.0.5"

Pipfile.lock

Lines changed: 189 additions & 146 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jenkins/.aspell.en.pws

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ FTS
7474
fts
7575
fullEviction
7676
gamesim
77-
gcs
7877
GCS
78+
gcs
7979
geolocation
8080
GSI
8181
gsi

pump.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def filter_source_buckets(self, source_map: Dict[str, Any]) -> List[Dict[str, An
237237
logging.debug(f'source_buckets: {",".join([return_string(n["name"]) for n in source_buckets])}')
238238

239239
bucket_source = getattr(self.opts, "bucket_source", None)
240-
bucket_source = return_string(bucket_source)
240+
bucket_source = return_string(bucket_source) # type: ignore
241241
if bucket_source:
242242
logging.debug(f'bucket_source: {bucket_source}')
243243
source_buckets = [b for b in source_buckets
@@ -983,7 +983,7 @@ def parse_spec(opts, spec: str, port: int) -> Tuple[str, int, str, str, Any]:
983983

984984
pair = netloc.split('@') # [ "user:pwsd", "host:port" ].
985985
host = p.hostname
986-
port = p.port
986+
port = p.port # type: ignore
987987
try:
988988
_ = int(port)
989989
except ValueError:
@@ -996,7 +996,7 @@ def parse_spec(opts, spec: str, port: int) -> Tuple[str, int, str, str, Any]:
996996
username = username or (pair[0] + ':').split(':')[0]
997997
password = password or (pair[0] + ':').split(':')[1]
998998

999-
return host, port, username, password, p[2]
999+
return host, port, username, password, p[2] # type: ignore
10001000

10011001

10021002
def rest_request(host: str, port: int, user: Optional[str], pswd: Optional[str], use_ssl: bool, path: str,

pump_cb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def consume_design(opts, sink_spec: str, sink_map, source_bucket,
332332
if conn:
333333
conn.close()
334334
if err:
335-
return f'error: could not restore design doc id: {id}; response: {response}; err: {err}'
335+
return f'error: could not restore design doc id: {id!r}; response: {response!r}; err: {err!r}'
336336
else:
337337
stmts = sd.get('statements', [])
338338
hostname = f'http://{spec_parts[0]}:{spec_parts[1]!s}'
@@ -391,7 +391,7 @@ def consume_design(opts, sink_spec: str, sink_map, source_bucket,
391391
if conn:
392392
conn.close()
393393
if err:
394-
return f'error: could not restore design doc id: {id}; response: {response}; err: {err}'
394+
return f'error: could not restore design doc id: {id!r}; response: {response!r}; err: {err!r}'
395395
except Exception as e:
396396
return f'error: design sink exception: {e}; couch_api_base: {couch_api_base}'
397397

pump_mc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import struct
88
import sys
99
import time
10-
from typing import Any, Dict, List, Optional, Tuple
10+
from typing import Any, Dict, List, Optional, Tuple, Union
1111

1212
import snappy # pylint: disable=import-error
1313

@@ -569,7 +569,7 @@ def connect(self) -> Tuple[couchbaseConstants.PUMP_ERROR, Optional[cb_bin_client
569569

570570
@staticmethod
571571
def connect_mc(host: str, port: int, username: str, password: str, bucket: Optional[str], use_ssl: bool = False,
572-
verify: bool = True, ca_cert: str = None, collections: bool = False) -> \
572+
verify: bool = True, ca_cert: Union[str, None] = None, collections: bool = False) -> \
573573
Tuple[couchbaseConstants.PUMP_ERROR, Optional[cb_bin_client.MemcachedClient]]:
574574
return pump.get_mcd_conn(host, port, username, password, bucket, use_ssl=use_ssl, verify=verify,
575575
ca_cert=ca_cert, collections=collections)

0 commit comments

Comments
 (0)