-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce poetry to lock dependencies
- Loading branch information
Hanfei Shen
committed
Mar 1, 2021
1 parent
441978e
commit 5018477
Showing
12 changed files
with
1,396 additions
and
110 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
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 |
---|---|---|
@@ -1,19 +1,26 @@ | ||
FROM python:3.9-slim AS builder | ||
|
||
ARG POETRY_VERSION=1.1.4 | ||
RUN pip install poetry==$POETRY_VERSION | ||
|
||
WORKDIR /src | ||
|
||
COPY pyproject.toml poetry.lock README.md pylintrc ./ | ||
COPY marge/ ./marge/ | ||
RUN poetry export -o requirements.txt && \ | ||
poetry build | ||
|
||
|
||
FROM python:3.9-slim | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
git-core \ | ||
&& \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /src | ||
|
||
ADD requirements_frozen.txt ./ | ||
RUN pip install -r ./requirements_frozen.txt | ||
COPY --from=builder /src/requirements.txt /src/dist/marge-*.tar.gz /tmp/ | ||
|
||
ADD version ./ | ||
ADD setup.py ./ | ||
ADD marge.app ./ | ||
ADD marge/ ./marge/ | ||
RUN python ./setup.py install | ||
RUN pip install -r /tmp/requirements.txt && \ | ||
pip install /tmp/marge-*.tar.gz | ||
|
||
ENTRYPOINT ["marge.app"] | ||
ENTRYPOINT ["marge"] |
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,19 @@ | ||
from marge.app import main | ||
|
||
|
||
def run(): | ||
try: | ||
main() | ||
except Exception as err: | ||
print('Exception occured') | ||
if hasattr(err, 'stdout'): | ||
# pylint: disable=no-member | ||
print(f'stdout was: {err.stdout}') | ||
if hasattr(err, 'stderr'): | ||
# pylint: disable=no-member | ||
print(f'stderr was: {err.stderr}') | ||
raise | ||
|
||
|
||
if __name__ == '__main__': | ||
run() |
Oops, something went wrong.