Skip to content

Commit

Permalink
CI: small build fixes (#1252)
Browse files Browse the repository at this point in the history
* add pyproject.toml and fix benchmark
* fix rust tests, and use ipfs_setup from original repo
* asv config fixes, update niffler, avoid mpl warnings on tests
* match setup_requires with pyproject.toml deps
* keep asv working without resorting to build
  • Loading branch information
luizirber committed Dec 9, 2020
1 parent 9f1e066 commit 12c7da8
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/asv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ jobs:

steps:
- uses: actions/checkout@v1

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install asv virtualenv==16.7.9
- name: Runs benchmarks against latest
run: |
asv machine --yes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Set up IPFS
if: startsWith(runner.os, 'Linux') && (matrix.py == '3.9')
uses: luizirber/setup-ipfs@fix_add_path
uses: ibnesayeed/setup-ipfs@master
with:
ipfs_version: 0.6
run_daemon: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
- name: Install wasmtime
run: "curl https://wasmtime.dev/install.sh -sSf | bash"
- name: Add wasmtime to PATH
run: echo "::add-path::$HOME/.wasmtime/bin"
run: echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
- name: Install cargo-wasi command
uses: actions-rs/cargo@v1
with:
Expand Down
9 changes: 7 additions & 2 deletions asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
"project": "sourmash",
"project_url": "https://github.com/dib-lab/sourmash",
"repo": ".",
"branches": ["latest"], // for git
"branches": ["latest"],
"dvcs": "git",
"environment_type": "virtualenv",
"pythons": ["3.7"],
"env_dir": ".asv/env",
"results_dir": ".asv/results",
"html_dir": ".asv/html",
"build_cache_size": 8
"build_cache_size": 8,
"build_command": [
"python -m pip install 'setuptools_scm[toml]<5' milksnake",
"python setup.py build",
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
]
}
4 changes: 2 additions & 2 deletions benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def time_add_many(self):
mh = self.mh
mh.add_many(list(range(1000)))

def time_compare(self):
def time_similarity(self):
mh = self.mh
other_mh = self.populated_mh
for i in range(500):
mh.compare(other_mh)
mh.similarity(other_mh)

def time_count_common(self):
mh = self.mh
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = [
"setuptools >= 48",
"setuptools_scm[toml] >= 4, <5",
"setuptools_scm_git_archive",
"milksnake",
"wheel >= 0.29.0",
]
build-backend = 'setuptools.build_meta'
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def build_native(spec):
'matplotlib', 'scipy', 'deprecation>=2.0.6',
'cachetools >=4,<5'],
"setup_requires": [
"setuptools>=38.6.0",
"setuptools>=48",
"milksnake",
"setuptools_scm>=3.2.0",
"setuptools_scm[toml] >= 4, <5",
"setuptools_scm_git_archive",
"wheel >= 0.29.0",
],
"use_scm_version": {
"write_to": "sourmash/version.py",
Expand Down
2 changes: 1 addition & 1 deletion src/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ getset = "0.1.1"
log = "0.4.8"
md5 = "0.7.0"
murmurhash3 = "0.0.5"
niffler = { version = "2.2.0", default-features = false, features = [ "gz" ] }
niffler = { version = "2.3.1", default-features = false, features = [ "gz" ] }
nohash-hasher = "0.2.0"
num-iter = "0.1.41"
once_cell = "1.3.1"
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from hypothesis import settings, Verbosity
import pytest

import matplotlib.pyplot as plt
plt.rcParams.update({'figure.max_open_warning': 0})


@pytest.fixture(params=[True, False])
def track_abundance(request):
Expand Down

0 comments on commit 12c7da8

Please sign in to comment.