mirror of
https://github.com/datafolklabs/cement.git
synced 2026-02-06 13:42:03 +00:00
Resolves Issue 357
This commit is contained in:
parent
b4e482aa45
commit
eb5ffcfd49
@ -1038,7 +1038,7 @@ class App(meta.MetaMixin):
|
||||
self._unlay_cement()
|
||||
|
||||
if code is not None:
|
||||
assert type(code) == int, \
|
||||
assert type(code) is int, \
|
||||
"Invalid exit status code (must be integer)"
|
||||
self.exit_code = code
|
||||
|
||||
|
||||
@ -360,7 +360,7 @@ class HandlerManager(object):
|
||||
meta_defaults = kwargs.get('meta_defaults', None)
|
||||
if meta_defaults is None:
|
||||
meta_defaults = {}
|
||||
if type(handler_def) == str:
|
||||
if type(handler_def) is str:
|
||||
_meta_label = "%s.%s" % (interface, handler_def)
|
||||
meta_defaults = self.app._meta.meta_defaults.get(_meta_label,
|
||||
{})
|
||||
@ -372,7 +372,7 @@ class HandlerManager(object):
|
||||
setup = kwargs.get('setup', False)
|
||||
han = None
|
||||
|
||||
if type(handler_def) == str:
|
||||
if type(handler_def) is str:
|
||||
han = self.get(interface, handler_def)(**meta_defaults)
|
||||
elif hasattr(handler_def, '_meta'):
|
||||
if not self.registered(interface, handler_def._meta.label):
|
||||
|
||||
@ -48,7 +48,7 @@ class ConfigParserConfigHandler(config.ConfigHandler, RawConfigParser):
|
||||
assert isinstance(dict_obj, dict), "Dictionary object required."
|
||||
|
||||
for section in list(dict_obj.keys()):
|
||||
if type(dict_obj[section]) == dict:
|
||||
if type(dict_obj[section]) is dict:
|
||||
if section not in self.get_sections():
|
||||
self.add_section(section)
|
||||
|
||||
|
||||
@ -59,11 +59,11 @@ class MemcachedCacheHandler(cache.CacheHandler):
|
||||
hosts = self._config('hosts')
|
||||
fixed_hosts = []
|
||||
|
||||
if type(hosts) == str:
|
||||
if type(hosts) is str:
|
||||
parts = hosts.split(',')
|
||||
for part in parts:
|
||||
fixed_hosts.append(part.strip())
|
||||
elif type(hosts) == list:
|
||||
elif type(hosts) is list:
|
||||
fixed_hosts = hosts
|
||||
self.app.config.set(self._meta.config_section, 'hosts', fixed_hosts)
|
||||
|
||||
|
||||
@ -64,6 +64,13 @@ services:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile.dev-py310
|
||||
|
||||
cement-py311:
|
||||
<<: *DEFAULTS
|
||||
image: "cement:dev-py311"
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile.dev-py311
|
||||
|
||||
redis:
|
||||
image: redis:latest
|
||||
hostname: redis
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
FROM python:3.11-alpine
|
||||
FROM python:3.12-alpine
|
||||
LABEL MAINTAINER="BJ Dierkes <derks@datafolklabs.com>"
|
||||
ENV PS1="\[\e[0;33m\]|> cement <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
ENV PS1="\[\e[0;33m\]|> cement-py312 <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
|
||||
WORKDIR /src
|
||||
COPY requirements-dev.txt /src/
|
||||
@ -19,7 +19,8 @@ RUN apk update \
|
||||
openssl-dev \
|
||||
jq \
|
||||
&& ln -sf /usr/bin/vim /usr/bin/vi \
|
||||
&& pip install --no-cache-dir -r requirements-dev.txt
|
||||
&& pip install --no-cache-dir -r requirements-dev.txt \
|
||||
&& pip install --upgrade -r requirements-dev.txt
|
||||
COPY . /src
|
||||
COPY docker/vimrc /root/.vimrc
|
||||
RUN python setup.py develop
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
FROM python:3.11-alpine
|
||||
LABEL MAINTAINER="BJ Dierkes <derks@datafolklabs.com>"
|
||||
ENV PS1="\[\e[0;33m\]|> cement-py310 <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
ENV PS1="\[\e[0;33m\]|> cement-py311 <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
|
||||
WORKDIR /src
|
||||
COPY requirements-dev.txt /src/
|
||||
|
||||
27
docker/Dockerfile.dev-py312
Normal file
27
docker/Dockerfile.dev-py312
Normal file
@ -0,0 +1,27 @@
|
||||
FROM python:3.12-alpine
|
||||
LABEL MAINTAINER="BJ Dierkes <derks@datafolklabs.com>"
|
||||
ENV PS1="\[\e[0;33m\]|> cement-py312 <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
|
||||
WORKDIR /src
|
||||
COPY requirements-dev.txt /src/
|
||||
RUN apk update \
|
||||
&& apk add libmemcached-dev \
|
||||
gcc \
|
||||
musl-dev \
|
||||
cyrus-sasl-dev \
|
||||
zlib-dev \
|
||||
make \
|
||||
vim \
|
||||
bash \
|
||||
git \
|
||||
libffi \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
jq \
|
||||
&& ln -sf /usr/bin/vim /usr/bin/vi \
|
||||
&& pip install --no-cache-dir -r requirements-dev.txt \
|
||||
&& pip install --upgrade -r requirements-dev.txt
|
||||
COPY . /src
|
||||
COPY docker/vimrc /root/.vimrc
|
||||
RUN python setup.py develop
|
||||
CMD ["/bin/bash"]
|
||||
Loading…
Reference in New Issue
Block a user