update dependencies

This commit is contained in:
Henning Jacobs
2023-02-09 22:04:18 +01:00
parent 6876dbe0e0
commit 5f139bbac0
8 changed files with 741 additions and 784 deletions

1
.gitignore vendored
View File

@@ -14,3 +14,4 @@ scm-source.json
.coverage .coverage
.pytest_cache/ .pytest_cache/
.mypy_cache .mypy_cache
.python-version

View File

@@ -17,17 +17,17 @@ repos:
# formatters # formatters
- repo: https://github.com/asottile/reorder_python_imports - repo: https://github.com/asottile/reorder_python_imports
rev: v3.1.0 rev: v3.9.0
hooks: hooks:
- id: reorder-python-imports - id: reorder-python-imports
- repo: https://github.com/ambv/black - repo: https://github.com/ambv/black
rev: 22.3.0 rev: 23.1.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.32.1 rev: v3.3.1
hooks: hooks:
- id: pyupgrade - id: pyupgrade
stages: [push] stages: [push]
@@ -42,7 +42,7 @@ repos:
stages: [push] stages: [push]
- repo: https://github.com/PyCQA/pydocstyle - repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1 rev: 6.3.0
hooks: hooks:
- id: pydocstyle - id: pydocstyle
args: ["--ignore=D10,D21,D202"] args: ["--ignore=D10,D21,D202"]
@@ -68,19 +68,19 @@ repos:
stages: [push] stages: [push]
- repo: https://github.com/adrienverge/yamllint - repo: https://github.com/adrienverge/yamllint
rev: v1.26.3 rev: v1.29.0
hooks: hooks:
- id: yamllint - id: yamllint
args: ["--strict", "-d", "{rules: {line-length: {max: 180}}}"] args: ["--strict", "-d", "{rules: {line-length: {max: 180}}}"]
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.950 rev: v1.0.0
hooks: hooks:
- id: mypy - id: mypy
additional_dependencies: ["types-requests", "types-PyYAML", "types-redis"] additional_dependencies: ["types-requests", "types-PyYAML", "types-redis"]
- repo: https://gitlab.com/pycqa/flake8 - repo: https://github.com/pycqa/flake8
rev: 3.9.2 rev: 6.0.0
hooks: hooks:
- id: flake8 - id: flake8
@@ -93,7 +93,7 @@ repos:
# miscellaneous # miscellaneous
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0 rev: v4.4.0
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-docstring-first - id: check-docstring-first
@@ -108,7 +108,7 @@ repos:
args: ["--django"] args: ["--django"]
- repo: https://github.com/pre-commit/pygrep-hooks - repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0 rev: v1.10.0
hooks: hooks:
# - id: rst-backticks # - id: rst-backticks
- id: python-use-type-annotations - id: python-use-type-annotations
@@ -121,6 +121,6 @@ repos:
# http://jorisroovers.com/gitlint/#using-gitlint-through-pre-commit # http://jorisroovers.com/gitlint/#using-gitlint-through-pre-commit
- repo: https://github.com/jorisroovers/gitlint - repo: https://github.com/jorisroovers/gitlint
rev: v0.17.0 rev: v0.19.0dev
hooks: hooks:
- id: gitlint - id: gitlint

View File

