-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: fix the testing src-layout structure and use relative impor…
…ts (#1431) The original commit merging ops-scenario into this repository had an error in the [src-layout](https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/) structure: the `src` folder should contain a folder for each of the importable packages, not have all of the individual modules. This PR moves everything in `testing/src/` to `testing/src/scenario/` to fix this. This means that the build tool can find the package without any help, and makes editable installs work correctly, which removes a quirk in the tox dependency installs. It also makes it simpler to work on the project, since the `ops` and `scenario` packages are available in the expected format with the expected name (although src-layout encourages editable installs for development). For the second part of the cleanup, the PR changes the `testing/src/scenario` imports to be relative for everything inside of that location. While adjusting these, most of the imports are adjusted to import from the top-level `ops` namespace rather than from individual modules (except for non-exported names). --------- Co-authored-by: Dima Tisnek <[email protected]>
- Loading branch information
1 parent
68cf2d7
commit 53f1bb4
Showing
13 changed files
with
57 additions
and
77 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
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" | |
[project] | ||
name = "ops-scenario" | ||
|
||
version = "7.0.5" | ||
version = "7.0.6.dev0" | ||
|
||
authors = [ | ||
{ name = "Pietro Pasotti", email = "[email protected]" } | ||
|
@@ -41,9 +41,6 @@ classifiers = [ | |
"Homepage" = "https://github.com/canonical/operator" | ||
"Bug Tracker" = "https://github.com/canonical/operator/issues" | ||
|
||
[tool.setuptools.package-dir] | ||
scenario = "src" | ||
|
||
[tool.ruff.format] | ||
# Like Black, use double quotes for strings. | ||
quote-style = "double" | ||
|
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
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
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
File renamed without changes.
File renamed without changes.
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
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
File renamed without changes.
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
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
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