Skip to content

Commit 095738e

Browse files
committed
Auto merge of #164 - rust-num:split-into-crates, r=cuviper
Move segments of library to separate crates Issue #102 - [x] traits - [x] bigint - [x] integer - [x] complex - [x] iter - [x] rational
2 parents 7eb666f + 58b5fe5 commit 095738e

32 files changed

+3831
-3357
lines changed

.multirust.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -ex
77
for toolchain in 1.0.0 beta nightly; do
88
run="multirust run $toolchain"
99
$run cargo build --verbose
10-
$run cargo test --verbose
10+
$run make test
1111
$run .travis/test_features.sh
1212
if [ $toolchain = nightly ]; then
1313
$run .travis/test_nightly.sh

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ rust:
66
sudo: false
77
script:
88
- cargo build --verbose
9-
- cargo test --verbose
9+
- make test
1010
- .travis/test_features.sh
1111
- |
12-
[ $TRAVIS_RUST_VERSION != nightly ] ||
13-
.travis/test_nightly.sh
12+
[ $TRAVIS_RUST_VERSION != nightly ] || .travis/test_nightly.sh
1413
- cargo doc
1514
after_success: |
1615
[ $TRAVIS_BRANCH = master ] &&

.travis/test_features.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ set -ex
44

55
for feature in '' bigint rational complex; do
66
cargo build --verbose --no-default-features --features="$feature"
7-
cargo test --verbose --no-default-features --features="$feature"
87
done
9-

.travis/test_nightly.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -ex
44

55
cargo bench --verbose
66

7-
cargo test --verbose --manifest-path=num-macros/Cargo.toml
7+
cargo test --verbose --manifest-path=macros/Cargo.toml

Cargo.toml

Lines changed: 52 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,63 @@
11
[package]
2-
3-
name = "num"
4-
version = "0.1.31"
52
authors = ["The Rust Project Developers"]
6-
license = "MIT/Apache-2.0"
7-
homepage = "https://github.com/rust-num/num"
8-
repository = "https://github.com/rust-num/num"
3+
description = "A collection of numeric types and traits for Rust, including bigint,\ncomplex, rational, range iterators, generic integers, and more!\n"
94
documentation = "http://rust-num.github.io/num"
5+
homepage = "https://github.com/rust-num/num"
106
keywords = ["mathematics", "numerics"]
11-
description = """
12-
A collection of numeric types and traits for Rust, including bigint,
13-
complex, rational, range iterators, generic integers, and more!
14-
"""
7+
license = "MIT/Apache-2.0"
8+
repository = "https://github.com/rust-num/num"
9+
name = "num"
10+
version = "0.1.31"
11+
12+
[[bench]]
13+
name = "bigint"
14+
15+
[[bench]]
16+
harness = false
17+
name = "shootout-pidigits"
1518

1619
[dependencies]
17-
rand = { version = "0.3.8", optional = true }
18-
rustc-serialize = { version = "0.3.13", optional = true }
19-
serde = { version = "^0.7.0", optional = true }
2020

21-
[dev-dependencies]
22-
# Some tests of non-rand functionality still use rand because the tests
23-
# themselves are randomized.
24-
rand = { version = "0.3.8" }
21+
[dependencies.num-bigint]
22+
optional = true
23+
path = "bigint"
2524

26-
[features]
25+
[dependencies.num-complex]
26+
optional = true
27+
path = "complex"
2728

28-
complex = []
29-
rational = []
30-
bigint = []
31-
default = ["bigint", "complex", "rand", "rational", "rustc-serialize"]
29+
[dependencies.num-integer]
30+
path = "./integer"
3231

33-
[[bench]]
34-
name = "bigint"
32+
[dependencies.num-iter]
33+
optional = false
34+
path = "iter"
3535

36-
[[bench]]
37-
name = "shootout-pidigits"
38-
harness = false
36+
[dependencies.num-rational]
37+
optional = true
38+
path = "rational"
39+
40+
[dependencies.num-traits]
41+
path = "./traits"
42+
43+
[dev-dependencies]
44+
45+
[dev-dependencies.rand]
46+
version = "0.3.8"
47+
48+
[features]
49+
bigint = ["num-bigint"]
50+
complex = ["num-complex"]
51+
rational = ["num-rational"]
52+
default = ["bigint", "complex", "rational", "rustc-serialize"]
53+
54+
serde = [
55+
"num-bigint/serde",
56+
"num-complex/serde",
57+
"num-rational/serde"
58+
]
59+
rustc-serialize = [
60+
"num-bigint/rustc-serialize",
61+
"num-complex/rustc-serialize",
62+
"num-rational/rustc-serialize"
63+
]

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CARGO_CMD ?= cargo
2+
3+
packages = bigint complex integer iter rational traits
4+
5+
test:
6+
$(MAKE) run-all TASK="test"
7+
8+
run-all: $(packages)
9+
$(CARGO_CMD) $(TASK)
10+
11+
$(packages):
12+
$(CARGO_CMD) $(TASK) --manifest-path $@/Cargo.toml
13+
14+
.PHONY: $(packages) test

bigint/Cargo.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[package]
2+
authors = ["The Rust Project Developers"]
3+
description = "Big integer implementation for Rust"
4+
documentation = "http://rust-num.github.io/num"
5+
homepage = "https://github.com/rust-num/num"
6+
keywords = ["mathematics", "numerics"]
7+
license = "MIT/Apache-2.0"
8+
name = "num-bigint"
9+
repository = "https://github.com/rust-num/num"
10+
version = "0.1.0"
11+
12+
[dependencies]
13+
14+
[dependencies.num-integer]
15+
path = "../integer"
16+
17+
[dependencies.num-traits]
18+
path = "../traits"
19+
20+
[dependencies.rand]
21+
optional = true
22+
version = "0.3.14"
23+
24+
[dependencies.rustc-serialize]
25+
optional = true
26+
version = "0.3.19"
27+
28+
[dependencies.serde]
29+
optional = true
30+
version = "0.7.0"
31+
32+
[features]
33+
default = ["rand", "rustc-serialize"]

0 commit comments

Comments
 (0)