Skip to content

feat: add support for astropy >=6.1.7<8 dependency in pyproject.yaml #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- main
paths-ignore:
- '__pycache__'
- '.pytest_cache'
- "__pycache__"
- ".pytest_cache"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -16,7 +16,11 @@ jobs:
name: CI/CD Build & Test w/pytest
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest]
python-version: ["3.11", "3.12", "3.13"]
astropy-version: ["6.1.7", "7.0"]

fail-fast: false

runs-on: ${{ matrix.os }}

Expand All @@ -34,7 +38,13 @@ jobs:
cat .env

- name: Docker Compose Build
run: docker compose -f docker-compose.yml build --build-arg INSTALL_DEV="true"
run: |
docker compose \
-f docker-compose.yml \
build \
--build-arg INSTALL_DEV="true" \
--build-arg PYTHON_VERSION="${{ matrix.python-version }}" \
--build-arg ASTROPY_VERSION="${{ matrix.astropy-version }}"

- name: Run Pytest Suite
run: docker compose -f docker-compose.yml run app pytest
run: docker compose -f docker-compose.yml run app pytest
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:

strategy:
matrix:
python-version: ["3.10"]
os: [ ubuntu-latest ]
os: [ubuntu-latest]
python-version: ["3.13"]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Build Package 🐍
run: poetry build

- name: Dry-run Publish to PyPI 😬
run: poetry publish --dry-run

Expand Down
35 changes: 32 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
FROM python:3.11-buster
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #

ARG PYTHON_VERSION=3.11

FROM python:${PYTHON_VERSION}-bookworm

# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #

WORKDIR /usr/src/app

# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #

# Install Poetry
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
Expand All @@ -16,9 +26,28 @@ COPY ./pyproject.toml ./poetry.lock* /usr/src/app/

# Allow installing dev dependencies to run tests
ARG INSTALL_DEV=false
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi"
ARG ASTROPY_VERSION="7.0.0"

# Optionally "inject" the matrix version of astropy:
# This modifies pyproject.toml/poetry.lock so that Poetry can pick up that version.
RUN if [ -n "$ASTROPY_VERSION" ]; then \
poetry add --lock "astropy==$ASTROPY_VERSION.*"; \
fi

# Install dependencies (with or without dev)
RUN bash -c "\
if [ \"$INSTALL_DEV\" == 'true' ] ; then \
poetry install --no-root --without docs; \
else \
poetry install --no-root --no-dev --without docs; \
fi \
"

# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #

COPY . /usr/src/app

# Set the PYTHONPATH environment variable:
ENV PYTHONPATH=/usr/src/app
ENV PYTHONPATH=/usr/src/app

# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #
Loading
Loading