Skip to content

Commit c9b89df

Browse files
authored
Update edition and get the tests to pass (#730)
* first round * second * third * fourth * removed mismatched dependency * main fn and complete * long tail * reintroduce complex dependencies * only rand remains * where do the rlibs come from? * ignore failing * more ignores * config * links * link * more links * exlcude cc0 * ignore lychee cache * update syntax * final fix * one fifty five * links * edition * edition update
1 parent 328be60 commit c9b89df

File tree

109 files changed

+813
-812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+813
-812
lines changed

.github/workflows/check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fail: false
2525
checkbox: false
2626
output: ./lychee/out.md
27-
args: "--mode task --base . --config ./ci/lychee.toml ."
27+
args: "--base . --config ./ci/lychee.toml ."
2828

2929
- name: Save lychee cache
3030
uses: actions/cache/save@v4

.github/workflows/mdbook-test.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,19 @@ jobs:
1717
uses: actions-rust-lang/setup-rust-toolchain@v1
1818
with:
1919
cache: 'true'
20-
toolchain: nightly
20+
toolchain: stable
2121

2222
- name: Run tests
2323
id: cargo_test
2424
run: |
25-
cargo +nightly test --test skeptic -- -Z unstable-options --format junit --report-time --test-threads=1 | tee ./TEST-cookbook.xml
25+
cargo test --test skeptic -- --test-threads=1
2626
27-
- name: List files for debugging
27+
- name: Test Results
2828
if: always()
29-
run: ls -R
30-
31-
- name: Publish Test Report
32-
uses: mikepenz/[email protected]
33-
if: always()
34-
with:
35-
fail_on_failure: true
36-
require_tests: true
37-
summary: ${{ steps.cargo_test.outputs.summary }}
38-
report_paths: '**/TEST-*.xml'
29+
run: |
30+
if [ ${{ steps.cargo_test.outcome }} == 'success' ]; then
31+
echo "✅ All tests passed!"
32+
else
33+
echo "❌ Some tests failed. Check the logs above for details."
34+
exit 1
35+
fi

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ target/
44
book/
55
*.swp
66
lines.txt
7-
.idea/
7+
.idea/
8+
.skeptic-cache
9+
.lycheecache

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"makefile.configureOnOpen": false
3+
}

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ after the code sample.
259259
> The [distributions available are documented here][rand-distributions].
260260
261261
[uniform distribution]: https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)
262-
[`Distribution::sample`]: https://docs.rs/rand/*/rand/distributions/trait.Distribution.html#tymethod.sample
263-
[`rand::Rng`]: https://docs.rs/rand/*/rand/trait.Rng.html
264-
[rand-distributions]: https://docs.rs/rand/*/rand/distributions/index.html
262+
[`Distribution::sample`]: https://docs.rs/rand/0.9/rand/distr/trait.Distribution.html#tymethod.sample
263+
[`rand::Rng`]: https://docs.rs/rand/0.9/rand/trait.Rng.html
264+
[rand-distributions]: https://docs.rs/rand/0.9/rand/distr/index.html
265265

266266
#### Code
267267

Cargo.toml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,28 @@ license = "MIT/Apache-2.0"
77
publish = false
88
build = "build.rs"
99

10+
[features]
11+
default = []
12+
test-rand = []
13+
1014
[dependencies]
1115
ansi_term = "0.11.0"
1216
approx = "0.3"
13-
base64 = "0.9"
14-
bitflags = "1.0"
17+
base64 = "0.22.1"
18+
bitflags = "1.3.2"
1519
byteorder = "1.0"
1620
cc = "1.0"
1721
chrono = "0.4"
1822
clap = "4.5"
19-
crossbeam = "0.5"
20-
crossbeam-channel = "0.3.9"
23+
crossbeam = "0.8"
24+
crossbeam-channel = "0.5"
2125
csv = "1.0"
2226
data-encoding = "2.1.0"
2327
env_logger = "0.11.3"
2428
flate2 = "1.0"
2529
glob = "0.3"
26-
image = "0.20"
30+
image = "0.24"
31+
2732
lazy_static = "1.0"
2833
log = "0.4"
2934
log4rs = "0.8"
@@ -35,23 +40,26 @@ num = "0.4"
3540
num_cpus = "1.16"
3641
percent-encoding = "2.3"
3742
petgraph = "0.6"
38-
postgres = "0.19"
43+
postgres = "0.19.7"
3944
rand = "0.9"
40-
rand_distr = "0.5.1"
45+
rand_distr = "0.5"
4146
rayon = "1.10"
4247
regex = "1.11"
4348
reqwest = { version = "0.12", features = ["blocking", "json", "stream"] }
4449
ring = "0.17"
4550
rusqlite = { version = "0.32", features = ["chrono"] }
4651
same-file = "1.0"
47-
select = "0.6"
52+
select = "0.6.0"
53+
4854
semver = "1.0"
4955
serde = { version = "1.0", features = ["derive"] }
5056
serde_derive = "1.0"
5157
serde_json = "1.0"
58+
sha2 = "0.10"
5259
tar = "0.4"
5360
tempfile = "3.14"
5461
thiserror = "2"
62+
anyhow = "1.0"
5563
threadpool = "1.8"
5664
toml = "0.8"
5765
tokio = { version = "1", features = ["full"] }
@@ -63,9 +71,9 @@ walkdir = "2.5"
6371
syslog = "5.0"
6472

