Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fixup: build docker alpine 316 #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:3.12
LABEL Maintainer="Michael Stella <michael@jwplayer.com>"
FROM alpine:3.16
LABEL Maintainer="Team DevOps <devops@jwplayer.com>"

ARG PIP_EXTRA_INDEX_URL
ENV PYTHON_EGG_CACHE=/tmp \
Expand All @@ -19,8 +19,11 @@ RUN apk add --no-cache \
ca-certificates \
libssl1.1 \
python3 \
gcc \
musl-dev \
py3-multidict \
py3-pip \
python3-dev \
py3-setuptools \
py3-yarl \
tini \
Expand All @@ -36,7 +39,7 @@ RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone && apk
COPY rssalertbot /app/rssalertbot
COPY CHANGELOG.rst MANIFEST.in setup.py /app/
WORKDIR /app
RUN pip install -U pip
RUN pip install setuptools==57.5.0
RUN pip install -e '.[dynamo,slack]'

# don't run as root
Expand Down
13 changes: 9 additions & 4 deletions rssalertbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import yaml

from box import Box
from box import Box, BoxList
from .util import deepmerge

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -134,9 +134,14 @@ def merge_dict(self, data):
"""
Merge a dictionary into the config.
"""

if not isinstance(data, dict):
raise TypeError("Argument 'data' must be of type 'dict'")
if isinstance(data, Box):
data = data.to_dict()
if isinstance(data, BoxList):
data = dict(data.to_list())

if type(data) != type({}): # noqa: E721

raise TypeError(f"Argument 'data' must be of type 'dict' not {type(data)}")

self.update(deepmerge(self.to_dict(), data))

Expand Down