Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
d-chambers committed Dec 24, 2024
2 parents 1b0ab1b + 2138fee commit eb7acdc
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy_master_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
shell: bash -l {0}
run: |
conda install -c conda-forge pandoc
python -m pip install -e .[docs]
python -m pip install -e .[docs,all]
- name: Install quarto
uses: quarto-dev/quarto-actions/setup@v2
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build_deploy_stable_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ jobs:
- name: Get tags
run: git fetch --tags origin

- uses: mamba-org/setup-micromamba@v1
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.8-0' # versions: https://github.com/mamba-org/micromamba-releases
micromamba-version: '2.0.2-1' # versions: https://github.com/mamba-org/micromamba-releases
environment-file: ./.github/doc_environment.yml
init-shell: >-
bash
powershell
cache-environment: true
post-cleanup: 'all'
cache-environment-key: environment-${{ steps.date.outputs.date }}

# Not sure why this is needed but it appears to be the case
- name: fix env
Expand All @@ -63,7 +64,7 @@ jobs:
shell: bash -l {0}
run: |
conda install -c conda-forge pandoc
python -m pip install -e .[docs]
python -m pip install -e .[docs,all]
- name: Install quarto
uses: quarto-dev/quarto-actions/setup@v2
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/run_min_dep_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
paths:
- 'pyproject.toml'
- '**.py'
- '.github/workflows/runtests.yml'
- '.github/workflows/run_min_dep_tests.yml'

env:
# used to manually trigger cache reset. Just increment if needed.
Expand All @@ -29,10 +29,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

python-version: ['3.12']
python-version: ['3.12', '3.13']

# only run if CI isn't turned off
if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci')
Expand All @@ -50,7 +48,6 @@ jobs:
run: |
git fetch --tags --force # Retrieve annotated tags.
# Have to use conda to install hdf5 so mac (I guess m1/2) runners work.
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '2.0.2-1' # versions: https://github.com/mamba-org/micromamba-releases
Expand All @@ -64,35 +61,29 @@ jobs:
create-args: >-
python=${{ matrix.python-version }}
# Not sure why this is needed but it appears to be the case
# Not sure why this is needed but it appears to be the case.
# Also installs pytables so hdf5 gets installed on windows
- name: fix env
shell: bash -l {0}
run: |
micromamba shell init --shell bash --root-prefix=~/micromamba
eval "$(micromamba shell hook --shell bash)"
micromamba activate dascore
- name: print python version
shell: bash -el {0}
run: |
python --version
- name: install hdf5
if: matrix.os=='macos-latest'
shell: bash -l {0}
run: |
micromamba install pytables
- name: install dascore
shell: bash -l {0}
run: |
python -m pip install -e .[test]
# Then switch over to uv. We can use this exclusively once we drop pytables.
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: set data cache path
shell: bash -l {0}
run: |
export PATH="$pythonLocation:$PATH"
echo "DATA_CACHE_PATH=$(python -c "import pooch; print(pooch.os_cache('dascore'))")" >> $GITHUB_ENV
echo "DATA_CACHE_PATH=$(uv run --extra test python -c "import pooch; print(pooch.os_cache('dascore'))")" >> $GITHUB_ENV
- name: cache test data
uses: actions/cache@v3
Expand All @@ -103,9 +94,9 @@ jobs:

- name: run test suite
shell: bash -l {0}
run: ./.github/test_code.sh
run: uv run --extra test --python ${{ matrix.python-version }} pytest -s --cov dascore --cov-append --cov-report=xml

# Runs examples in docstrings
- name: test docstrings
shell: bash -l {0}
run: ./.github/test_code.sh doctest
run: uv run --extra test --python ${{ matrix.python-version }} pytest dascore --doctest-modules
2 changes: 1 addition & 1 deletion .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

env:
# used to manually trigger cache reset. Just increment if needed.
CACHE_NUMBER: 2
CACHE_NUMBER: 1

# Cancel previous runs when this one starts.
concurrency:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ docs/**/*.ipynb
# misc
scratch/**
.ruff_cache
uv.lock

docs/index_files
docs/index.quarto_ipynb
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extras = [
"findiff",
"obspy",
"numba",
"segyio",
"segyio",
]

docs = [
Expand Down
4 changes: 3 additions & 1 deletion tests/test_utils/test_doc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def testfun1():
assert "Parameters" in testfun1.__doc__
line = next(x for x in testfun1.__doc__.split("\n") if "Parameters" in x)
base_spaces = line.split("Parameters")[0]
assert len(base_spaces) == 12
# py3.13+ automatically strips white space from docstrings so 12
# and 0 are valid lengths.
assert len(base_spaces) in {12, 0}

def test_list_indent(self):
"""Ensure lists are indented equally."""
Expand Down

0 comments on commit eb7acdc

Please sign in to comment.