@@ -2,9 +2,12 @@ FROM python:3.10-slim
WORKDIR / WORKDIR /
RUN apt-get update && apt-get install --yes --no-install-recommends gcc && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install --yes --no-install-recommends curl gcc libc-dev libffi-dev && rm -rf /var/lib/apt/lists/*
RUN pip3 install poetry RUN pip3 install poetry
# https://github.com/rust-lang/cargo/issues/8719#issuecomment-1253575253
#ENV PATH=/root/.cargo/bin:$PATH
#RUN --mount=type=tmpfs,target=/root/.cargo curl https://sh.rustup.rs -sSf | bash -s -- -y && pip install poetry
COPY poetry.lock / COPY poetry.lock /
COPY pyproject.toml / COPY pyproject.toml /

View File

@@ -19,7 +19,7 @@ lint: install
poetry run pre-commit run --all-files poetry run pre-commit run --all-files
test: lint install test: lint install
poetry run coverage run --source=kube_ops_view -m py.test -v poetry run coverage run --source=kube_ops_view -m pytest -v
poetry run coverage report poetry run coverage report
version: version:
@@ -37,6 +37,7 @@ docker-arm: appjs
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name arm-node --append --use --platform "linux/arm" docker buildx create --name arm-node --append --use --platform "linux/arm"
docker buildx build --build-arg "VERSION=$(VERSION)" --platform "linux/arm" -t $(IMAGE):$(TAG) --load . docker buildx build --build-arg "VERSION=$(VERSION)" --platform "linux/arm" -t $(IMAGE):$(TAG) --load .
docker buildx rm arm-node
@echo 'Docker image $(IMAGE):$(TAG) can now be used.' @echo 'Docker image $(IMAGE):$(TAG) can now be used.'
push: docker push: docker

327
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,12 +6,10 @@ def expo(n: int, base=2, factor=1, max_value=None):
Adapted from https://github.com/litl/backoff/blob/master/backoff.py (MIT License) Adapted from https://github.com/litl/backoff/blob/master/backoff.py (MIT License)
Args: :param int n: The exponent.
---- :param int base: The mathematical base of the exponentiation operation
n: The exponent. :param int factor: Factor to multiply the exponentation by.
base: The mathematical base of the exponentiation operation :param int max_value: The maximum value to yield. Once the value in the
factor: Factor to multiply the exponentation by.
max_value: The maximum value to yield. Once the value in the
true exponential sequence exceeds this, the value true exponential sequence exceeds this, the value
of max_value will forever after be yielded. of max_value will forever after be yielded.
@@ -31,10 +29,8 @@ def random_jitter(value, jitter=1):
This adds up to 1 second of additional time to the original value. This adds up to 1 second of additional time to the original value.
Prior to backoff version 1.2 this was the default jitter behavior. Prior to backoff version 1.2 this was the default jitter behavior.
Args: :param float value: The unadulterated backoff value.
---- :param float jitter: Jitter amount.
value: The unadulterated backoff value.
jitter: Jitter amount.
""" """
return value + random.uniform(0, jitter) return value + random.uniform(0, jitter)
@@ -49,9 +45,7 @@ def full_jitter(value):
AWS blog's post on the performance of various jitter algorithms. AWS blog's post on the performance of various jitter algorithms.
(http://www.awsarchitectureblog.com/2015/03/backoff.html) (http://www.awsarchitectureblog.com/2015/03/backoff.html)
Args: :param float value: The unadulterated backoff value.
----
value: The unadulterated backoff value.
""" """
return random.uniform(0, value) return random.uniform(0, value)

View File

@@ -18,7 +18,6 @@ session = requests.Session()
# https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/resource-metrics-api.md # https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/resource-metrics-api.md
class NodeMetrics(APIObject): class NodeMetrics(APIObject):
version = "metrics.k8s.io/v1beta1" version = "metrics.k8s.io/v1beta1"
endpoint = "nodes" endpoint = "nodes"
kind = "NodeMetrics" kind = "NodeMetrics"
@@ -26,7 +25,6 @@ class NodeMetrics(APIObject):
# https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/resource-metrics-api.md # https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/resource-metrics-api.md
class PodMetrics(NamespacedAPIObject): class PodMetrics(NamespacedAPIObject):
version = "metrics.k8s.io/v1beta1" version = "metrics.k8s.io/v1beta1"
endpoint = "pods" endpoint = "pods"
kind = "PodMetrics" kind = "PodMetrics"

1145
poetry.lock generated

File diff suppressed because it is too large Load Diff