Browse Source

Move objects to crates/

Jelmer Vernooij 1 year ago
parent
commit
d20889374a
7 changed files with 43 additions and 18 deletions
  1. 1 0
      .gitignore
  2. 8 0
      Cargo.lock
  3. 2 12
      Cargo.toml
  4. 11 0
      crates/objects/Cargo.toml
  5. 0 0
      crates/objects/src/lib.rs
  6. 12 0
      crates/pack/Cargo.toml
  7. 9 6
      setup.py

+ 1 - 0
.gitignore

@@ -26,3 +26,4 @@ docs/api/*.txt
 .eggs
 dulwich.dist-info
 .stestr
+target/

+ 8 - 0
Cargo.lock

@@ -71,6 +71,14 @@ version = "1.18.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
 
+[[package]]
+name = "pack-py"
+version = "3.4.0"
+dependencies = [
+ "memchr",
+ "pyo3",
+]
+
 [[package]]
 name = "parking_lot"
 version = "0.12.1"

+ 2 - 12
Cargo.toml

@@ -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 - 0
crates/objects/Cargo.toml

@@ -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"

+ 0 - 0
dulwich/_objects.rs → crates/objects/src/lib.rs


+ 12 - 0
crates/pack/Cargo.toml

@@ -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"

+ 9 - 6
setup.py

@@ -40,15 +40,18 @@ ext_modules = [
     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)