Skip to content

Commit 9c1b472

Browse files
committed
use rattler
1 parent 46db32a commit 9c1b472

File tree

3 files changed

+78
-68
lines changed

3 files changed

+78
-68
lines changed

.github/workflows/benchmark.yml

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
11
name: Benchmark
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
88

99
env:
10-
FORCE_COLOR: "1"
10+
FORCE_COLOR: "1"
1111

1212
defaults:
13-
run:
14-
shell: bash -e {0} # -e to fail on error
13+
run:
14+
shell: bash -e {0} # -e to fail on error
1515

1616
jobs:
17-
benchmark:
18-
runs-on: ${{ matrix.os }}
19-
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
python: ["3.12"]
24-
os: [ubuntu-latest]
25-
26-
env:
27-
OS: ${{ matrix.os }}
28-
PYTHON: ${{ matrix.python }}
29-
ASV_DIR: "./benchmarks"
30-
31-
steps:
32-
- uses: actions/checkout@v4
33-
with:
34-
fetch-depth: 0
35-
36-
- name: Fetch main branch for `asv run`’s hash
37-
run: git fetch origin main:main
38-
if: ${{ github.ref_name != 'main' }}
39-
40-
- name: Set up Python ${{ matrix.python }}
41-
uses: actions/setup-python@v5
42-
with:
43-
python-version: ${{ matrix.python }}
44-
cache: "pip"
45-
46-
- name: Cache datasets
47-
uses: actions/cache@v4
48-
with:
49-
path: |
50-
~/.cache
51-
key: benchmark-state-${{ hashFiles('benchmarks/**') }}
52-
53-
- name: Install dependencies
54-
run: pip install 'asv>=0.6.4'
55-
56-
- name: Configure ASV
57-
working-directory: ${{ env.ASV_DIR }}
58-
run: asv machine --yes
59-
60-
- name: Quick benchmark run
61-
working-directory: ${{ env.ASV_DIR }}
62-
run: asv run --dry-run --quick --show-stderr --verbose HEAD^!
17+
benchmark:
18+
runs-on: ${{ matrix.os }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
python: ["3.12"]
24+
os: [ubuntu-latest]
25+
26+
env:
27+
OS: ${{ matrix.os }}
28+
PYTHON: ${{ matrix.python }}
29+
ASV_DIR: "${{ github.workspace }}/benchmarks"
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Fetch main branch for `asv run`’s hash
37+
run: git fetch origin main:main
38+
if: ${{ github.ref_name != 'main' }}
39+
40+
- name: Set up Python ${{ matrix.python }}
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ matrix.python }}
44+
cache: "pip"
45+
46+
- name: Cache datasets
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
~/.cache
51+
key: benchmark-state-${{ hashFiles('benchmarks/**') }}
52+
53+
- name: Install dependencies
54+
# https://github.com/airspeed-velocity/asv/issues/1493
55+
run: pip install 'asv@git+https://github.com/airspeed-velocity/asv.git' py-rattler
56+
57+
- name: Configure ASV
58+
working-directory: ${{ env.ASV_DIR }}
59+
run: asv machine --yes
60+
61+
- name: Quick benchmark run
62+
working-directory: ${{ env.ASV_DIR }}
63+
run: asv run --dry-run --quick --show-stderr --verbose HEAD^!

.prettierrc.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
overrides:
2+
# JSON with comments and trailing commas
3+
- files:
4+
- ".vscode/*.json"
5+
- "benchmarks/*.json"
6+
options:
7+
parser: json5
8+
quoteProps: preserve
9+
singleQuote: false

benchmarks/asv.conf.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
2626
"build_command": [
2727
"python -m pip install build",
28-
"python -m build --wheel -o {build_cache_dir} {build_dir}"
28+
"python -m build --wheel -o {build_cache_dir} {build_dir}",
2929
],
3030

3131
// List of branches to benchmark. If not provided, defaults to "master"
@@ -43,7 +43,7 @@
4343
// If missing or the empty string, the tool will be automatically
4444
// determined by looking for tools on the PATH environment
4545
// variable.
46-
"environment_type": "virtualenv",
46+
"environment_type": "rattler",
4747

4848
// timeout in seconds for installing any dependencies in environment
4949
// defaults to 10 min
@@ -60,19 +60,19 @@
6060
// dependency packages in the specified order
6161
"conda_channels": ["conda-forge", "defaults"],
6262

63-
// The matrix of dependencies to test. Each key is the name of a
64-
// package (in PyPI) and the values are version numbers. An empty
65-
// list or empty string indicates to just test against the default
66-
// (latest) version. null indicates that the package is to not be
67-
// installed. If the package to be tested is only available from
68-
// PyPi, and the 'environment_type' is conda, then you can preface
69-
// the package name by 'pip+', and the package will be installed via
70-
// pip (with all the conda available packages installed first,
71-
// followed by the pip installed packages).
72-
//
7363
"matrix": {
74-
"numpy": [""],
75-
"scipy": [""]
64+
// The matrix of dependencies to test. Each key is the name of a
65+
// package (in PyPI) and the values are version numbers. An empty
66+
// list or empty string indicates to just test against the default
67+
// (latest) version. null indicates that the package is to not be
68+
// installed. If the package to be tested is only available from
69+
// PyPi, and the 'environment_type' is conda, then you can preface
70+
// the package name by 'pip+', and the package will be installed via
71+
// pip (with all the conda available packages installed first,
72+
// followed by the pip installed packages).
73+
"req": {},
74+
// same for env variables
75+
"env": {},
7676
},
7777

7878
// Combinations of libraries/python versions can be excluded/included
@@ -122,7 +122,7 @@
122122

123123
// The directory (relative to the current directory) that the html tree
124124
// should be written to. If not provided, defaults to "html".
125-
"html_dir": ".asv/html"
125+
"html_dir": ".asv/html",
126126

127127
// The number of characters to retain in the commit hashes.
128128
// "hash_length": 8,

0 commit comments

Comments
 (0)