-
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inverted workspace inclusions (#2262)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
61d5480
commit 540299f
Showing
12 changed files
with
289 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[workspace] | ||
members = [ | ||
".", | ||
"path-dep-with-root", | ||
] | ||
|
||
[workspace.package] | ||
authors = [] | ||
version = "0.10.2-dev" | ||
publish = false | ||
repository = "https://github.com/mitmproxy/mitmproxy-rs" | ||
|
||
[package] | ||
name = "top_level" | ||
version = "0.1.0" | ||
description = "root dep" | ||
edition = "2021" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Root readme | ||
|
||
In this workspace, the build root is in a subdirectory, while the workspace root also contains a crate. |
6 changes: 6 additions & 0 deletions
6
test-crates/workspace-inverted-order/check_installed/check_installed.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
import path_dep_with_root | ||
|
||
assert path_dep_with_root.add_number(2) == 44 | ||
|
||
print("SUCCESS") |
13 changes: 13 additions & 0 deletions
13
test-crates/workspace-inverted-order/path-dep-with-root/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "path_dep_with_root" | ||
version = "0.1.0" | ||
description = "path dep" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "path_dep_with_root" | ||
crate-type = ["lib", "cdylib"] | ||
|
||
[dependencies] | ||
top_level = { path = "../" } | ||
pyo3 = { version = "0.22.5", features = ["abi3", "abi3-py310", "extension-module"] } |
1 change: 1 addition & 0 deletions
1
test-crates/workspace-inverted-order/path-dep-with-root/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Path readme |
8 changes: 8 additions & 0 deletions
8
test-crates/workspace-inverted-order/path-dep-with-root/pyproject.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[build-system] | ||
requires = ["maturin>=1,<2"] | ||
build-backend = "maturin" | ||
|
||
[project] | ||
name = "mitmproxy_path" | ||
version = "0.1.0" | ||
requires-python = ">=3.10" |
12 changes: 12 additions & 0 deletions
12
test-crates/workspace-inverted-order/path-dep-with-root/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use pyo3::prelude::*; | ||
|
||
#[pymodule] | ||
mod path_dep_with_root { | ||
use pyo3::pyfunction; | ||
use top_level::NUMBER; | ||
|
||
#[pyfunction] | ||
fn add_number(x: u32) -> u32 { | ||
x + NUMBER | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[tool.dummy] | ||
value = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub const NUMBER: u32 = 42; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters