Skip to content

Commit 4c78f8e

Browse files
committed
Merge branch 'main' into numbagg
* main: (68 commits) convert datetime: micro-optimizations (#261) compatibility with `numpy>=2.0` (#257) replace the deprecated `provision-with-micromamba` with `setup-micromamba` (#258) Fix some typing errors in asv_bench and tests (#253) [pre-commit.ci] pre-commit autoupdate (#250) typing fixes (#235) Fix test failure on i386 (#248) Delete resample_reduce (#246) Bump codecov/codecov-action from 3.1.3 to 3.1.4 (#243) Enable nanargmax, nanargmin (#171) Support nanfirst, nanlast with simple combine algo (#240) Check method only for dask reductions. (#241) Optimize broadcasting (#230) Handle min_count=0 (#238) Try and fix dtypes on 3.8,3.10 windows Preserve input dtypes now that pandas can do it. Add pytest-pretty to envs factorize early as much as possible Bump codecov/codecov-action from 3.1.1 to 3.1.3 (#239) [pre-commit.ci] pre-commit autoupdate (#229) ...
2 parents fea47a5 + 5ea713e commit 4c78f8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+22487
-2356
lines changed

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true)$
4+
ref-names: $Format:%D$

.github/workflows/benchmarks.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ jobs:
2222
fetch-depth: 0
2323

2424
- name: Set up conda environment
25-
uses: mamba-org/provision-with-micromamba@v13
25+
uses: mamba-org/setup-micromamba@v1
2626
with:
2727
environment-file: ci/environment.yml
2828
environment-name: flox-tests
29-
cache-env: true
30-
# extra-specs: |
29+
init-shell: bash
30+
cache-environment: true
31+
# create-args: |
3132
# python="${{ matrix.python-version }}"
3233

3334
# - name: Setup some dependencies

.github/workflows/ci-additional.yaml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v3
2626
with:
2727
fetch-depth: 2
28-
- uses: xarray-contrib/ci-trigger@v1.1
28+
- uses: xarray-contrib/ci-trigger@v1.2
2929
id: detect-trigger
3030
with:
3131
keyword: "[skip-ci]"
@@ -53,14 +53,15 @@ jobs:
5353
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
5454
5555
- name: Setup micromamba
56-
uses: mamba-org/provision-with-micromamba@34071ca7df4983ccd272ed0d3625818b27b70dcc
56+
uses: mamba-org/setup-micromamba@v1
5757
with:
5858
environment-file: ${{env.CONDA_ENV_FILE}}
5959
environment-name: flox-tests
60-
extra-specs: |
61-
python=${{env.PYTHON_VERSION}}
62-
cache-env: true
60+
init-shell: bash
61+
cache-environment: true
6362
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
63+
create-args: |
64+
python=${{ env.PYTHON_VERSION }}
6465
6566
- name: Install flox
6667
run: |
@@ -71,7 +72,15 @@ jobs:
7172
conda list
7273
- name: Run doctests
7374
run: |
74-
python -m pytest --doctest-modules flox --ignore flox/tests
75+
python -m pytest --doctest-modules flox --ignore flox/tests --cov=./ --cov-report=xml
76+
- name: Upload code coverage to Codecov
77+
uses: codecov/[email protected]
78+
with:
79+
file: ./coverage.xml
80+
flags: unittests
81+
env_vars: RUNNER_OS
82+
name: codecov-umbrella
83+
fail_ci_if_error: false
7584

7685
mypy:
7786
name: Mypy
@@ -94,15 +103,16 @@ jobs:
94103
run: |
95104
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
96105
- name: Setup micromamba
97-
uses: mamba-org/provision-with-micromamba@34071ca7df4983ccd272ed0d3625818b27b70dcc
106+
uses: mamba-org/setup-micromamba@v1
98107
with:
99108
environment-file: ${{env.CONDA_ENV_FILE}}
100-
environment-name: xarray-tests
101-
extra-specs: |
102-
python=${{env.PYTHON_VERSION}}
103-
cache-env: true
109+
environment-name: flox-tests
110+
init-shell: bash
111+
cache-environment: true
104112
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
105-
- name: Install xarray
113+
create-args: |
114+
python=${{ env.PYTHON_VERSION }}
115+
- name: Install flox
106116
run: |
107117
python -m pip install --no-deps -e .
108118
- name: Version info
@@ -115,4 +125,13 @@ jobs:
115125
116126
- name: Run mypy
117127
run: |
118-
python -m mypy --install-types --non-interactive
128+
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
129+
130+
- name: Upload mypy coverage to Codecov
131+
uses: codecov/[email protected]
132+
with:
133+
file: mypy_report/cobertura.xml
134+
flags: mypy
135+
env_vars: PYTHON_VERSION
136+
name: codecov-umbrella
137+
fail_ci_if_error: false

.github/workflows/ci.yaml

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
os: ["ubuntu-latest"]
27+
os: ["ubuntu-latest", "windows-latest"]
2828
python-version: ["3.8", "3.10"]
2929
steps:
3030
- uses: actions/checkout@v3
@@ -34,22 +34,22 @@ jobs:
3434
run: |
3535
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
3636
- name: Set up conda environment
37-
uses: mamba-org/provision-with-micromamba@v13
37+
uses: mamba-org/setup-micromamba@v1
3838
with:
3939
environment-file: ci/environment.yml
4040
environment-name: flox-tests
41-
cache-env: true
42-
extra-specs: |
43-
python="${{ matrix.python-version }}"
41+
init-shell: bash
42+
cache-environment: true
43+
create-args: |
44+
python=${{ matrix.python-version }}
4445
- name: Install flox
4546
run: |
46-
python -m pip install -e .
47-
conda list
47+
python -m pip install --no-deps -e .
4848
- name: Run Tests
4949
run: |
5050
pytest -n auto --cov=./ --cov-report=xml
5151
- name: Upload code coverage to Codecov
52-
uses: codecov/[email protected].1
52+
uses: codecov/[email protected].4
5353
with:
5454
file: ./coverage.xml
5555
flags: unittests
@@ -78,38 +78,28 @@ jobs:
7878
with:
7979
fetch-depth: 0 # Fetch all history for all branches and tags.
8080
- name: Set up conda environment
81-
uses: mamba-org/provision-with-micromamba@v13
81+
uses: mamba-org/setup-micromamba@v1
8282
with:
83-
environment-file: ci/${{ matrix.env }}.yml
83+
environment-file: ci/environment.yml
8484
environment-name: flox-tests
85-
cache-env: true
86-
extra-specs: |
87-
python="${{ matrix.python-version }}"
85+
init-shell: bash
86+
cache-environment: true
87+
create-args: |
88+
python=${{ matrix.python-version }}
8889
- name: Install flox
8990
run: |
9091
python -m pip install --no-deps -e .
9192
- name: Run tests
9293
run: |
93-
python -m pytest -n auto
94-
95-
upstream-dev:
96-
name: upstream-dev
97-
runs-on: ubuntu-latest
98-
defaults:
99-
run:
100-
shell: bash -l {0}
101-
steps:
102-
- uses: actions/checkout@v3
103-
- name: Set up conda environment
104-
uses: mamba-org/provision-with-micromamba@v13
94+
python -m pytest -n auto --cov=./ --cov-report=xml
95+
- name: Upload code coverage to Codecov
96+
uses: codecov/[email protected]
10597
with:
106-
environment-file: ci/upstream-dev-env.yml
107-
environment-name: flox-tests
108-
extra-specs: |
109-
python="3.10"
110-
- name: Run Tests
111-
run: |
112-
pytest -n 2
98+
file: ./coverage.xml
99+
flags: unittests
100+
env_vars: RUNNER_OS
101+
name: codecov-umbrella
102+
fail_ci_if_error: false
113103

