2021-12-09 08:17:08 +00:00
|
|
|
.PHONY: test test_py publish clippy lint fmt fmt_py fmt_rust
|
2019-08-17 12:10:35 +00:00
|
|
|
|
2021-10-24 07:02:21 +00:00
|
|
|
ALL_ADDITIVE_FEATURES = macros multiple-pymethods num-bigint num-complex hashbrown serde indexmap eyre anyhow
|
2021-12-21 22:21:42 +00:00
|
|
|
COVERAGE_PACKAGES = --package pyo3 --package pyo3-build-config --package pyo3-macros-backend --package pyo3-macros
|
2021-10-24 07:02:21 +00:00
|
|
|
|
|
|
|
list_all_additive_features:
|
|
|
|
@echo $(ALL_ADDITIVE_FEATURES)
|
|
|
|
|
2020-06-05 11:51:15 +00:00
|
|
|
test: lint test_py
|
2018-11-15 20:28:28 +00:00
|
|
|
cargo test
|
2021-10-24 07:02:21 +00:00
|
|
|
cargo test --features="abi3"
|
|
|
|
cargo test --features="$(ALL_ADDITIVE_FEATURES)"
|
|
|
|
cargo test --features="abi3 $(ALL_ADDITIVE_FEATURES)"
|
2019-02-01 15:31:18 +00:00
|
|
|
|
2020-06-05 11:51:15 +00:00
|
|
|
test_py:
|
2021-12-15 00:45:26 +00:00
|
|
|
@for example in examples/*/tox.ini; do echo "-- Running tox for $$example --"; tox -e py -c $$example || exit 1; echo ""; done
|
|
|
|
@for package in pytests/*/tox.ini; do echo "-- Running tox for $$package --"; tox -e py -c $$package || exit 1; echo ""; done
|
2018-11-02 21:32:18 +00:00
|
|
|
|
2021-12-09 08:17:08 +00:00
|
|
|
fmt_py:
|
2019-09-05 23:16:09 +00:00
|
|
|
black . --check
|
2019-08-17 12:10:35 +00:00
|
|
|
|
2021-12-09 08:17:08 +00:00
|
|
|
fmt_rust:
|
|
|
|
cargo fmt --all -- --check
|
2021-12-15 00:45:26 +00:00
|
|
|
for package in pytests/*/; do cargo fmt --manifest-path $$package/Cargo.toml -- --check || exit 1; done
|
2021-12-09 08:17:08 +00:00
|
|
|
|
|
|
|
fmt: fmt_rust fmt_py
|
|
|
|
@true
|
|
|
|
|
2021-12-21 22:21:42 +00:00
|
|
|
coverage:
|
|
|
|
# cargo llvm-cov clean --workspace
|
|
|
|
# cargo llvm-cov $(COVERAGE_PACKAGES) --no-report
|
|
|
|
# cargo llvm-cov $(COVERAGE_PACKAGES) --no-report --features abi3
|
|
|
|
# cargo llvm-cov $(COVERAGE_PACKAGES) --no-report --features $(ALL_ADDITIVE_FEATURES)
|
|
|
|
# cargo llvm-cov $(COVERAGE_PACKAGES) --no-report --features abi3 $(ALL_ADDITIVE_FEATURES)
|
|
|
|
bash -c "\
|
|
|
|
set -a\
|
|
|
|
source <(cargo llvm-cov show-env)\
|
|
|
|
export TOX_TESTENV_PASSENV=*\
|
|
|
|
make test_py\
|
|
|
|
"
|
|
|
|
cargo llvm-cov $(COVERAGE_PACKAGES) --no-run --summary-only
|
|
|
|
|
|
|
|
|
2019-08-17 12:10:35 +00:00
|
|
|
clippy:
|
2021-12-09 08:11:28 +00:00
|
|
|
cargo clippy --features="$(ALL_ADDITIVE_FEATURES)" --all-targets --workspace -- -Dwarnings
|
|
|
|
cargo clippy --features="abi3 $(ALL_ADDITIVE_FEATURES)" --all-targets --workspace -- -Dwarnings
|
2021-08-02 21:29:37 +00:00
|
|
|
for example in examples/*/; do cargo clippy --manifest-path $$example/Cargo.toml -- -Dwarnings || exit 1; done
|
2021-12-15 00:45:26 +00:00
|
|
|
for package in pytests/*/; do cargo clippy --manifest-path $$package/Cargo.toml -- -Dwarnings || exit 1; done
|
2019-08-17 12:10:35 +00:00
|
|
|
|
|
|
|
lint: fmt clippy
|
|
|
|
@true
|
|
|
|
|
2019-02-10 18:40:04 +00:00
|
|
|
publish: test
|
2021-12-15 00:45:26 +00:00
|
|
|
cargo publish --manifest-path pyo3-build-config/Cargo.toml
|
|
|
|
sleep 10
|
2020-12-13 11:29:39 +00:00
|
|
|
cargo publish --manifest-path pyo3-macros-backend/Cargo.toml
|
2020-10-12 15:18:25 +00:00
|
|
|
sleep 10 # wait for crates.io to update
|
2020-12-13 11:29:39 +00:00
|
|
|
cargo publish --manifest-path pyo3-macros/Cargo.toml
|
2020-10-12 15:18:25 +00:00
|
|
|
sleep 10 # wait for crates.io to update
|
2018-11-02 21:32:18 +00:00
|
|
|
cargo publish
|