-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
33 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Generated protos | ||
*_pb2.py | ||
*_pb2_grpc.py | ||
*_pb2.pyi |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Why this file was created | ||
|
||
[YDB Python tests](https://github.com/ydb-platform/ydb/tree/main/ydb/tests) import and use symbols from [YDB Python SDK](https://github.com/ydb-platform/ydb-python-sdk) in their source code. YDB Python SDK is availible as pip package, but its sources are also [shipped with YDB](https://github.com/ydb-platform/ydb/tree/main/ydb/public/sdk/python/ydb), so, when the tests are run, the developer is sure that he or she is using the most recent version of SDK. | ||
|
||
When tests are run in YDB developers private infrastructure, some tweaks are applied, and SDK sources are put at top-level, so its symbols should be imported via `import ydb`. | ||
|
||
However, when sources are published in GitHub, they are not moved prior to tests launch and reside in *ydb/public/sdk/python/ydb*, so symbols should be imported via `from ydb.public.sdk.python import ydb`. | ||
|
||
We choose the type of the import based on environment variable value. |
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 @@ | ||
from ydb.tests.oss_canonical import is_oss | ||
|
||
if is_oss: | ||
from ydb.public.sdk.python import ydb # noqa | ||
else: | ||
import ydb # noqa |