Skip to content

Commit dc3dd8b

Browse files
committed
update samples noxfile
1 parent c9cde9f commit dc3dd8b

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎.librarian/generator-input/client-post-processing/bigtable-integration.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,17 @@ replacements:
756756
if "beam" not in p.parts
757757
]
758758
req_args = [arg for req_file in req_files for arg in ("-r", req_file)]
759-
session.install("-e", ".")
760759
session.install(
761760
"google-cloud-testutils",
762761
"mock",
763762
"pytest",
764763
"pytest-asyncio",
765764
*req_args,
766765
)
767-
session.install("-e", ".", "--no-deps")
766+
# Install the library from this checkout last so the samples exercise the
767+
# code at HEAD rather than a released version. The samples' requirements.txt
768+
# files intentionally leave google-cloud-bigtable unpinned for this reason.
769+
session.install("-e", ".")
768770
769771
has_target = any(not arg.startswith("-") for arg in session.posargs)
770772
target_paths = [] if has_target else [os.path.join("samples")]

‎packages/google-cloud-bigtable/noxfile.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,15 +396,17 @@ def samples(session):
396396
if "beam" not in p.parts
397397
]
398398
req_args = [arg for req_file in req_files for arg in ("-r", req_file)]
399-
session.install("-e", ".")
400399
session.install(
401400
"google-cloud-testutils",
402401
"mock",
403402
"pytest",
404403
"pytest-asyncio",
405404
*req_args,
406405
)
407-
session.install("-e", ".", "--no-deps")
406+
# Install the library from this checkout last so the samples exercise the
407+
# code at HEAD rather than a released version. The samples' requirements.txt
408+
# files intentionally leave google-cloud-bigtable unpinned for this reason.
409+
session.install("-e", ".")
408410

409411
has_target = any(not arg.startswith("-") for arg in session.posargs)
410412
target_paths = [] if has_target else [os.path.join("samples")]

‎packages/google-cloud-bigtable/samples/README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ This directory contains code samples for Cloud Bigtable, which may be used as a
2424
python main.py $GOOGLE_CLOUD_PROJECT $BIGTABLE_INSTANCE
2525
```
2626

27-
3. To run sample tests using Nox:
27+
3. To run the sample tests using Nox, from the `packages/google-cloud-bigtable` directory:
2828
```bash
29-
nox -s py-3.14
29+
nox -s samples
30+
```
31+
This installs the library from the repository checkout, so the samples are
32+
tested against the code at HEAD. To run a subset, pass a path:
33+
```bash
34+
nox -s samples -- samples/legacy_client/quickstart
3035
```
3136

3237
## Additional Information

0 commit comments

Comments
 (0)