tyrannosaurus.update.Update.update()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
"""
2
For the 'update' command.
3
4
Original source: https://github.com/dmyersturnbull/tyrannosaurus
5
Copyright 2020–2021 Douglas Myers-Turnbull
6
Licensed under the Apache License, Version 2.0 (the "License");
7
you may not use this file except in compliance with the License.
8
You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0
9
"""
10
11
from __future__ import annotations
12
13
import logging
14
from typing import Mapping
15
from typing import Tuple as Tup
16
17
from tyrannosaurus.context import Context
18
from tyrannosaurus.helpers import PyPiHelper
19
20
logger = logging.getLogger(__package__)
21
22
23
class Update:
24
    def __init__(self, context: Context):
25
        self.context = context
26
27
    def update(self) -> Tup[Mapping[str, Tup[str, str]], Mapping[str, Tup[str, str]]]:
28
        helper = PyPiHelper()
29
        updates = helper.new_versions(self.context.deps)
30
        dev_updates = helper.new_versions(self.context.dev_deps)
31
        return updates, dev_updates
32
33
34
__all__ = ["Update"]
35