Skip to content

Commit 1eaee60

Browse files
authored
Update versioning docs in CONTRIBUTING.md (#4423)
Also fixes a few post-GA versioning issues I found in the course of updating docs.
1 parent 7907ecb commit 1eaee60

5 files changed

Lines changed: 34 additions & 19 deletions

File tree

CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,24 +385,26 @@ The output of the tests will be presented in the command line as well as saved u
385385

386386
### Versions
387387

388-
To provide a helpful versioning experience, the Azure SDK for Rust libraries follow conventions similar to other Azure SDKs.
388+
To provide a convenient versioning experience, the Azure SDK for Rust libraries follow conventions similar to other Azure SDKs.
389389

390390
Release builds will fail if a library depends on another Azure SDK for Rust library which has not been released and is not included in the current release build.
391391

392392
#### Workspace dependencies
393393

394-
The root `Cargo.toml` file represents released versions of crates which can be used by other Azure SDK for Rust libraries. To use a released version of a library, use `workspace = true` in your library's `Cargo.toml`.
394+
The root `Cargo.toml` file represents released versions of crates commonly used by other Azure SDK for Rust libraries. To use a released version of a library, use `workspace = true` in your library's `Cargo.toml`.
395395

396396
```toml
397397
azure_core = { workspace = true }
398398
```
399399

400-
If an SDK library depends on an unreleased SDK library, specify that dependency using a path-based dependency (`version` is required for the library to release):
400+
If an SDK library depends on an unreleased SDK library, specify that dependency using a `path`-based dependency with a `version` matching the crate version, which is required for the library to release:
401401

402402
```toml
403403
azure_core = { path = "../../core/azure_core", version = "0.31.0" }
404404
```
405405

406+
See <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#inheriting-a-dependency-from-a-workspace> for more information about specifying dependencies in `Cargo.toml`.
407+
406408
#### Version increment on release
407409

408410
When a release to crates.io completes, the Engineering System opens a pull request to increment versions of released packages. This PR should be merged as soon as possible to put the `main` branch in a "releasable" state and to provide context that code at the HEAD of `main` may not reflect code in a previously released version of a library.

Cargo.lock

Lines changed: 21 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ version = "1.0.0"
6060
[workspace.dependencies.azure_core_amqp]
6161
version = "1.0.0"
6262

63-
[workspace.dependencies.azure_messaging_eventhubs]
64-
version = "0.15.0"
65-
path = "sdk/eventhubs/azure_messaging_eventhubs"
66-
6763
[workspace.dependencies.azure_core_opentelemetry]
6864
# azure_core_opentelemetry should only ever be in dev-dependencies herein
6965
version = "1.0.0"
@@ -81,8 +77,7 @@ path = "sdk/core/azure_core_test_macros"
8177
version = "1.0.0"
8278

8379
[workspace.dependencies.azure_storage_blob]
84-
path = "sdk/storage/azure_storage_blob"
85-
version = "1.1.0-beta.1"
80+
version = "1.0.0"
8681

8782
[workspace.dependencies]
8883
async-lock = "3.4"

eng/scripts/verify-dependencies.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ fn main() {
7070
if let Some(targets) = package_manifest.target.as_ref() {
7171
for (target, platform) in targets {
7272
all_dependencies.push((
73-
format!("target.'{}'.dependencies", target),
73+
format!("target.'{target}'.dependencies"),
7474
platform.dependencies.as_ref(),
7575
));
7676
all_dependencies.push((
77-
format!("target.'{}'.dev-dependencies", target),
77+
format!("target.'{target}'.dev-dependencies"),
7878
platform.dev_dependencies(),
7979
));
8080
all_dependencies.push((
81-
format!("target.'{}'.build-dependencies", target),
81+
format!("target.'{target}'.build-dependencies"),
8282
platform.build_dependencies(),
8383
));
8484
}
@@ -109,16 +109,15 @@ fn main() {
109109
})
110110
.filter(|v| {
111111
package_manifest.package.as_ref().is_some_and(|package| {
112-
!EXEMPTIONS
113-
.contains(&(package.name.as_ref().expect("REASON").as_str(), &v.name))
112+
!EXEMPTIONS.contains(&(package.name.as_ref().unwrap().as_str(), &v.name))
114113
})
115114
})
116115
.collect();
117116

118117
if !dependencies.is_empty() {
119118
dependencies.sort();
120119
println!(
121-
"The following `{}` dependencies do not inherit from workspace `{}`:\n",
120+
"The following `{}` dependencies do not inherit from workspace `{}` or reference via `path`:\n",
122121
package_manifest_path.display(),
123122
workspace_manifest_path.display(),
124123
);
@@ -131,7 +130,7 @@ fn main() {
131130
.join("\n* ")
132131
);
133132
println!("Add dependencies to workspace and change the package dependency to `{{ workspace = true }}`.");
134-
println!("See <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#inheriting-a-dependency-from-a-workspace> for more information.");
133+
println!("See <https://github.com/Azure/azure-sdk-for-rust/blob/main/CONTRIBUTING.md#versions> for more information.");
135134
println!();
136135

137136
found = true;

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rust-version.workspace = true
2121
[dependencies]
2222
async-trait.workspace = true
2323
azure_core.workspace = true
24-
azure_messaging_eventhubs.workspace = true
24+
azure_messaging_eventhubs = { path = "../azure_messaging_eventhubs", version = "0.15.0" }
2525
azure_storage_blob.workspace = true
2626
futures.workspace = true
2727
serde = { workspace = true, features = ["derive"] }

0 commit comments

Comments
 (0)