-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove deprecated methods (#6)
feat: remove deprecated methods --------- Co-authored-by: A.Shpak <aleksander.shpak.als@gmail.com>
- Loading branch information
Showing
9 changed files
with
105 additions
and
71 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
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
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,9 +1,10 @@ | ||
#!/usr/bin/env just --justfile | ||
|
||
build: | ||
maturin build \ | ||
--interpreter python3.8 | ||
venv: | ||
source venv/bin/activate | ||
|
||
tests: | ||
maturin develop | ||
pytest -v test_xid.py | ||
maturin build --out dist --interpreter python | ||
python3.8 -m pip install --no-index --find-links dist/ --force-reinstall epyxid | ||
python3.8 -m pip install pytest | ||
python3.8 -m pytest -v test_xid.py |
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
use std::str::FromStr; | ||
|
||
use pyo3::prelude::{pymodule, PyModule, PyResult, Python}; | ||
use pyo3::wrap_pyfunction; | ||
use pyo3::prelude::{pymodule, wrap_pyfunction, Bound, PyModule, PyResult, Python}; | ||
|
||
use crate::errors::XIDError; | ||
use crate::utils::{xid_create, xid_from_bytes, xid_from_str}; | ||
use crate::wrapper::XID; | ||
|
||
const PY_MODULE_VERSION: &str = "0.2.0"; | ||
|
||
mod errors; | ||
mod utils; | ||
mod wrapper; | ||
|
||
#[pymodule] | ||
fn epyxid(_py: Python, m: &PyModule) -> PyResult<()> { | ||
fn epyxid(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
m.add_class::<XID>()?; | ||
m.add_function(wrap_pyfunction!(xid_create, m)?)?; | ||
m.add_function(wrap_pyfunction!(xid_from_str, m)?)?; | ||
m.add_function(wrap_pyfunction!(xid_from_bytes, m)?)?; | ||
m.add("XIDError", _py.get_type::<XIDError>())?; | ||
m.add("XIDError", py.get_type_bound::<XIDError>())?; | ||
m.add("__version__", PY_MODULE_VERSION)?; | ||
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
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