Projen
raw JSON → 0.99.52 verified Fri May 01 auth: no python
Projen is a CDK (Cloud Development Kit) for software projects, allowing you to define and manage project configurations (e.g., build scripts, dependencies, CI/CD) using code. Version 0.99.52, with active development and regular releases.
pip install projen Common errors
error ModuleNotFoundError: No module named 'projen' ↓
cause Projen not installed in the current Python environment.
fix
Run
pip install projen error TypeError: Project.__init__() takes 1 positional argument but 2 were given ↓
cause Passing `name` as a positional argument in projen 0.80+.
fix
Use keyword argument:
Project(name="my-project") error AttributeError: module 'projen' has no attribute 'TypeScriptProject' ↓
cause Importing from wrong submodule or using outdated import path.
fix
Use
from projen.typescript import TypeScriptProject Warnings
breaking In projen 0.80+, the `Project` class no longer accepts `name` as a positional argument; it must be a keyword argument. ↓
fix Use `Project(name="my-project")` instead of `Project("my-project")`.
deprecated The `TypeScriptProject` option `jest` is deprecated; use `jestOptions` instead. ↓
fix Replace `jest=True` with `jestOptions=JestOptions(...)`
gotcha Projen uses `~=3.9` for Python requirement, which means Python 3.9 exactly. Using Python 3.10+ may cause unexpected issues. ↓
fix Use Python 3.9 in your environment, or check for compatibility with newer versions.
gotcha The `synth()` method is required to generate project files; forgetting to call it results in an empty directory. ↓
fix Always call `project.synth()` after configuration.
Imports
- Project
from projen import Project - TypeScriptProject
from projen.typescript import TypeScriptProject - PythonProject
from projen.python import PythonProject
Quickstart
from projen import Project
project = Project(
name="my-project",
project_type="library",
python_executable="python3",
)
project.synth()