Skip to content

Commit

Permalink
build: use src/ dir for python
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jan 12, 2024
1 parent 50ae29a commit 65aaeda
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
# rust compilation
rust/target

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Drop-in replacement for the [pyliftover](https://github.com/konstantint/pyliftover) tool. Name forthcoming.

Status: very, very preliminary.

## Usage
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ build-backend = "maturin"
[tool.maturin]
features = ["pyo3/extension-module"]
module-name = "chainlifter._core"
python-source = "python"
python-source = "src"

[tool.ruff]
src = ["python"]
src = ["src"]
# pycodestyle (E, W)
# Pyflakes (F)
# flake8-annotations (ANN)
Expand Down
6 changes: 4 additions & 2 deletions Cargo.toml → rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name = "chainlifter"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "chainlifter"
crate-type = ["cdylib"]

[dependencies]
chainfile = "0.2.1"
pyo3 = "0.19.0"
directories = "5.0"

[dependencies.pyo3]
version = "0.20.0"
features = ["abi3-py38"]
3 changes: 2 additions & 1 deletion src/lib.rs → rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ impl ChainLifter {

/// ChainLifter Python module. Collect Python-facing methods.
#[pymodule]
fn _chainlifter(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
#[pyo3(name = "_core")]
fn chainlifter(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
m.add_class::<ChainLifter>()?;
Ok(())
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 65aaeda

Please sign in to comment.