-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,326 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.autopep8" | ||
}, | ||
"python.formatting.provider": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM python:3.9 | ||
FROM ubuntu:latest | ||
|
||
|
||
RUN apt-get update | ||
RUN apt-get install -y --no-install-recommends python3-setuptools python3-pip gcc python3-dev musl-dev libffi-dev git gnupg bash | ||
#RUN apk add --no-cache build-base gcc python3-dev postgresql-dev musl-dev libffi-dev git gnupg bash | ||
RUN apt-get install -y openssh-server | ||
RUN pip3 install setuptools-rust | ||
RUN pip3 install --upgrade pip | ||
RUN pip3 install poetry | ||
|
||
|
||
RUN ssh -V | ||
|
||
|
||
WORKDIR /code | ||
|
||
COPY . /code/ | ||
|
||
RUN poetry install | ||
|
||
RUN poetry run pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from collections import OrderedDict | ||
from collections.abc import MutableMapping | ||
|
||
import functools | ||
import click | ||
import sys | ||
|
||
class BarkContextObject(MutableMapping): | ||
def __init__(self): | ||
self._objects = OrderedDict() | ||
|
||
def __getitem__(self, key): | ||
return self._objects[key] | ||
|
||
def __setitem__(self, key, value): | ||
self._objects[key] = value | ||
|
||
def __delitem__(self, key): | ||
del self._objects[key] | ||
|
||
def __len__(self): | ||
return len(self._objects) | ||
|
||
def __iter__(self): | ||
return iter(self._objects) | ||
|
||
|
||
def click_prompt(prompt, err=True, **kwargs): | ||
"""Replacement for click.prompt to better work when piping input to the command. | ||
Note that we change the default of err to be True, since that's how we typically | ||
use it. | ||
""" | ||
# logger.debug(f"Input requested ({prompt})") | ||
if not sys.stdin.isatty(): # Piped from stdin, see if there is data | ||
# logger.debug("TTY detected, reading line from stdin...") | ||
line = sys.stdin.readline() | ||
if line: | ||
return line.rstrip("\n") | ||
# logger.debug("No data available on stdin") | ||
|
||
# No piped data, use standard prompt | ||
# logger.debug("Using interactive prompt...") | ||
return click.prompt(prompt, err=err, **kwargs) | ||
|
||
def click_callback(invoke_on_missing=False): | ||
def wrap(f): | ||
@functools.wraps(f) | ||
def inner(ctx, param, val): | ||
if not invoke_on_missing and not param.required and val is None: | ||
return None | ||
try: | ||
return f(ctx, param, val) | ||
except ValueError as e: | ||
ctx.fail(f'Invalid value for "{param.name}": {str(e)}') | ||
|
||
return inner | ||
|
||
return wrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.