Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cargo workspace #78

Merged
merged 10 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
woodruffw marked this conversation as resolved.
Show resolved Hide resolved
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
Loading