Skip to content

Commit

Permalink
Work on github workflow items
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklinke committed Oct 12, 2024
1 parent 5a9ee85 commit 9aba848
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
if: ! steps.check-version.outputs.tag
run: |
poetry version patch &&
version=$(poetry version | awk '{ print $2 }') &&
Expand All @@ -62,7 +62,7 @@ jobs:
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
if: "! steps.check-version.outputs.tag"
if: ! steps.check-version.outputs.tag
uses: pypa/[email protected]
with:
user: __token__
Expand Down
48 changes: 24 additions & 24 deletions compose/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ARG BUILD_ENVIRONMENT=local
ARG APP_HOME=/app
ARG DEBIAN_FRONTEND=noninteractive
ARG MULTIPLE_PYTHON # Set to True if you want to use multiple Python versions

ARG PYTHON_3_9=3.9.19
ARG PYTHON_3_10=3.10.14
ARG PYTHON_3_11=3.11.9
Expand All @@ -30,22 +29,22 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

# Install pyenv
RUN git clone https://github.com/pyenv/pyenv.git .pyenv
ENV PYENV_ROOT ${APP_HOME}/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
# RUN git clone https://github.com/pyenv/pyenv.git .pyenv
# ENV PYENV_ROOT ${APP_HOME}/.pyenv
# ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH

# Install Python version(s)
RUN if [ "$MULTIPLE_PYTHON" = "True" ] ; then \
pyenv install ${PYTHON_3_12}; \
pyenv install ${PYTHON_3_11}; \
pyenv install ${PYTHON_3_10}; \
pyenv install ${PYTHON_3_9}; \
else \
pyenv install 3.12; \
fi

# Initialize pyenv
RUN eval "$(pyenv init -)"
# RUN if [ "$MULTIPLE_PYTHON" = "True" ] ; then \
# pyenv install ${PYTHON_3_12}; \
# pyenv install ${PYTHON_3_11}; \
# pyenv install ${PYTHON_3_10}; \
# pyenv install ${PYTHON_3_9}; \
# else \
# pyenv install 3.12; \
# fi

# # Initialize pyenv
# RUN eval "$(pyenv init -)"

# Add deadsnakes PPA
RUN apt-get install -y software-properties-common
Expand All @@ -67,28 +66,29 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get --no-install-recommends install -y \
python3-pip

# Install Poetry
RUN pip install poetry
# Install uv
RUN pip install --upgrade uv

# Add the venv
RUN uv venv

# Copy poetry files
COPY poetry.lock pyproject.toml ${APP_HOME}
# Copy requirements files
COPY pyproject.toml uv.lock ${APP_HOME}/

# Install dependencies:
RUN poetry config virtualenvs.create false \
&& poetry install --with dev --no-interaction --no-ansi --no-root
# Install dependencies using uv
RUN uv sync --prerelease=allow

# Copy remaining project files
COPY noxfile.py manage.py ${APP_HOME}
COPY .darglint .editorconfig .flake8 .gitignore .pre-commit-config.yaml .prettierignore .readthedocs.yml bandit.yml ${APP_HOME}
COPY CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md ${APP_HOME}
COPY ./docs/ ${APP_HOME}/docs
COPY ./example_project/ ${APP_HOME}/example_project/
COPY ./tests/ ${APP_HOME}/tests/
COPY ./src/ ${APP_HOME}/
COPY ./src/ ${APP_HOME}/src/

# Rehash pyenv shims
RUN pyenv rehash
# RUN pyenv rehash

# Project initialization:
COPY ./compose/django/entrypoint /entrypoint
Expand Down
4 changes: 2 additions & 2 deletions compose/django/start
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -o errexit
set -o pipefail
set -o nounset

python manage.py migrate --noinput --skip-checks
python manage.py runserver 0.0.0.0:8111 --skip-checks
uv run --prerelease=allow python manage.py migrate --noinput --skip-checks
uv run --prerelease=allow python manage.py runserver 0.0.0.0:8111 --skip-checks

0 comments on commit 9aba848

Please sign in to comment.