Skip to content

Commit a291880

Browse files
committed
Make pecos crate doctests more stable?
1 parent 9ce58bb commit a291880

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ clean-unix:
134134
@find . -type d -name "junit" -exec rm -rf {} +
135135
@find python -name "*.so" -delete
136136
@find python -name "*.pyd" -delete
137+
@# Clean all target directories in crates (in case they were built independently)
138+
@find crates -type d -name "target" -exec rm -rf {} +
139+
@find python -type d -name "target" -exec rm -rf {} +
140+
@# Clean the root workspace target directory
137141
@cargo clean
138142

139143
.PHONY: clean-windows-ps
@@ -149,6 +153,9 @@ clean-windows-ps:
149153
@powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter '.hypothesis' | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue"
150154
@powershell -Command "Get-ChildItem -Path . -Recurse -Directory -Filter 'junit' | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue"
151155
@powershell -Command "Get-ChildItem -Path python -Recurse -File -Include '*.so','*.pyd' | Remove-Item -Force -ErrorAction SilentlyContinue"
156+
@# Clean all target directories in crates
157+
@powershell -Command "Get-ChildItem -Path crates -Recurse -Directory -Filter 'target' | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue"
158+
@powershell -Command "Get-ChildItem -Path python -Recurse -Directory -Filter 'target' | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue"
152159
@cargo clean
153160

154161
.PHONY: clean-windows-cmd
@@ -164,6 +171,9 @@ clean-windows-cmd:
164171
-@for /f "delims=" %%d in ('dir /s /b /ad .hypothesis 2^>nul') do @rd /s /q "%%d" 2>nul
165172
-@for /f "delims=" %%d in ('dir /s /b /ad junit 2^>nul') do @rd /s /q "%%d" 2>nul
166173
-@for /f "delims=" %%f in ('dir /s /b python\*.so python\*.pyd 2^>nul') do @del "%%f" 2>nul
174+
-@REM Clean all target directories in crates
175+
-@for /f "delims=" %%d in ('dir /s /b /ad crates\target 2^>nul') do @rd /s /q "%%d" 2>nul
176+
-@for /f "delims=" %%d in ('dir /s /b /ad python\target 2^>nul') do @rd /s /q "%%d" 2>nul
167177
-@cargo clean
168178

169179
.PHONY: pip-install-uv

crates/pecos/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ categories.workspace = true
1111
readme = "../../README.md"
1212
description = "A crate for evaluating and exploring quantum error correction."
1313

14+
[lib]
15+
doctest = true
16+
test = true
17+
1418
[dependencies]
1519
pecos-core.workspace = true
1620
pecos-qsim.workspace = true
@@ -25,9 +29,12 @@ serde_json.workspace = true
2529
tempfile = "3.8"
2630
# Required for doctests
2731
pecos-core.workspace = true
32+
pecos-qsim.workspace = true
2833
pecos-engines.workspace = true
34+
pecos-qasm.workspace = true
2935
pecos-qir.workspace = true
3036
pecos-phir.workspace = true
37+
log.workspace = true
3138
serde_json.workspace = true
3239

3340
[lints]

crates/pecos/src/lib.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@
1010
// or implied. See the License for the specific language governing permissions and limitations under
1111
// the License.
1212

13+
//! The PECOS crate provides unified access to quantum error correction functionality.
14+
//!
15+
//! This crate serves as the main entry point for the PECOS ecosystem, re-exporting
16+
//! the primary functionality from the various specialized crates.
17+
18+
#[cfg(doctest)]
19+
extern crate pecos_core;
20+
#[cfg(doctest)]
21+
extern crate pecos_engines;
22+
#[cfg(doctest)]
23+
extern crate pecos_phir;
24+
#[cfg(doctest)]
25+
extern crate pecos_qasm;
26+
#[cfg(doctest)]
27+
extern crate pecos_qir;
28+
#[cfg(doctest)]
29+
extern crate pecos_qsim;
30+
1331
pub mod engines;
1432
pub mod prelude;
1533
pub mod program;

0 commit comments

Comments
 (0)