Skip to content

Commit b8a150e

Browse files
committed
polish CI
1 parent cd008b8 commit b8a150e

3 files changed

Lines changed: 59 additions & 63 deletions

File tree

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: CI
32

43
on:
@@ -15,39 +14,61 @@ jobs:
1514
strategy:
1615
matrix:
1716
os: [ubuntu-22.04]
18-
pyv: [ '3.12', '3.13', '3.14']
19-
max-parallel: 5
17+
python-version: ['3.12', '3.13', '3.14']
18+
ctlearn-version: ['latest', 'nightly']
19+
max-parallel: 6
2020
runs-on: ${{ matrix.os }}
21+
continue-on-error: ${{ matrix.ctlearn-version == 'nightly' || matrix.python-version == '3.14' }}
2122
steps:
22-
- uses: actions/checkout@v4
23-
- name: Set up Python ${{ matrix.pyv }}
24-
run: |
25-
# Install Miniconda
26-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
27-
bash miniconda.sh -b -p $HOME/miniconda
28-
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
29-
source $HOME/miniconda/bin/activate
30-
# Install Mamba via conda (since we don't have mamba yet)
31-
$HOME/miniconda/bin/conda config --add channels conda-forge
32-
$HOME/miniconda/bin/conda install -y mamba=2.0.8
33-
mamba install -y python=${{ matrix.pyv }}
34-
- name: Add MKL_THREADING_LAYER variable
35-
run: echo "MKL_THREADING_LAYER=GNU" >> $GITHUB_ENV
36-
- name: Install dependencies with Mamba
37-
run: |
38-
source $HOME/miniconda/bin/activate
39-
mamba env update --file environment.yml --name base
40-
- name: Lint with flake8
41-
run: |
42-
source $HOME/miniconda/bin/activate
43-
mamba install flake8
44-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
45-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
46-
- name: Install with pip
47-
run: |
48-
pip install -e .
49-
- name: Test with pytest
50-
run: |
51-
source $HOME/miniconda/bin/activate
52-
mamba install pytest
53-
pytest
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Miniconda
26+
run: |
27+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
28+
bash miniconda.sh -b -p $HOME/miniconda
29+
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
30+
source $HOME/miniconda/etc/profile.d/conda.sh
31+
conda config --add channels conda-forge
32+
conda install -y mamba
33+
34+
- name: Create Python environment
35+
run: |
36+
source $HOME/miniconda/etc/profile.d/conda.sh
37+
mamba create -y -n ctlearn python==${{ matrix.python-version }} -c conda-forge
38+
mamba activate ctlearn
39+
40+
- name: Install dependencies
41+
run: |
42+
source $HOME/miniconda/etc/profile.d/conda.sh
43+
mamba activate ctlearn
44+
sudo apt-get update
45+
sudo apt-get install -y git
46+
pip install --upgrade pip
47+
pip install pylint pylint-exit anybadge eventio pytest flake8
48+
if [ "${{ matrix.ctlearn-version }}" = "nightly" ]; then
49+
pip install git+https://github.com/cta-observatory/dl1-data-handler.git
50+
else
51+
pip install dl1-data-handler
52+
fi
53+
54+
- name: Add MKL_THREADING_LAYER variable
55+
run: echo "MKL_THREADING_LAYER=GNU" >> $GITHUB_ENV
56+
57+
- name: Lint with flake8
58+
run: |
59+
source $HOME/miniconda/etc/profile.d/conda.sh
60+
mamba activate ctlearn
61+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
62+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
63+
64+
- name: Install package with pip
65+
run: |
66+
source $HOME/miniconda/etc/profile.d/conda.sh
67+
mamba activate ctlearn
68+
pip install -e .
69+
70+
- name: Run pytest
71+
run: |
72+
source $HOME/miniconda/etc/profile.d/conda.sh
73+
mamba activate ctlearn
74+
pytest

environment.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,25 @@ classifiers = [
2020
"Topic :: Scientific/Engineering :: Astronomy",
2121
"Topic :: Scientific/Engineering :: Physics",
2222
"Programming Language :: Python :: 3",
23-
"Programming Language :: Python :: 3.10",
24-
"Programming Language :: Python :: 3.11",
2523
"Programming Language :: Python :: 3.12",
2624
"Programming Language :: Python :: 3.13",
2725

2826
]
2927

3028
requires-python = ">=3.12"
3129
dependencies = [
32-
"dl1_data_handler>=0.14.5, <0.15",
30+
"dl1_data_handler>=0.14.5",
3331
"astropy",
3432
"numpy",
3533
"pandas",
3634
"pip",
3735
"pyyaml",
3836
"scikit-learn",
3937
"numba",
40-
"tensorflow>=2.19,<2.21",
38+
"tensorflow>=2.20",
4139
"pydot",
4240
"setuptools",
43-
"ctapipe>=0.28.0",
41+
"ctapipe[all]>=0.28",
4442
]
4543

4644
dynamic = ["version"]

0 commit comments

Comments
 (0)