114104
xarray-groupby:
115105
name: xarray-groupby
@@ -123,13 +113,14 @@ jobs:
123113
repository: 'pydata/xarray'
124114
fetch-depth: 0 # Fetch all history for all branches and tags.
125115
- name: Set up conda environment
126-
uses: mamba-org/provision-with-micromamba@v13
116+
uses: mamba-org/setup-micromamba@v1
127117
with:
128118
environment-file: ci/requirements/environment.yml
129119
environment-name: xarray-tests
130-
cache-env: true
131-
extra-specs: |
132-
python="3.10"
120+
init-shell: bash
121+
cache-environment: true
122+
create-args: |
123+
python=3.10
133124
- name: Install xarray
134125
run: |
135126
python -m pip install --no-deps .
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build and Upload to TestPyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
types: [opened, reopened, synchronize, labeled]
9+
branches:
10+
- "*"
11+
workflow_dispatch:
12+
13+
# no need for concurrency limits
14+
15+
jobs:
16+
build-artifacts:
17+
if: ${{ contains( github.event.pull_request.labels.*.name, 'test-build') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- uses: actions/setup-python@v4
25+
name: Install Python
26+
with:
27+
python-version: "3.10"
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install build twine
33+
python -m pip install tomli tomli_w
34+
35+
# - name: Disable local versions
36+
# run: |
37+
# python .github/workflows/configure-testpypi-version.py pyproject.toml
38+
# git update-index --assume-unchanged pyproject.toml
39+
# cat pyproject.toml
40+
41+
- name: Build tarball and wheels
42+
run: |
43+
git clean -xdf
44+
python -m build
45+
46+
- name: Check built artifacts
47+
run: |
48+
python -m twine check --strict dist/*
49+
if [ -f dist/flox-999.tar.gz ]; then
50+
echo "❌ INVALID VERSION NUMBER"
51+
exit 1
52+
else
53+
echo "✅ Looks good"
54+
fi
55+
56+
- uses: actions/upload-artifact@v3
57+
with:
58+
name: releases
59+
path: dist
60+
61+
test-built-dist:
62+
needs: build-artifacts
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/setup-python@v4
66+
name: Install Python
67+
with:
68+
python-version: "3.10"
69+
- uses: actions/download-artifact@v3
70+
with:
71+
name: releases
72+
path: dist
73+
- name: List contents of built dist
74+
run: |
75+
ls -ltrh
76+
ls -ltrh dist
77+
78+
- name: Verify the built dist/wheel is valid
79+
run: |
80+
python -m pip install --upgrade pip
81+
python -m pip install dist/flox*.whl
82+
# python -m cf_xarray.scripts.print_versions
83+
84+
# - name: Publish package to TestPyPI
85+
# uses: pypa/[email protected]
86+
# with:
87+
# password: ${{ secrets.TESTPYPI_TOKEN }}
88+
# repository_url: https://test.pypi.org/legacy/
89+
# verbose: true
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI Upstream
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, reopened, synchronize, labeled]
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "0 0 * * *" # Daily “At 00:00” UTC
12+
workflow_dispatch: # allows you to trigger the workflow run manually
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
upstream-dev:
20+
name: upstream-dev
21+
runs-on: ubuntu-latest
22+
if: ${{ (contains(github.event.pull_request.labels.*.name, 'test-upstream') && github.event_name == 'pull_request') || github.event_name == 'workflow_dispatch' }}
23+
defaults:
24+
run:
25+
shell: bash -l {0}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
python-version: ["3.10"]
30+
steps:
31+
- uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 0 # Fetch all history for all branches and tags.
34+
- name: Set environment variables
35+
run: |
36+
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
37+
- name: Set up conda environment
38+
uses: mamba-org/setup-micromamba@v1
39+
with:
40+
environment-file: ci/upstream-dev-env.yml
41+
environment-name: flox-tests
42+
init-shell: bash
43+
cache-environment: true
44+
create-args: >-
45+
python=${{ matrix.python-version }}
46+
pytest-reportlog
47+
- name: Install flox
48+
run: |
49+
python -m pip install --no-deps -e .
50+
- name: Run Tests
51+
if: success()
52+
id: status
53+
run: |
54+
pytest -rf -n auto --cov=./ --cov-report=xml \
55+
--report-log output-${{ matrix.python-version }}-log.jsonl
56+
- name: Generate and publish the report
57+
if: |
58+
failure()
59+
&& steps.status.outcome == 'failure'
60+
&& github.event_name == 'schedule'
61+
&& github.repository_owner == 'xarray-contrib'
62+
uses: xarray-contrib/issue-from-pytest-log@v1
63+
with:
64+
log-path: output-${{ matrix.python-version }}-log.jsonl

0 commit comments

Comments
 (0)