Skip to content

Commit

Permalink
Use Cargo workspace (#78)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: William Woodruff <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent e016dcc commit 600e2f0
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 129 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ updates:
directories:
- "/rust"
- "/rust/tsp-asn1"
- "/"
groups:
actions:
patterns:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
rust/**/target
target/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
47 changes: 24 additions & 23 deletions rust/Cargo.lock → Cargo.lock

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

20 changes: 20 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[workspace]
resolver = "2"

members = [
"rust/",
"rust/tsp-asn1",
]

[workspace.dependencies]
asn1 = "0.20"
cryptography-x509 = { git = "https://github.com/pyca/cryptography.git", tag = "44.0.0" }
hex = "0.4"

[workspace.package]
version = "0.0.1"
edition = "2021"
authors = [
"Trail of Bits <[email protected]>"
]
publish = false
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ features = ["pyo3/abi3-py39", "pyo3/extension-module"]
python-source = "src"
manifest-path = "rust/Cargo.toml"
module-name = "rfc3161_client._rust"
sdist-generator = "git"

[tool.ruff]
line-length = 100
Expand Down
16 changes: 7 additions & 9 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[package]
name = "rfc3161-client"
version = "0.1.0"
edition = "2021"
authors = [
"Trail of Bits <[email protected]>"
]
publish = false
version.workspace = true
edition.workspace = true
authors.workspace = true
publish.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
Expand All @@ -15,12 +13,12 @@ crate-type = ["cdylib"]
[dependencies]
tsp-asn1 = { path = "tsp-asn1" }
pyo3 = { version = "0.23.2", features = ["abi3"] }
asn1 = "0.20"
asn1.workspace = true
self_cell = "1"
hex = "0.4"
hex.workspace = true
sha2 = "0.10.8"
rand = "0.8.5"
cryptography-x509 = { git = "https://github.com/pyca/cryptography.git", tag = "44.0.0" }
cryptography-x509.workspace = true
openssl = { version = "0.10.68", features = ["vendored"] }

[features]
Expand Down
1 change: 1 addition & 0 deletions rust/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub fn generate_random_bytes_for_asn1_biguint() -> Vec<u8> {
}
}

#[cfg(test)]
mod tests {
use super::generate_random_bytes_for_asn1_biguint;

Expand Down
88 changes: 0 additions & 88 deletions rust/tsp-asn1/Cargo.lock

This file was deleted.

16 changes: 7 additions & 9 deletions rust/tsp-asn1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
[package]
name = "tsp-asn1"
version = "0.0.1"
edition = "2021"
authors = [
"Trail of Bits <[email protected]>"
]
publish = false
version.workspace = true
edition.workspace = true
authors.workspace = true
publish.workspace = true

[lib]
name = "tsp_asn1"

[dependencies]
asn1 = "0.20"
cryptography-x509 = { git = "https://github.com/pyca/cryptography.git", tag = "44.0.0" }
asn1.workspace = true
cryptography-x509.workspace = true

[dev-dependencies]
hex = "0.4"
hex.workspace = true

0 comments on commit 600e2f0

Please sign in to comment.