Skip to content

Commit

Permalink
Fix docs building and deployment (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanep97 authored Apr 11, 2024
1 parent 4982cc9 commit 980546f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:

docs:
runs-on: [self-hosted, x64, Linux, ubuntu, generic]
# Don't run if this is a tag push, already done during docs deployment (docs.yml)
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}

steps:
- uses: actions/checkout@v4
Expand All @@ -110,6 +112,13 @@ jobs:
pip install -e .[doc]
python -c 'import iop4lib; print(iop4lib.__version__)'
- name: Use mounted astrometry index files
run: |
ln -s /mnt/astrometry_cache $HOME/.astrometry_cache
- name: Check astrometry index files were correctly mounted
run: ls $HOME/.astrometry_cache/5200/index-5200-00.fits

- name: Download test data
env:
TEST_DATA_PASSWORD: ${{ secrets.test_data_password }}
Expand All @@ -130,5 +139,8 @@ jobs:
python manage.py migrate --no-input
ls -lh $HOME/.iop4data/
- name: Run iop4 on the test data
run: iop4 --list-local

- name: Build docs
run: make docs-sphinx
12 changes: 10 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: docs

on:
push:
branches:
- main
tags:
- 'v*'

Expand Down Expand Up @@ -53,6 +51,13 @@ jobs:
pip install -e .[doc]
python -c 'import iop4lib; print(iop4lib.__version__)'
- name: Use mounted astrometry index files
run: |
ln -s /mnt/astrometry_cache $HOME/.astrometry_cache
- name: Check astrometry index files were correctly mounted
run: ls $HOME/.astrometry_cache/5200/index-5200-00.fits

- name: Download test data
env:
TEST_DATA_PASSWORD: ${{ secrets.test_data_password }}
Expand All @@ -73,6 +78,9 @@ jobs:
python manage.py migrate --no-input
ls -lh $HOME/.iop4data/
- name: Run iop4 on the test data
run: iop4 --list-local

- name: Build docs
run: make docs-sphinx

Expand Down
5 changes: 5 additions & 0 deletions iop4lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ def configure(self, config_path=None, config_db=False, config_logging=True, gono
if not os.path.exists(self.datadir):
os.makedirs(self.datadir)

# Check if the logs subdirectory exists, if not, create it

if not os.path.exists(os.path.join(self.datadir, "logs")):
os.makedirs(os.path.join(self.datadir, "logs"))

# Load OSN names from external file if indicated, load them into patterns like name*.fit, name*.fits, or name*.fts.

if self.osn_source_list_path is not None and os.path.exists(self.osn_source_list_path):
Expand Down
2 changes: 1 addition & 1 deletion iop4lib/iop4.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def parse_config_overrides(overrides):
# correct the type of the config options
for k, v in config.items():
# interpret the log_level option
if k == "log_level":
if k == "log_level" and not v.isnumeric():
v = config[k] = getattr(logging, v.upper())
# check the type of the config option, if it is an int, convert it
if k in iop4conf and isinstance(iop4conf[k], int):
Expand Down

0 comments on commit 980546f

Please sign in to comment.