Plugins
Python
Plugin for Python projects
@bjb-forge/nx-python-project
Installation
npx @bjb-forge/cli add @bjb-forge/nx-python-projectPlugin Options
{
"plugin": "@bjb-forge/nx-python-project/nx-plugin",
"options": {}
}| Option | Type | Description |
|---|---|---|
build.targetName | string | The name of the build target |
generate.targetName | string | The name of the generate target |
test.targetName | string | The name of the test target |
lint.targetName | string | The name of the lint target |
serve.targetName | string | The name of the serve target |
Inferred Targets
build
Builds the Python project using uv build.
Condition: All Python projects with a pyproject.toml
generate
Generates OpenAPI code using openapi-generator-cli.
Condition: Python projects with a generator-config.yaml
test
Runs tests using uv run pytest.
Condition: All Python projects with a pyproject.toml
lint
Lints the Python project using uv run ruff check.
Condition: All Python projects with a pyproject.toml
serve
Runs the Python application using uv run python -m <module>.
Condition: Application projects (has [project.scripts])
nx-release-publish
Publishes the Python package to PyPI using uv publish.
Condition: All Python projects with a pyproject.toml
Generators
python-project
Generate a Python project structure.
nx g @bjb-forge/nx-python-project:python-project [options]| Option | Type | Required | Default | Description |
|---|---|---|---|---|
directory | string | Yes | - | A directory where the project is placed |
name | string | No | - | The name of the project. Defaults to the last segment of the directory |
workspace | boolean | No | true | Whether to add the project to a uv workspace. When true, creates or updates a root pyproject.toml with [tool.uv.workspace] |
nx g @bjb-forge/nx-python-project:python-project packages/my-app