Documentation
¶
Overview ¶
Package python provides Python specific functionality for librarian.
Index ¶
- func Add(lib *config.Library) (*config.Library, error)
- func BuildClientDocumentationURI(libraryName, repoMetadataName string) string
- func Bump(output, version string) error
- func Clean(lib *config.Library) error
- func DefaultLibraryName(api string) string
- func DefaultOutput(name, defaultOutput string) string
- func Fill(library *config.Library) (*config.Library, error)
- func FindExistingLibraryForNewAPI(libraries []*config.Library, apiPath string) *config.Library
- func Generate(ctx context.Context, cfg *config.Config, library *config.Library, ...) error
- func Install(ctx context.Context) error
- func Tidy(lib *config.Library) *config.Library
- func ValidateNewAPIs(lib *config.Library) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClientDocumentationURI ¶ added in v0.8.4
BuildClientDocumentationURI builds the URI for the client documentation for the library. TODO(https://github.com/googleapis/librarian/issues/4175): make this function package-private (or inline it) after migration, when we won't need to determine whether or not to specify an override.
func Bump ¶ added in v0.8.1
Bump updates the version number in the library with the given output directory.
func Clean ¶ added in v0.8.4
Clean removes all generated code from beneath the given library's output directory. If the output directory does not currently exist, this function is a no-op.
func DefaultLibraryName ¶ added in v0.8.1
DefaultLibraryName derives a library name from an API path by stripping the version suffix and replacing "/" with "-". For example: "google/cloud/secretmanager/v1" -> "google-cloud-secretmanager".
func DefaultOutput ¶ added in v0.8.4
DefaultOutput derives an output path from a library name and a default output directory. Currently, this just assumes each library is a directory directly underneath the default output directory.
func Fill ¶ added in v0.11.0
Fill populates empty Python-specific fields. Library configurations takes precedence.
func FindExistingLibraryForNewAPI ¶ added in v0.12.0
FindExistingLibraryForNewAPI attempts to find an existing library that should contain the given new API path. This function uses the concept of a "versionless" path, which is just the path with any version removed (so the versionless path of google/cloud/xyz/v1 is google/cloud/xyz/; the versionless path of google/cloud/xyz/type is still google/cloud/xyz/type). A nil pointer is returned if no existing library is suitable for the new API path. The function observes the following rules:
- If the versionless path of any path in the library is the same as the versionless apiPath, that library is returned.
- If the versionless path of any path in the library is a prefix of apiPath *and* the library contains multiple different versionless paths, that library is returned.
- Otherwise, nil is returned.
func Generate ¶
func Generate(ctx context.Context, cfg *config.Config, library *config.Library, srcs *sources.Sources) error
Generate generates a Python client library.
func ValidateNewAPIs ¶ added in v0.11.0
ValidateNewAPIs validates that new APIs can be added to an existing library. Currently this is just a check that there is a default version already, and that no existing APIs in the library have custom GAPIC options. Future checks may require details of the APIs being added.
Types ¶
This section is empty.