mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Move Cargo.toml workspace configuration to the root of the repo. (#11836)
This allows cargo commands like check/fmt to work from the root of the repo
This commit is contained in:
parent
45cf761839
commit
7a296270aa
5 changed files with 62 additions and 64 deletions
0
src/rust/Cargo.lock → Cargo.lock
generated
0
src/rust/Cargo.lock → Cargo.lock
generated
22
Cargo.toml
Normal file
22
Cargo.toml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"src/rust/",
|
||||
"src/rust/cryptography-cffi",
|
||||
"src/rust/cryptography-keepalive",
|
||||
"src/rust/cryptography-key-parsing",
|
||||
"src/rust/cryptography-openssl",
|
||||
"src/rust/cryptography-x509",
|
||||
"src/rust/cryptography-x509-verification",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.0"
|
||||
authors = ["The cryptography developers <cryptography-dev@python.org>"]
|
||||
edition = "2021"
|
||||
publish = false
|
||||
# This specifies the MSRV
|
||||
rust-version = "1.65.0"
|
||||
|
||||
[profile.release]
|
||||
overflow-checks = true
|
||||
79
noxfile.py
79
noxfile.py
|
|
@ -231,34 +231,33 @@ def rust(session: nox.Session) -> None:
|
|||
pyproject_data = load_pyproject_toml()
|
||||
install(session, *pyproject_data["build-system"]["requires"])
|
||||
|
||||
with session.chdir("src/rust/"):
|
||||
session.run("cargo", "fmt", "--all", "--", "--check", external=True)
|
||||
if session.name != "rust-noclippy":
|
||||
session.run(
|
||||
"cargo",
|
||||
"clippy",
|
||||
"--all",
|
||||
"--",
|
||||
"-D",
|
||||
"warnings",
|
||||
external=True,
|
||||
)
|
||||
|
||||
build_output = session.run(
|
||||
"cargo",
|
||||
"test",
|
||||
"--no-default-features",
|
||||
"--all",
|
||||
"--no-run",
|
||||
"-q",
|
||||
"--message-format=json",
|
||||
external=True,
|
||||
silent=True,
|
||||
)
|
||||
session.run("cargo", "fmt", "--all", "--", "--check", external=True)
|
||||
if session.name != "rust-noclippy":
|
||||
session.run(
|
||||
"cargo", "test", "--no-default-features", "--all", external=True
|
||||
"cargo",
|
||||
"clippy",
|
||||
"--all",
|
||||
"--",
|
||||
"-D",
|
||||
"warnings",
|
||||
external=True,
|
||||
)
|
||||
|
||||
build_output = session.run(
|
||||
"cargo",
|
||||
"test",
|
||||
"--no-default-features",
|
||||
"--all",
|
||||
"--no-run",
|
||||
"-q",
|
||||
"--message-format=json",
|
||||
external=True,
|
||||
silent=True,
|
||||
)
|
||||
session.run(
|
||||
"cargo", "test", "--no-default-features", "--all", external=True
|
||||
)
|
||||
|
||||
# It's None on install-only invocations
|
||||
if build_output is not None:
|
||||
assert isinstance(build_output, str)
|
||||
|
|
@ -288,18 +287,17 @@ def local(session):
|
|||
session.run("ruff", "format", ".")
|
||||
session.run("ruff", "check", ".")
|
||||
|
||||
with session.chdir("src/rust/"):
|
||||
session.run("cargo", "fmt", "--all", external=True)
|
||||
session.run("cargo", "check", "--all", "--tests", external=True)
|
||||
session.run(
|
||||
"cargo",
|
||||
"clippy",
|
||||
"--all",
|
||||
"--",
|
||||
"-D",
|
||||
"warnings",
|
||||
external=True,
|
||||
)
|
||||
session.run("cargo", "fmt", "--all", external=True)
|
||||
session.run("cargo", "check", "--all", "--tests", external=True)
|
||||
session.run(
|
||||
"cargo",
|
||||
"clippy",
|
||||
"--all",
|
||||
"--",
|
||||
"-D",
|
||||
"warnings",
|
||||
external=True,
|
||||
)
|
||||
|
||||
session.run(
|
||||
"mypy",
|
||||
|
|
@ -331,10 +329,9 @@ def local(session):
|
|||
*tests,
|
||||
)
|
||||
|
||||
with session.chdir("src/rust/"):
|
||||
session.run(
|
||||
"cargo", "test", "--no-default-features", "--all", external=True
|
||||
)
|
||||
session.run(
|
||||
"cargo", "test", "--no-default-features", "--all", external=True
|
||||
)
|
||||
|
||||
|
||||
LCOV_SOURCEFILE_RE = re.compile(
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@ include = [
|
|||
"src/_cffi_src/**/*.c",
|
||||
"src/_cffi_src/**/*.h",
|
||||
|
||||
"src/rust/**/Cargo.toml",
|
||||
"src/rust/**/Cargo.lock",
|
||||
"**/Cargo.toml",
|
||||
"**/Cargo.lock",
|
||||
"src/rust/**/*.rs",
|
||||
|
||||
"tests/**/*.py",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
[workspace.package]
|
||||
version = "0.1.0"
|
||||
authors = ["The cryptography developers <cryptography-dev@python.org>"]
|
||||
edition = "2021"
|
||||
publish = false
|
||||
# This specifies the MSRV
|
||||
rust-version = "1.65.0"
|
||||
|
||||
[package]
|
||||
name = "cryptography-rust"
|
||||
version.workspace = true
|
||||
|
|
@ -39,18 +31,5 @@ default = ["extension-module"]
|
|||
name = "cryptography_rust"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[profile.release]
|
||||
overflow-checks = true
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"cryptography-cffi",
|
||||
"cryptography-keepalive",
|
||||
"cryptography-key-parsing",
|
||||
"cryptography-openssl",
|
||||
"cryptography-x509",
|
||||
"cryptography-x509-verification",
|
||||
]
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(CRYPTOGRAPHY_OPENSSL_300_OR_GREATER)', 'cfg(CRYPTOGRAPHY_OPENSSL_320_OR_GREATER)', 'cfg(CRYPTOGRAPHY_IS_LIBRESSL)', 'cfg(CRYPTOGRAPHY_IS_BORINGSSL)', 'cfg(CRYPTOGRAPHY_OSSLCONF, values("OPENSSL_NO_IDEA", "OPENSSL_NO_CAST", "OPENSSL_NO_BF", "OPENSSL_NO_CAMELLIA", "OPENSSL_NO_SEED", "OPENSSL_NO_SM4"))'] }
|
||||
|
|
|
|||
Loading…
Reference in a new issue