@dev-tales/nx-python
v0.3.2
Published
Nx Plugin for Python projects
Downloads
93
Readme
Nx plugin to generate and manage Python libraries and applications in a monorepo setup.
This plugin is heavily opinionated towards using uv as the build system for Python projects.
You can configure additional features like using flake8 for linting or pytest for testing.
Usage
Add the plugin to your Nx workspace:
nx add @dev-tales/nx-pythonGenerate a new Python library:
nx g @dev-tales/nx-python:lib libs/my-python-libNow you can run tests, lint, and build your library using the following commands:
nx test my-python-lib
nx lint my-python-lib
nx build my-python-libGenerate a new Python application:
nx g @dev-tales/nx-python:app apps/my-python-appBy default the application just prints a hello-world message from main.py. Pass
--framework=fastapi to scaffold a FastAPI app with a GET /hello
endpoint instead. Applications get the same test/lint/build targets as libraries, plus a
serve target to actually run them:
nx serve my-python-app