chore: specify explicit options for all API paths in librarian.yaml#16762
chore: specify explicit options for all API paths in librarian.yaml#16762jskeet merged 4 commits intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request standardizes package names across several Google Cloud Python libraries, updating type marker files, sample installation instructions, and snippet metadata to use consistent package identifiers. It also includes minor import reordering in test files and formatting adjustments in repository metadata. I have no feedback to provide.
|
(Having just prototyped the "remove redundant options", the librarian.yaml file will end up being smaller than it is today...) |
391d421 to
5cc56ab
Compare
|
Rebased on main so that we don't reinstate the keep lists we removed before. I'm locally running a |
|
#16764 should fix the |
|
Great - will rebase tomorrow UK time and merge when green (assuming the approval sticks) |
dabc738 to
231872c
Compare
|
@parthea: Looking at the Kokoro logs, I believe these are Spanner failures |
|
Ah, I hadn't realised that #16764 hadn't been merged. That explains why the presubmits are still failing. Happy to rebase again as soon as that's merged. |
…tests (#16764) This PR fixes 2 failing tests which appear in #16762 In the system test presubmit `Kokoro System Tests`, the assertion is too strict. Protobuf objects may fail equality (==) if one has extra metadata populated by the server that the other lacks. If the server fills in a default field in one response but not another, the assertion fails even if the ID is identical. In addition, we need to cater for the chance that other spanner instances are created while tests are running. For example, in [one test result](https://btx.cloud.google.com/invocations/946e7000-b177-491a-947a-88f2daf52a68/log) we expected instance `projects/precise-truck-742/instances/google-cloud-python-systest` but found `projects/precise-truck-742/instances/multi-region-1776903230037` ``` =================================== FAILURES =================================== _____________________________ test_list_instances ______________________________ .. def test_list_instances( no_create_instance, spanner_client, existing_instances, shared_instance, ): instances = list(spanner_client.list_instances()) for instance in instances: > assert instance in existing_instances or instance is shared_instance ... tests/system/test_instance_api.py:40: AssertionError ``` The other failure only appears in the `Kokoro Pre-release Tests`. Updating the `prerelease_deps` nox session to match the system test session resolves the issue. ``` ==================================== ERRORS ==================================== ____________________ ERROR at setup of test_table_not_found ____________________ self = def setup(self) -> None: runner_fixture_id = f"_{self._loop_scope}_scoped_runner" if runner_fixture_id not in self.fixturenames: self.fixturenames.append(runner_fixture_id) > return super().setup() ^^^^^^^^^^^^^^^ .nox/8f8a4a6e/lib/python3.14/site-packages/pytest_asyncio/plugin.py:458: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ fixturedef = request = > @pytest.hookimpl(wrapper=True) def pytest_fixture_setup(fixturedef: FixtureDef, request) -> object | None: asyncio_mode = _get_asyncio_mode(request.config) if not _is_asyncio_fixture_function(fixturedef.func): if asyncio_mode == Mode.STRICT: # Ignore async fixtures without explicit asyncio mark in strict mode # This applies to pytest_trio fixtures, for example > return (yield) ^^^^^ E pytest.PytestRemovedIn9Warning: '' requested an async fixture 'instance_configs', with no plugin or hook that handled it. This is usually an error, as pytest does not natively support it. This will turn into an error in pytest 9. E See: https://docs.pytest.org/en/stable/deprecations.html#sync-test-depending-on-async-fixture .nox/8f8a4a6e/lib/python3.14/site-packages/pytest_asyncio/plugin.py:728: PytestRemovedIn9Warning ``` --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This means we don't use the generator default for any of: - python-gapic-name - python-gapic-namespace - warehouse-package-name A later change in librarian will start inferring these options itself, at which point we can remove the options which are then redundant - and new APIs should almost always use the inferred ones.
The changes here are all corrections where previously the package name was incorrect in comments.
(Those packages weren't previously enabled for generation.)
231872c to
d82998e
Compare
|
@parthea: Done. Fingers crossed... |
|
|
This means we don't use the generator default for any of:
Only API paths which didn't already have an explicit default were updated.
The changes are all from explicitly specifying
warehouse-package-name, and are all corrections from where the generator was inferring the package name incorrectly. (And regenerating Datastore, which wasn't automated in #16737.)This is the first step in googleapis/librarian#5163 - we will then change librarian to use a new approach to inference (deriving the namespace just from the first two components of the API path), and remove all the explicit options which would be inferred the same way. So while this PR adds a lot of lines to the config, many will later be removed again.