Skip to content

Commit

Permalink
Move objects to crates/
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Feb 10, 2024
1 parent 4832e1b commit d208893
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ docs/api/*.txt
.eggs
dulwich.dist-info
.stestr
target/
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
[package]
name = "objects-py"
version = "3.4.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]
path = "dulwich/_objects.rs"

[dependencies]
pyo3 = { version = ">=0.19", features = ["extension-module"]}
memchr = "2"
[workspace]
members = ["crates/*"]
11 changes: 11 additions & 0 deletions crates/objects/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "objects-py"
version = "3.4.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = ">=0.19", features = ["extension-module"]}
memchr = "2"
File renamed without changes.
12 changes: 12 additions & 0 deletions crates/pack/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "pack-py"
version = "3.4.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]
path = "dulwich/_pack.rs"

[dependencies]
pyo3 = { version = ">=0.19", features = ["extension-module"]}
memchr = "2"
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@
Extension("dulwich._diff_tree", ["dulwich/_diff_tree.c"], optional=optional),
]

rust_extensions = [
RustExtension("dulwich._objects", "crates/objects/Cargo.toml", binding=Binding.PyO3, optional = True),
]

# Ideally, setuptools would just provide a way to do this
if "--pure" in sys.argv:
sys.argv.remove("--pure")
ext_modules = []
rust_extensions = []


setup(
package_data={"": ["../docs/tutorial/*.txt", "py.typed"]},
rust_extensions=[RustExtension("dulwich._objects", "Cargo.toml", binding=Binding.PyO3, optional = True)],
ext_modules=ext_modules,
tests_require=tests_require,
)
setup(package_data={'': ['../docs/tutorial/*.txt', 'py.typed']},
ext_modules=ext_modules,
rust_extensions=rust_extensions,
tests_require=tests_require)

0 comments on commit d208893

Please sign in to comment.