diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16ca3c28..047b23ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 }} @@ -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 \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 33f0a71d..3360563c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,8 +2,6 @@ name: docs on: push: - branches: - - main tags: - 'v*' @@ -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 }} @@ -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 diff --git a/iop4lib/config.py b/iop4lib/config.py index 66542127..c376221c 100644 --- a/iop4lib/config.py +++ b/iop4lib/config.py @@ -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): diff --git a/iop4lib/iop4.py b/iop4lib/iop4.py index 190bf94c..6a7ebfc1 100644 --- a/iop4lib/iop4.py +++ b/iop4lib/iop4.py @@ -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):