Skip to content

Commit

Permalink
Merge pull request #627 from threeML/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ndilalla committed Nov 4, 2023
2 parents 8bce981 + 3f0ad86 commit d687acb
Show file tree
Hide file tree
Showing 50 changed files with 2,887 additions and 977 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,18 @@ jobs:
run: |
python -m pip install --upgrade pip wheel
pip install --upgrade astromodels
if [[ "${ISDEV}" == "true" ]]; then
pip install --upgrade --pre --no-deps astromodels
fi
pip install --upgrade flake8 coverage pytest-cov cython
# temp fix for speclite
pip install git+https://github.com/desihub/speclite.git
pip install -e .
env:
ISDEV: ${{contains(github.ref, 'dev') || contains(github.base_ref, 'dev')}}
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down Expand Up @@ -141,21 +147,21 @@ jobs:
with:
xcode-version: latest
if: runner.os == 'macOS'
- name: Cache conda
uses: actions/cache@v2
env:
#- name: Cache conda
# uses: actions/cache@v2
# env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('ci/environment.yml') }}

# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('ci/environment.yml') }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
miniforge-variant: Mambaforge
#miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test_env
python-version: ${{ matrix.python-version }}
channels: conda-forge, xspecmodels, threeml, fermi, defaults
Expand All @@ -178,8 +184,9 @@ jobs:
mamba install -c conda-forge -c threeml/label/dev "threeml/label/dev::astromodels"
fi
pip install fermipy
env:
ISDEV: ${{contains(github.ref, 'dev')}}
ISDEV: ${{contains(github.ref, 'dev') || contains(github.base_ref, 'dev')}}
- name: Conda list
shell: bash -l {0}
run: |
Expand Down
36 changes: 20 additions & 16 deletions .github/workflows/conda_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@ jobs:
echo "PKG_VERSION=$PKG_VERSION" >> $GITHUB_ENV
echo "HOME= ${HOME}"
echo "Conda installation path ${CONDA}"
echo "Building ${PKG_VERSION} ..."
echo "Python version: ${{matrix.python-version}}"
echo "Running on development branch: ${ISDEV} "
if [[ "${ISDEV}" == "true" ]]; then
mamba install -c conda-forge -c threeml/label/dev "threeml/label/dev::astromodels"
fi
pip install fermipy
env:
ISDEV: ${{contains(github.ref, 'dev')}}
ISDEV: ${{contains(github.ref, 'dev') || contains(github.base_ref, 'dev')}}
- name: Conda list
shell: bash -l {0}
run: |
Expand All @@ -82,13 +84,14 @@ jobs:
conda mambabuild --python=${{matrix.python-version}} conda-dist/recipes/threeml
conda install --use-local -c conda-forge threeml
#conda install --use-local -c conda-forge threeml
conda install -c ${CONDA}/envs/test_env/conda-bld/ threeml
- name: Test conda build
shell: bash -l {0}
run: |
wget https://raw.githubusercontent.com/fermi-lat/pyBurstAnalysisGUI/master/python/GtBurst/updater.py -O $CONDA_PREFIX/lib/python${{ matrix.python-version }}/site-packages/fermitools/GtBurst/updater.py
python $CONDA_PREFIX/lib/python${{ matrix.python-version }}/site-packages/fermitools/GtBurst/updater.py
#wget https://raw.githubusercontent.com/fermi-lat/pyBurstAnalysisGUI/master/python/GtBurst/updater.py -O $CONDA_PREFIX/lib/python${{ matrix.python-version }}/site-packages/fermitools/GtBurst/updater.py
#python $CONDA_PREFIX/lib/python${{ matrix.python-version }}/site-packages/fermitools/GtBurst/updater.py
python -m pytest -vv --cov=threeML --cov-report=xml
env:
Expand All @@ -112,15 +115,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('ci/environment.yml') }}
#- name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
#- name: Cache conda
# uses: actions/cache@v2
# with:
# path: ~/conda_pkgs_dir
# key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('ci/environment.yml') }}
- name: Add conda ${{ matrix.python-version }} to system path
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -143,6 +146,7 @@ jobs:
echo "PKG_VERSION=$PKG_VERSION" >> $GITHUB_ENV
echo "HOME= ${HOME}"
echo "Conda installation path ${CONDA}"
echo "Building ${PKG_VERSION} ..."
echo "Python version: ${{matrix.python-version}}"
Expand Down Expand Up @@ -173,11 +177,11 @@ jobs:
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then
anaconda -v --show-traceback -t $UPLOAD_TOKEN upload -u threeml /usr/share/miniconda/conda-bld/linux-64/*.tar.bz2 --force $LABEL
anaconda -v --show-traceback -t $UPLOAD_TOKEN upload -u threeml ${CONDA}/envs/test_env/conda-bld/linux-64/*.tar.bz2 --force $LABEL
else
anaconda -v --show-traceback -t $UPLOAD_TOKEN upload -u threeml /usr/local/miniconda/conda-bld/osx-64/*.tar.bz2 --force $LABEL
anaconda -v --show-traceback -t $UPLOAD_TOKEN upload -u threeml ${CONDA}/envs/test_env/conda-bld/osx-64/*.tar.bz2 --force $LABEL
fi
Expand Down

0 comments on commit d687acb

Please sign in to comment.