Skip to content

Commit

Permalink
add noxfile to build wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Dec 21, 2020
1 parent cf7fa47 commit 58b21ce
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lazrs"
version = "0.2.2"
version = "0.2.3"
authors = ["tmontaigu <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
24 changes: 24 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import nox
import os
from pathlib import Path
import shutil

WHEEL_DIR = Path(os.environ.get("CARGO_TARGET_DIR", '.target')) / "wheels"


@nox.session(python=['3.6', '3.7', '3.8', '3.9'])
def build_wheel(session):
session.install('maturin')
session.run('cargo', 'clean', external=True)
session.run('maturin', 'build', '--interpreter', 'python', '--release')

wheels = list(WHEEL_DIR.glob('*.whl'))
assert len(wheels) == 1
wheel = str(wheels[0])

# quick test of the wheel
session.install(wheel)
session.run('python', '-c', 'import lazrs')

# Save the wheel as its going to be erased by the next cargo clean
shutil.copy(wheel, '.')

0 comments on commit 58b21ce

Please sign in to comment.