Skip to content
Draft
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
7 changes: 7 additions & 0 deletions .github/.dependabot.yml
Comment thread
morcuended marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Maintain dependencies for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
39 changes: 32 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,20 @@ jobs:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

tests:
runs-on: [self-hosted, x64, Linux, ubuntu, generic]
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
strategy:
max-parallel: 1
matrix:
Expand All @@ -47,7 +55,7 @@ jobs:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -64,8 +72,10 @@ jobs:
pip install build
python -m build

- name: Install the package
run: pip install .[test]
- name: Install the package and coverage library
run: |
pip install .[test]
python -Im pip install --upgrade coverage[toml]

- name: Install the package in editable mode with all additional dependencies
run: pip install --editable .[all]
Expand All @@ -87,8 +97,23 @@ jobs:
ls -lh $HOME/.astrometry_cache/5200/index-5200-00.fits
ls -lh $HOME/iop4testdata.$TESTDATA_MD5SUM.tar.gz

- name: Run tests (with -o log_cli=true -o log_cli_level=DEBUG to debug CI actions)
run: pytest -o log_cli=true -o log_cli_level=DEBUG -vxs tests
- name: Run tests with coverage report (with -o log_cli=true -o log_cli_level=DEBUG to debug CI actions)
run: pytest -o log_cli=true -o log_cli_level=DEBUG -vxs --cov=iop4lib tests

- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3.24
with:
GITHUB_TOKEN: ${{ github.token }}

- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
name: python-coverage-comment-action
# If you use a different name, update COMMENT_FILENAME accordingly
path: python-coverage-comment-action.txt


docs:
Expand All @@ -105,7 +130,7 @@ jobs:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# .github/workflows/coverage.yml
name: Post coverage comment

on:
workflow_run:
workflows: ["CI"]
types:
- completed

jobs:
test:
name: Run tests & display coverage
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
# Gives the action the necessary permissions for looking up the
# workflow that launched this workflow, and download the related
# artifact that contains the comment to be published
actions: read
steps:
# DO NOT run actions/checkout here, for security reasons
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
- name: Post comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
# Update those if you changed the default values:
# COMMENT_ARTIFACT_NAME: python-coverage-comment-action
# COMMENT_FILENAME: python-coverage-comment-action.txt
2 changes: 1 addition & 1 deletion .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: git fetch --tags --force origin

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions iop4lib/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
datadir: ~/.iop4data/ # <str> Path to iop4data data folder.
set_rawdata_readonly: False # <bool> True / False (sets raw fits file to readonly when downloading them or creating a RawFit object).
db_path: ~/.iop4data/iop4.db # Path to iop4 sqlite database file.
astrometry_cache_path: ~/.astrometry_cache/ # <tr> Path to store the astromery index files.
astrometry_cache_path: ~/.astrometry_cache/ # <str> Path to store the astrometry index files.
nthreads: 4 # <int> Number of threads / processes to use (e.g. 4).
astrometry_timeout: 20 # <int> Timeout in minutes for astrometry solving.
astrometry_allsky_allow: false # <bool> Whether to allow all sky searches in the astrometry.net solver. If there are many all-sky images and nthreads is too high, it might cause very high memory consumption.
astrometry_allsky_septhreshold: 25 # <int> Threshold of detected poinint mismatch to trigger an all-sky search.
astrometry_allsky_septhreshold: 25 # <int> Threshold of detected pointing mismatch to trigger an all-sky search.

################
### GRAPHICS ###
Expand Down Expand Up @@ -54,7 +54,7 @@ osn_t150_password: null # <yourosnpassword>

osn_source_list_path: null # <path/to/osn/source/list>

# List of (case insentitive) regex patterns.
# List of (case insensitive) regex patterns.
# Files matching any of these patterns will be downloaded from OSN.
# For example, (^BLLac.*\.fits?$) will match file names starting with BLLac
# and ending in .fit, .fits, or .fts. You can include your initials here,
Expand Down
3 changes: 1 addition & 2 deletions tests/test_caha_cafos.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
from .fixtures import load_test_catalog



@pytest.mark.django_db(transaction=True)
def test_build_multi_proc_photopol(load_test_catalog):
""" Test the whole building process of reduced fits through multiprocessing

Also tests here relative photometry and polarimetry results and their
quality (value + uncertainties) (to avoud losing time reducing them
quality (value + uncertainties) (to avoid losing time reducing them
in another test function).
"""

Expand Down