python-sdk-dev
The Python SDK's development module.
Installation
dagger install github.com/shykes/dagger/sdk/python/dev@d26316bc7b9feed83a341d7a3c17ce2080948832
Entrypoint
Return Type
PythonSdkDev !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | Directory with sources |
container | Container | null | Base container |
Example
func (m *myModule) example() *PythonSdkDev {
return dag.
PythonSdkDev()
}
Types
PythonSdkDevDocs π
Manage the reference documentation (Sphinx).
build() π
Build the documentation.
Return Type
Directory !
Example
func (m *myModule) example() *Directory {
return dag.
PythonSdkDev().
Docs().
Build()
}
preview() π
Build and preview the documentation in the browser.
Return Type
Service !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
bind | Integer ! | 8000 | The port to bind the web preview for the built docs |
Example
func (m *myModule) example(bind int) *Service {
return dag.
PythonSdkDev().
Docs().
Preview(bind)
}
PythonSdkDevTestSuite π
Run the test suite.
default() π
Run python tests.
Return Type
Container !
Example
func (m *myModule) example() *Container {
return dag.
PythonSdkDev().
Test().
Default()
}
provision() π
Test provisioning.
This publishes a cli binary in an ephemeral http server and checks if the SDK can download, extract and run it.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
cliBin | File ! | - | Dagger binary to use for test |
runnerHost | String | null | _EXPERIMENTAL_DAGGER_RUNNER_HOST value |
Example
func (m *myModule) example(cliBin *File) *Container {
return dag.
PythonSdkDev().
Test().
Provision(cliBin)
}
run() π
Run the pytest command.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] ! | - | Arguments to pass to pytest |
Example
func (m *myModule) example(args []string) *Container {
return dag.
PythonSdkDev().
Test().
Run(args)
}
unit() π
Run unit tests.
Return Type
Container !
Example
func (m *myModule) example() *Container {
return dag.
PythonSdkDev().
Test().
Unit()
}
PythonSdkDev π
The Python SDK's development module.
container() π
Container to run commands in
Return Type
Container !
Example
func (m *myModule) example() *Container {
return dag.
PythonSdkDev().
Container()
}
build() π
Build the Python SDK client library package for distribution.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String ! | "0.0.0" | The version for the distribution package |
Example
func (m *myModule) example(version string) *Container {
return dag.
PythonSdkDev().
Build(version)
}
docs() π
Preview the reference documentation.
Return Type
PythonSdkDevDocs !
Example
func (m *myModule) example() *PythonSdkDevDocs {
return dag.
PythonSdkDev().
Docs()
}
format() π
Format source files.
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
paths | [String ! ] ! | [] | List of files or directories to check |
Example
func (m *myModule) example(paths []string) *Directory {
return dag.
PythonSdkDev().
Format(paths)
}
generate() π
Generate the client bindings for the API.
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
introspectionJson | File ! | - | Result of the introspection query |
Example
func (m *myModule) example(introspectionJson *File) *Directory {
return dag.
PythonSdkDev().
Generate(introspectionJson)
}
lint() π
Check for linting errors.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
paths | [String ! ] | null | List of files or directories to check |
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdkDev().
Lint(ctx)
}
publish() π
Publish Python SDK client library to PyPI.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret ! | - | The token for the upload |
version | String ! | "0.0.0" | The version for the distribution package to publish |
url | String ! | "" | The URL of the upload endpoint (empty means PyPI) |
Example
func (m *myModule) example(token *Secret, version string, url string) *Container {
return dag.
PythonSdkDev().
Publish(token, version, url)
}
supportedVersions() π
Supported Python versions.
Return Type
[String ! ] !
Example
func (m *myModule) example(ctx context.Context) []string {
return dag.
PythonSdkDev().
SupportedVersions(ctx)
}
test() π
Run the test suite.
Return Type
PythonSdkDevTestSuite !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | null | Python version to test against |
Example
func (m *myModule) example() *PythonSdkDevTestSuite {
return dag.
PythonSdkDev().
Test()
}
testPublish() π
Test the publishing of the Python SDK client library to TestPyPI.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret ! | - | TestPyPI token |
version | String ! | "0.0.0" | The version for the distribution package to publish |
Example
func (m *myModule) example(token *Secret, version string) *Container {
return dag.
PythonSdkDev().
TestPublish(token, version)
}
testVersions() π
Run the test suite for all supported versions.
Return Type
[PythonSdkDevTestSuite ! ] !
Example
func (m *myModule) example() []*PythonSdkDevTestSuite {
return dag.
PythonSdkDev().
TestVersions()
}
typecheck() π
Run the type checker (mypy).
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdkDev().
Typecheck(ctx)
}
withContainer() π
Replace container.
Return Type
PythonSdkDev !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ctr | Container ! | - | An OCI-compatible container, also known as a Docker container. |
Example
func (m *myModule) example(ctr *Container) *PythonSdkDev {
return dag.
PythonSdkDev().
WithContainer(ctr)
}
withDirectory() π
Mount a directory on the base container.
Return Type
PythonSdkDev !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | The directory to add |
Example
func (m *myModule) example(source *Directory) *PythonSdkDev {
return dag.
PythonSdkDev().
WithDirectory(source)
}