Skip to content

Commit

Permalink
Run pytests and examples with pep489 feature on
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 30, 2022
1 parent 296d738 commit 9cd9b24
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
7 changes: 5 additions & 2 deletions examples/decorator/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@


@nox.session
def python(session):
@nox.parametrize("cargo_features", ['""', "pep489"])
def python(session, cargo_features):
session.install("-rrequirements-dev.txt")
session.install("maturin")
session.run_always("maturin", "develop")
session.run_always(
"maturin", "develop", f"--cargo-extra-args=--features {cargo_features}"
)
session.run("pytest")
7 changes: 5 additions & 2 deletions examples/maturin-starter/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@


@nox.session
def python(session):
@nox.parametrize("cargo_features", ['""', "pep489"])
def python(session, cargo_features):
session.install("-rrequirements-dev.txt")
session.install("maturin")
session.run_always("maturin", "develop")
session.run_always(
"maturin", "develop", f"--cargo-extra-args=--features {cargo_features}"
)
session.run("pytest")
7 changes: 5 additions & 2 deletions examples/word-count/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@


@nox.session
def test(session):
@nox.parametrize("cargo_features", ['""', "pep489"])
def test(session, cargo_features):
session.install("-rrequirements-dev.txt")
session.install("maturin")
session.run_always("maturin", "develop")
session.run_always(
"maturin", "develop", f"--cargo-extra-args=--features {cargo_features}"
)
session.run("pytest")


Expand Down
3 changes: 3 additions & 0 deletions pytests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pyo3-build-config = { path = "../pyo3-build-config" }
name = "pyo3_pytests"
crate-type = ["cdylib"]

[features]
pep489 = ["pyo3/pep489"]

[package.metadata.maturin]
classifier=[
"License :: OSI Approved :: MIT License",
Expand Down
7 changes: 5 additions & 2 deletions pytests/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@


@nox.session
def test(session):
@nox.parametrize("cargo_features", ['""', "pep489"])
def test(session, cargo_features):
session.install("-rrequirements-dev.txt")
session.install("maturin")
session.run_always("maturin", "develop")
session.run_always(
"maturin", "develop", f"--cargo-extra-args=--features {cargo_features}"
)
session.run("pytest")


Expand Down

0 comments on commit 9cd9b24

Please sign in to comment.