Skip to content

Commit 7bf686c

Browse files
committed
force main environment yaml for CI
1 parent 48a1a25 commit 7bf686c

File tree

3 files changed

+35
-31
lines changed

3 files changed

+35
-31
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI (conda + mamba via setup-miniconda)
1+
name: CI
22

33
on:
44
push:
@@ -9,38 +9,32 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
shell: bash -l {0} # Use login shell for all steps
15+
1216
steps:
13-
- uses: actions/checkout@v4
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
1419

15-
- name: Set up Miniconda (with conda-forge channel)
16-
uses: conda-incubator/setup-miniconda@v2
20+
- name: Set up Mambaforge
21+
uses: conda-incubator/setup-miniconda@v3
1722
with:
1823
python-version: "3.11"
19-
channels: "conda-forge,defaults"
24+
environment-file: environment.yml # Use the main environment file
25+
mamba-version: "*"
26+
activate-environment: planetquery
2027
auto-update-conda: true
21-
# do not pin mamba-version to avoid "package not found" errors
22-
23-
- name: Create CI conda env with mamba
24-
shell: bash -l {0}
25-
run: |
26-
# create an environment with mamba (conda-forge)
27-
mamba create -n ci-env -y -c conda-forge \
28-
python=3.11 ipywidgets ipyleaflet pytest ruff pip \
29-
numpy pandas xarray rioxarray rasterio geopandas shapely matplotlib
30-
source "$(conda info --base)/etc/profile.d/conda.sh"
31-
conda activate ci-env
32-
python -m pip install -e .
33-
34-
- name: Lint (ruff)
35-
shell: bash -l {0}
36-
run: |
37-
source "$(conda info --base)/etc/profile.d/conda.sh"
38-
conda activate ci-env
39-
python -m ruff check .
40-
41-
- name: Run tests (pytest)
42-
shell: bash -l {0}
43-
run: |
44-
source "$(conda info --base)/etc/profile.d/conda.sh"
45-
conda activate ci-env
46-
pytest -q
28+
channel-priority: "strict"
29+
30+
- name: Install test dependencies
31+
run: mamba install -y pytest ruff
32+
33+
- name: Install local package
34+
run: python -m pip install -e . --no-deps
35+
36+
- name: Lint with Ruff
37+
run: ruff check .
38+
39+
- name: Run tests with Pytest
40+
run: pytest

binder/postBuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# binder/postBuild
4+
# runs after the environment is built
5+
6+
# Install the src/planetquery package in editable mode
7+
pip install -e .

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ license = {text = "MIT"}
1111
line-length = 100
1212
select = ["E", "F", "I", "W", "C", "N", "Q"]
1313
extend-ignore = ["E203", "W503"]
14+
15+
[tool.setuptools.packages.find]
16+
where = ["src"]

0 commit comments

Comments
 (0)