6573
[build-dependencies]
66-
skeptic = "0.13"
74+
skeptic = { git = "https://github.com/AndyGauge/rust-skeptic", branch = "rlib-patch" }
6775
walkdir = "2.5"
6876

6977
[dev-dependencies]
70-
skeptic = "0.13"
78+
skeptic = { git = "https://github.com/AndyGauge/rust-skeptic", branch = "rlib-patch" }
7179
walkdir = "2.5"

LICENSE-CC0

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ Affirmer's express Statement of Purpose.
113113
CC0 or use of the Work.
114114

115115
For more information, please see
116-
<http://creativecommons.org/publicdomain/zero/1.0/>
116+
<https://creativecommons.org/publicdomain/zero/1.0/>

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# A Rust Cookbook &emsp; [![Build Status][build-badge]][build-url]
2-
3-
[build-badge]: https://github.com/rust-lang-nursery/rust-cookbook/workflows/Deploy%20to%20GitHub%20Pages/badge.svg
4-
[build-url]: https://github.com/rust-lang-nursery/rust-cookbook/actions?query=workflow%3A%22Deploy+to+GitHub+Pages%22
1+
# A Rust Cookbook
52

63
**[Read it here]**.
74

@@ -92,12 +89,12 @@ For details see [CONTRIBUTING.md] on GitHub.
9289
## License [![CC0-badge]][CC0-deed]
9390

9491
Rust Cookbook is licensed under Creative Commons Zero v1.0 Universal License
95-
([LICENSE-CC0](LICENSE-CC0) or https://creativecommons.org/publicdomain/zero/1.0/legalcode)
92+
([LICENSE-CC0](LICENSE-CC0) or https://creativecommons.org/)
9693

9794
Unless you explicitly state otherwise, any contribution intentionally submitted
9895
for inclusion in Rust Cookbook by you, as defined in the CC0-1.0 license, shall be
9996
[dedicated to the public domain][CC0-deed] and licensed as above, without any additional
10097
terms or conditions.
10198

102-
[CC0-deed]: https://creativecommons.org/publicdomain/zero/1.0/deed.en
99+
[CC0-deed]: https://creativecommons.org/publicdomain/zero/1.0/
103100
[CC0-badge]: https://mirrors.creativecommons.org/presskit/buttons/80x15/svg/cc-zero.svg

build.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ const REMOVED_TESTS: &[&str] = &[
66
];
77

88
fn main() {
9+
#[cfg(feature = "test-rand")]
10+
{
11+
let rand_paths = vec![
12+
"./src/algorithms/randomness/rand.md",
13+
"./src/algorithms/randomness/rand-range.md",
14+
"./src/algorithms/randomness/rand-dist.md",
15+
"./src/algorithms/randomness/rand-custom.md",
16+
"./src/algorithms/randomness/rand-passwd.md",
17+
"./src/algorithms/randomness/rand-choose.md",
18+
];
19+
skeptic::generate_doc_tests(&rand_paths[..]);
20+
return;
21+
}
22+
923
let paths = WalkDir::new("./src/").into_iter()
1024
// convert paths to Strings
1125
.map(|p| p.unwrap().path().to_str().unwrap().to_string())

ci/lychee.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ exclude_loopback = false
3030

3131
# Check mail addresses
3232
include_mail = true
33+
34+
# Exclude problematic links that consistently fail
35+
exclude = [
36+
# Creative Commons links return 403 for automated requests
37+
"https://creativecommons.org/publicdomain/zero/1.0/",
38+
"https://creativecommons.org/"
39+
]

0 commit comments

Comments
 (0)