Skip to content

Commit

Permalink
Merge pull request #436 from cuviper/release-0.4.3
Browse files Browse the repository at this point in the history
Release 0.4.3
  • Loading branch information
cuviper committed May 8, 2024
2 parents e9c5ac8 + 43bfc6b commit 1fec852
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 63 deletions.
25 changes: 4 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ jobs:
strategy:
matrix:
rust: [
1.31.0, # 2018!
1.36.0, # alloc, rand
1.60.0, # MSRV
stable,
beta,
nightly
Expand All @@ -29,8 +28,8 @@ jobs:
- run: ./ci/test_full.sh

# try a target that doesn't have std at all, but does have alloc
no_std_stable:
name: No Std (stable)
no_std:
name: No Std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -39,22 +38,6 @@ jobs:
target: thumbv6m-none-eabi
- run: cargo build --target thumbv6m-none-eabi --no-default-features --features "alloc libm serde rand"

# try a target that doesn't have std at all, nor alloc
no_std_131:
name: No Std (1.31.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cargo/registry/index
key: cargo-1.31.0-git-index
- uses: dtolnay/rust-toolchain@1.31.0
with:
target: thumbv6m-none-eabi
- run: cargo generate-lockfile && cargo update -p libm --precise 0.2.5
- run: cargo build --target thumbv6m-none-eabi --no-default-features --features "libm"

fmt:
name: Format
runs-on: ubuntu-latest
Expand All @@ -70,7 +53,7 @@ jobs:
success:
name: Success
runs-on: ubuntu-latest
needs: [test, no_std_131, no_std_stable, fmt]
needs: [test, no_std, fmt]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.31.0, stable]
rust: [1.60.0, stable]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.31.0, stable]
rust: [1.60.0, stable]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand Down
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,24 @@ categories = [ "algorithms", "data-structures", "science", "no-std" ]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num"
version = "0.4.2"
version = "0.4.3"
readme = "README.md"
exclude = ["/ci/*", "/.github/*"]
edition = "2018"
edition = "2021"
rust-version = "1.60"

[package.metadata.docs.rs]
features = ["std", "serde", "rand"]

[badges]
travis-ci = { repository = "rust-num/num" }

[dependencies]

[dependencies.num-bigint]
optional = true # needs std until Rust 1.36
version = "0.4.4"
optional = true
version = "0.4.5"
default-features = false

[dependencies.num-complex]
version = "0.4.5"
version = "0.4.6"
default-features = false

[dependencies.num-integer]
Expand All @@ -36,16 +34,16 @@ default-features = false
features = ["i128"]

[dependencies.num-iter]
version = "0.1.44"
version = "0.1.45"
default-features = false
features = ["i128"]

[dependencies.num-rational]
version = "0.4.1"
version = "0.4.2"
default-features = false

[dependencies.num-traits]
version = "0.2.18"
version = "0.2.19"
default-features = false
features = ["i128"]

Expand All @@ -54,16 +52,18 @@ features = ["i128"]
[features]
default = ["std"]

num-bigint = ["dep:num-bigint"]

std = [
"num-bigint/std",
"dep:num-bigint", "num-bigint/std",
"num-complex/std",
"num-integer/std",
"num-iter/std",
"num-rational/std", "num-rational/num-bigint-std",
"num-traits/std",
]

alloc = ["num-bigint", "num-rational/num-bigint"]
alloc = ["dep:num-bigint", "num-rational/num-bigint"]

libm = [
"num-complex/libm",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![crate](https://img.shields.io/crates/v/num.svg)](https://crates.io/crates/num)
[![documentation](https://docs.rs/num/badge.svg)](https://docs.rs/num)
[![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![minimum rustc 1.60](https://img.shields.io/badge/rustc-1.60+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![build status](https://github.com/rust-num/num/workflows/master/badge.svg)](https://github.com/rust-num/num/actions)

A collection of numeric types and traits for Rust.
Expand Down Expand Up @@ -69,7 +69,7 @@ Release notes are available in [RELEASES.md](RELEASES.md).

## Compatibility

The `num` crate as a whole is tested for rustc 1.31 and greater.
The `num` crate as a whole is tested for rustc 1.60 and greater.

The `num-traits`, `num-integer`, and `num-iter` crates are individually tested
for rustc 1.8 and greater, if you require such older compatibility.
Expand Down
5 changes: 5 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Release 0.4.3 (2024-05-08)

- Upgrade to 2021 edition, **MSRV 1.60**.
- Updated all sub-crates to their latest versions.

# Release 0.4.2 (2024-04-12)

- Updated all sub-crates to their latest versions.
Expand Down
2 changes: 1 addition & 1 deletion ci/rustup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
set -ex

ci=$(dirname $0)
for version in 1.31.0 1.36.0 stable beta nightly; do
for version in 1.60.0 stable beta nightly; do
rustup run "$version" "$ci/test_full.sh"
done
38 changes: 15 additions & 23 deletions ci/test_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

CRATE=num
MSRV=1.31
MSRV=1.60

get_rust_version() {
local array=($(rustc --version));
Expand All @@ -27,21 +27,15 @@ if ! check_version $MSRV ; then
exit 1
fi

STD_FEATURES=(libm serde)
STD_FEATURES=(libm serde rand)
ALLOC_FEATURES=(libm serde rand)
NO_STD_FEATURES=(libm)
check_version 1.36 && STD_FEATURES+=(rand)
check_version 1.36 && ALLOC_FEATURES=(libm serde rand)
echo "Testing supported features: ${STD_FEATURES[*]}"
echo " alloc supported features: ${ALLOC_FEATURES[*]}"
echo " no_std supported features: ${NO_STD_FEATURES[*]}"
if [ -n "${ALLOC_FEATURES[*]}" ]; then
echo " alloc supported features: ${ALLOC_FEATURES[*]}"
fi

cargo generate-lockfile

# libm 0.2.6 started using {float}::EPSILON
check_version 1.43 || cargo update -p libm --precise 0.2.5

set -x

# test the default with std
Expand Down Expand Up @@ -74,18 +68,16 @@ cargo build --no-default-features --features="${NO_STD_FEATURES[*]}"
cargo test --no-default-features --features="${NO_STD_FEATURES[*]}"


if [ -n "${ALLOC_FEATURES[*]}" ]; then
# test minimal with alloc
cargo build --no-default-features --features="alloc"
cargo test --no-default-features --features="alloc"
# test minimal with alloc
cargo build --no-default-features --features="alloc"
cargo test --no-default-features --features="alloc"

# test each isolated feature with alloc
for feature in ${ALLOC_FEATURES[*]}; do
cargo build --no-default-features --features="alloc $feature"
cargo test --no-default-features --features="alloc $feature"
done
# test each isolated feature with alloc
for feature in ${ALLOC_FEATURES[*]}; do
cargo build --no-default-features --features="alloc $feature"
cargo test --no-default-features --features="alloc $feature"
done

# test all supported features with alloc
cargo build --no-default-features --features="alloc ${ALLOC_FEATURES[*]}"
cargo test --no-default-features --features="alloc ${ALLOC_FEATURES[*]}"
fi
# test all supported features with alloc
cargo build --no-default-features --features="alloc ${ALLOC_FEATURES[*]}"
cargo test --no-default-features --features="alloc ${ALLOC_FEATURES[*]}"
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//!
//! ## Compatibility
//!
//! The `num` crate is tested for rustc 1.31 and greater.
//! The `num` crate is tested for rustc 1.60 and greater.

#![doc(html_root_url = "https://docs.rs/num/0.4")]
#![no_std]
Expand Down

0 comments on commit 1fec852

Please sign in to comment.