diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index c2c8c558..b1b31050 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -15,39 +15,66 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - pyv: [ '3.10','3.11', '3.12', '3.13'] - max-parallel: 5 + python-version: ['3.12', '3.13', '3.14'] + ctapipe-version: ['latest', 'nightly'] + max-parallel: 6 runs-on: ${{ matrix.os }} + # Allow failures for nightly ctapipe or 3.14 builds + continue-on-error: ${{ matrix.ctapipe-version == 'nightly' || matrix.python-version == '3.14' }} steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.pyv }} - run: | - # Install Miniconda - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - echo "$HOME/miniconda/bin" >> $GITHUB_PATH - source $HOME/miniconda/bin/activate - # Install Mamba via conda (since we don't have mamba yet) - $HOME/miniconda/bin/conda config --add channels conda-forge - $HOME/miniconda/bin/conda install -y mamba=2.0.8 - mamba install -y python=${{ matrix.pyv }} - - name: Add MKL_THREADING_LAYER variable - run: echo "MKL_THREADING_LAYER=GNU" >> $GITHUB_ENV - - name: Install dependencies with Mamba - run: | - source $HOME/miniconda/bin/activate - mamba env update --file environment.yml --name base - - name: Lint with flake8 - run: | - source $HOME/miniconda/bin/activate - mamba install flake8 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Install with pip - run: | - pip install -e . - - name: Test with pytest - run: | - source $HOME/miniconda/bin/activate - mamba install pytest - pytest + - uses: actions/checkout@v4 + + - name: Set up Miniconda + run: | + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh + bash miniconda.sh -b -p $HOME/miniconda + echo "$HOME/miniconda/bin" >> $GITHUB_PATH + source $HOME/miniconda/etc/profile.d/conda.sh + conda activate base + conda config --add channels conda-forge + conda install -y mamba + + - name: Create environment for Python ${{ matrix.python-version }} + run: | + source $HOME/miniconda/etc/profile.d/conda.sh + conda activate base + mamba create -y -n dl1dh -c conda-forge python==${{ matrix.python-version }} + conda activate dl1dh + + - name: Pre-script setup + run: | + source $HOME/miniconda/etc/profile.d/conda.sh + conda activate dl1dh + sudo apt-get update + sudo apt-get install -y git + pip install --upgrade pip + pip install pylint pylint-exit anybadge + pip install eventio + if [ "${{ matrix.ctapipe-version }}" = "nightly" ]; then + pip install git+https://github.com/cta-observatory/ctapipe.git + else + pip install ctapipe + fi + pip install pytest flake8 + + - name: Add MKL_THREADING_LAYER variable + run: echo "MKL_THREADING_LAYER=GNU" >> $GITHUB_ENV + + - name: Lint with flake8 + run: | + source $HOME/miniconda/etc/profile.d/conda.sh + conda activate dl1dh + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Install package with pip + run: | + source $HOME/miniconda/etc/profile.d/conda.sh + conda activate dl1dh + pip install -e . + + - name: Run pytest + run: | + source $HOME/miniconda/etc/profile.d/conda.sh + conda activate dl1dh + pytest diff --git a/README.rst b/README.rst index fc3c1b35..2802e3da 100644 --- a/README.rst +++ b/README.rst @@ -31,11 +31,18 @@ Previously named image-extractor (v0.1.0 - v0.6.0). Currently under development, Installation ------------ +First, create and activate a fresh conda environment: + +.. code-block:: bash + + mamba create -n dl1dh -c conda-forge python==3.12 ctapipe + mamba activate dl1dh + The lastest version fo this package can be installed as a conda or pip package: .. code-block:: bash - conda install ctlearn-project::dl1_data_handler + mamba install ctlearn-project::dl1_data_handler or diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 56066a58..00000000 --- a/environment.yml +++ /dev/null @@ -1,18 +0,0 @@ -# conda env create -f environment.yml -name: dl1dh -channels: - - anaconda - - conda-forge -dependencies: - - python>=3.10 - - astropy - - setuptools - - numpy - - scipy - - pip - - ctapipe >=0.23,<0.26 - - traitlets - - pyyaml - - pandas - - pip: - - pydot diff --git a/pyproject.toml b/pyproject.toml index a3b8c7e2..38a4b608 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,16 +20,16 @@ classifiers = [ "Topic :: Scientific/Engineering :: Astronomy", "Topic :: Scientific/Engineering :: Physics", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.10" +requires-python = ">=3.12" dependencies = [ - "ctapipe>=0.22, <0.26", + "ctapipe>=0.28", "astropy", + "eventio", "numpy", "pandas", "pip",