Skip to content

Commit

Permalink
Merge branch 'master' into fix_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon authored Mar 17, 2023
2 parents 09dd18c + f6b2a24 commit 4022382
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.KGX_PYPI }}
password: ${{ secrets.KGX_PYPI_TOKEN }}
39 changes: 31 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
FROM python:3.9
MAINTAINER Sierra Moxon "[email protected]"
FROM python:3.9-bullseye as builder

# Clone repository
RUN git clone https://github.com/biolink/kgx
# https://stackoverflow.com/questions/53835198/integrating-python-poetry-with-docker
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.2.1

# Setup
RUN cd kgx && git checkout tags/2.0.0 && poetry install
# Install Poetry
RUN pip install "poetry==$POETRY_VERSION"
RUN poetry self add "poetry-dynamic-versioning[plugin]"

# Make data directory
RUN mkdir data
WORKDIR /code

# Build project. The .git directory is needed for poetry-dynamic-versioning
COPY ./.git ./.git
COPY pyproject.toml poetry.lock README.md .
COPY kgx kgx/
RUN poetry build

#######################################
FROM python:3.9-slim-bullseye as runner

RUN useradd --create-home kgxuser
WORKDIR /kgx
RUN mkdir data
USER kgxuser
ENV PATH="${PATH}:/home/kgxuser/.local/bin"

COPY --from=builder /code/dist/*.whl /tmp
RUN pip install --user /tmp/*.whl

# command to run on container start

CMD ["/bin/bash"]
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ tox = "^3.28.0"
tox-docker = "*"
bmt = "^1.0.0"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "pep440"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry.scripts]
kgx = "kgx.cli:cli"

0 comments on commit 4022382

Please sign in to comment.