Skip to content

Commit 5dd57e7

Browse files
feat: add support for astropy >=5.1.1,<8 dependency in pyproject.yaml
feat: add support for astropy >=5.1.1,<8 dependency in pyproject.yaml
1 parent dd3b87c commit 5dd57e7

File tree

3 files changed

+49
-11
lines changed

3 files changed

+49
-11
lines changed

.github/workflows/ci.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- '__pycache__'
9-
- '.pytest_cache'
8+
- "__pycache__"
9+
- ".pytest_cache"
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
@@ -16,7 +16,11 @@ jobs:
1616
name: CI/CD Build & Test w/pytest
1717
strategy:
1818
matrix:
19-
os: [ ubuntu-latest ]
19+
os: [ubuntu-latest]
20+
python-version: ["3.11", "3.12", "3.13"]
21+
astropy-version: ["5.1.1", "6.1.7", "7.0"]
22+
23+
fail-fast: false
2024

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

@@ -34,7 +38,13 @@ jobs:
3438
cat .env
3539
3640
- name: Docker Compose Build
37-
run: docker compose -f docker-compose.yml build --build-arg INSTALL_DEV="true"
41+
run: |
42+
docker compose \
43+
-f docker-compose.yml \
44+
build \
45+
--build-arg INSTALL_DEV="true" \
46+
--build-arg PYTHON_VERSION="${{ matrix.python-version }}" \
47+
--build-arg ASTROPY_VERSION="${{ matrix.astropy-version }}"
3848
3949
- name: Run Pytest Suite
40-
run: docker compose -f docker-compose.yml run app pytest
50+
run: docker compose -f docker-compose.yml run app pytest

Dockerfile

+32-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
FROM python:3.11-buster
1+
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #
2+
3+
ARG PYTHON_VERSION=3.11
4+
5+
FROM python:${PYTHON_VERSION}-bookworm
6+
7+
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #
28

39
ENV PYTHONDONTWRITEBYTECODE 1
410
ENV PYTHONUNBUFFERED 1
511

12+
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #
13+
614
WORKDIR /usr/src/app
715

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

1727
# Allow installing dev dependencies to run tests
1828
ARG INSTALL_DEV=false
19-
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi"
29+
ARG ASTROPY_VERSION="7.0.0"
30+
31+
# Optionally "inject" the matrix version of astropy:
32+
# This modifies pyproject.toml/poetry.lock so that Poetry can pick up that version.
33+
RUN if [ -n "$ASTROPY_VERSION" ]; then \
34+
poetry add --lock "astropy==$ASTROPY_VERSION.*"; \
35+
fi
36+
37+
# Install dependencies (with or without dev)
38+
RUN bash -c "\
39+
if [ \"$INSTALL_DEV\" == 'true' ] ; then \
40+
poetry install --no-root ; \
41+
else \
42+
poetry install --no-root --no-dev ; \
43+
fi \
44+
"
45+
46+
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #
2047

2148
COPY . /usr/src/app
2249

2350
# Set the PYTHONPATH environment variable:
24-
ENV PYTHONPATH=/usr/src/app
51+
ENV PYTHONPATH=/usr/src/app
52+
53+
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ repository = "https://github.com/lgrcia/twirl"
1414
keywords = ["astronomy", "astrometry", "plate-solving"]
1515

1616
[tool.poetry.dependencies]
17-
python = "^3.9"
18-
astropy = "^5.1.1"
17+
python = ">=3.11,<3.14"
18+
astropy = ">=5.1.1,<8"
1919
astroquery = "^0.4.6"
2020
matplotlib = "^3.6.2"
2121
numpy = "^1.23.5"
@@ -122,7 +122,6 @@ fixable = [
122122
"RUF",
123123
"SIM",
124124
"SLF",
125-
"TCH",
126125
"TID",
127126
"TRY",
128127
"UP",

0 commit comments

Comments
 (0)