-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fca5fc3
commit 3aea84d
Showing
9 changed files
with
170 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,20 @@ | ||
/target | ||
# IDEs | ||
/.idea/ | ||
/.vscode/ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
# Caches | ||
.DS_Store | ||
__pycache__/ | ||
.pytest_cache/ | ||
*.py[cod] | ||
/.*cache/ | ||
/.hypothesis/ | ||
|
||
# C extensions | ||
# Build | ||
*.so | ||
|
||
.hypothesis/ | ||
|
||
# docs generated rst | ||
docs/generated | ||
|
||
# Distribution / packaging | ||
.Python | ||
.venv/ | ||
env/ | ||
bin/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
include/ | ||
man/ | ||
venv/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
pip-selfcheck.json | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# Rope | ||
.ropeproject | ||
|
||
# Django stuff: | ||
*.log | ||
*.pot | ||
|
||
.DS_Store | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyCharm | ||
.idea/ | ||
|
||
# VSCode | ||
.vscode/ | ||
|
||
# Pyenv | ||
.python-version | ||
|
||
# testing | ||
data/ | ||
fixture/ | ||
*.pyi | ||
/target/ | ||
/dist/ | ||
/docs/_build/ | ||
|
||
# Coverage | ||
/.coverage | ||
/coverage.xml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
use std::process::Command; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
maybe_generate_stubs()?; | ||
Ok(()) | ||
} | ||
|
||
/// Generate stubs if we’re compiling the library | ||
/// Returns `true` if stubs were generated | ||
fn maybe_generate_stubs() -> Result<bool, Box<dyn std::error::Error>> { | ||
if env::var("CARGO_BIN_NAME") != Err(env::VarError::NotPresent) { | ||
return Ok(false); | ||
} | ||
|
||
// Find an existing `stub_gen` binary or exit silently | ||
let Some(bin_path) = ["debug", "release"] | ||
.into_iter() | ||
.filter_map(|mode| { | ||
let p = PathBuf::from(format!("target/{mode}/stub_gen")); | ||
p.exists().then_some(p) | ||
}) | ||
.next() | ||
else { | ||
return Ok(false); | ||
}; | ||
|
||
// If we’re compiling the library, generate stubs first | ||
Command::new(bin_path).spawn()?.wait()?; | ||
Ok(true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use pyo3_stub_gen::Result; | ||
|
||
fn main() -> Result<()> { | ||
let stub = zarrs_python::stub_info()?; | ||
stub.generate()?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters