Name | pyprojen JSON |
Version |
0.0.4
JSON |
| download |
home_page | None |
Summary | Minimal, spiritual fork of projen. No JSII. Python focused. |
upload_time | 2024-09-30 08:47:03 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT |
keywords |
one
two
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<img src="https://raw.githubusercontent.com/mlops-club/pyprojen/c5b6755a803f7c6f18a42b7cea6f9eb9c917c417/logo.png">
<h3 align="center">pyprojen</h3>
</p>
<p align="center">
A minimal, Python-centric port of <a href="https://projen.io/">projen</a>.
</p>
<p align="center">
<a href="https://opensource.org/licenses/Apache-2.0">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge&logo=apache" alt="Apache 2.0 License">
</a>
<!-- <a href="https://gitpod.io/#https://github.com/mlops-club/pyprojen">
<img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?style=for-the-badge&logo=gitpod" alt="Gitpod ready-to-code">
</a> -->
<a href="https://github.com/mlops-club/pyprojen/commits/main">
<img src="https://img.shields.io/github/commit-activity/w/projen/projen?style=for-the-badge&logo=github" alt="Commit activity">
</a>
<a href="https://www.youtube.com/watch?v=SOWMPzXtTCw">
<img src="https://img.shields.io/badge/Projen%20debut%20demo-red?style=for-the-badge&logo=youtube" alt="Projen debut demo">
</a>
</p>
<br/>
## Overview
Project templates are great... except that they promote "code duplication at scale" and all the technical debt that come with that.
[`projen`](https://projen.io/) (the tool this project is based on) represents a new generation of project template tools. `projen` helps you manage the "day 2 problem" for project templates, to avoid "template drift".
`projen` also helps you treat project configuration as an abstraction, whose implementation details can be changed/improved, without disrupting the developer workflow. Elad Ben-Israel, creator of `projen`, `AWS CDK`, and Winglang gave a [talk on this at CDK day 2020](https://www.youtube.com/watch?v=SOWMPzXtTCw).
1. ⚡️ **Agility.** Centrally push unit-tested updates to all existing projects created from your templates in *minutes, not months*.
2. 🧱 **Modularity.** Define composable, parameterized "components" that you can add/remove from your project as needed.
## Real Examples
`pyprojen` is a minimal port of `projen`'s core functionality to Python.
Specifically, it gets you
1. ⚡️ **Agility**
- **Examples:**
- 10x the speed of CI for all repos overnight by making CI steps run in parallel instead of serially
- Update a team linting rule in `pyproject.toml`, `ruff.toml`, etc.
- Add auth steps to publish to or install from a private PyPI registry in CI or `Dockerfile`s
- Completely change CI systems with minimal disruption, e.g. switch from Bitbucket Pipelines to GitHub Actions to AWS CodeBuild and back
2. 🧱 **Modularity**
- **Examples**:
1. define an opinionated `PythonPackage` component, and
1. layer on top a
- `FastAPIApp`,
- `StreamlitApp`,
- `CdkApp`,
- `PulumiApp`,
- `AirflowDag`,
- `DagsterDag`,
- `BentoMLService`,
- `AwsLambdaPythonFunction`,
- etc.
1. Add (or remove) as many of these to your repo as you like, whenever you like, and find these packages instantly set up with CI, linting, formatting, tests, packaging, publishing, deploying, etc.
- For example, you might incrementally develop a "mini data science app monorepo" with
1. a `MetaflowDag` that trains a model
1. served in a `FastAPI` app
1. which you can interact with via a `Streamlit` app
1. both of which are deployed by an `AwdCdk` app
- all of these components would ideally be instantly set up with CI, linting, formatting, testing, packaging, publishing, deployment, etc. the moment they are added. And "un set up" with those if they are removed.
## Q&A
> ### How does `(py)projen` compare to `copier` or `cookiecutter`?
<details>
<summary>Click to expand</summary>
[`copier`](https://copier.readthedocs.io/en/stable/) is a reaction to `cookiecutter`, built to allow template updates to be propagated to existing projects.
1. **Migration.** The migration process for `(py)projen` is a single CLI command (`python .pyprojenrc.py`). Whereas the migration process for `copier` is [a bit more manual](https://copier.readthedocs.io/en/stable/updating/#how-the-update-works) and prone to errors.
2. **Composable components.** `copier` is more like `cookiecutter` in that it uses Jinja templates to generate a certain set of files. `(py)projen` lets you define re-usable components. You can add arbitrary numbers of these components to your project with different parameters and remove them just as easily.
That said, although `cookiecutter` and `copier` are more limited, they are also simpler.
</details>
> ### What is the difference between `pyprojen` and `projen`?
<details>
<summary>Click to expand</summary>
#### 1. Fundamentally, `projen` offers a few things:
1. A `Project`, `Component`, and `Construct` abstraction that lets you define reusable components that you can push updates to.
2. Primitive components like `TextFile`, `YamlFile`, `JsonFile`, `MarkdownFile`, etc. that you can compose to build "higher-level components".
3. A library of opinionated, higher-level components like `PythonProject`, `TypescriptProject`, `DockerCompose`, `GithubWorkflow`, ...
4. An opinionated "task runner" system (think `Makefile/Justfile`, `poetry` scripts, etc.) to define project-related commands.
5. A `projen new` command which creates the initial `.projenrc.py` config file for your project
#### 2. `pyprojen` implements [1] and [2] from the list above (the unopinionated parts).
It is up to you to create your own components with your own opinions on things like
- when, if, and how to manage virtual environments, e.g. `uv`, `pip`, `conda`, etc.
- which linter/formatter to use, e.g. `ruff`, `pre-commit`, etc.
- how to structure single- and multi-package repos (monorepos) and CI for them
Coming from tools like `cookiecutter` or `copier`, many people/teams prefer than using off-the-shelf templates or components.
#### 3. `pyprojen` is not a drop-in replacement for `projen`, but it tries to get close.
If you write components in Python using `pyprojen`, it should be easy to move them over to the `projen` Python bindings if you decide to.
</details>
> ### Should I use `pyprojen` or `projen`?
<details>
<summary>Click to expand</summary>
**TL;DR** Bias towards `projen`, unless you
1. Want a Python-first dev experience, and
2. Prefer to fully-define your own project template/components rather than using projen's existing project templates, higher-level components, or task runner system
`projen` is a larger project and is primarily maintained by developers at AWS. `projen`,
But to develop with `projen`, you either need to write TypeScript, or use generated Python bindings that invoke TypeScript.
If you are familiar with writing AWS CDK in Python, developing with `projen` in Python is a similar experience, because they both use Python bindings generated from TypeScript using the [JSII](https://github.com/aws/jsii) project.
This means:
1. Not all internals of the original TS/JS code is exposed in the TS bindings, e.g. private attributes. You can unexectedly hit dead ends when attributes or methods that are available in TS are simply not available in Python.
2. Step debugging is limited. The bindings are thin wrappers around a tool that invokes the original TypeScript/JavaScript code
3. Errors raised by python bindings are cryptic and difficult to parse.
4. Autocompletion is poor
5. You need to have NodeJS installed on your system and in CI
6. The JSII is a bit slow. (seconds not milliseconds)
> 📌 Since `projen`'s Python bindings and `pyprojen` have a nearly identical API, you could switch to `projen` if you want to join the larger TypeScript-based ecosystem.
</details>
## Quick start (TODO)
> [!NOTE]
> Until this section is filled out, you can refer to [this repo](https://github.com/phitoduck/phito-projen) to get a sense of what projen can do. And the official [projen docs](https://projen.io/) contain many of the same concepts that this port uses.
```bash
pip install pyprojen
```
```python
from pyprojen import ...
```
## Developing/Contributing
### System requirements
You will need the following installed on your machine to develop on this codebase
- `make` AKA `cmake`, e.g. `sudo apt-get update -y; sudo apt-get install cmake -y`
- Python 3.7+, ideally using `pyenv` to easily change between Python versions
- `git`
###
```bash
# clone the repo
git clone https://github.com/<your github username>/pyprojen.git
# install the dev dependencies
make install
# run the tests
make test
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pyprojen",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "one, two",
"author": null,
"author_email": "\"<your name>\" <some-email@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d5/c1/902ceca28ee98bd9a98cf226f3882d60672030d89e735ae6d2331c61394b/pyprojen-0.0.4.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/mlops-club/pyprojen/c5b6755a803f7c6f18a42b7cea6f9eb9c917c417/logo.png\">\n <h3 align=\"center\">pyprojen</h3>\n</p>\n\n<p align=\"center\">\n A minimal, Python-centric port of <a href=\"https://projen.io/\">projen</a>.\n</p>\n\n<p align=\"center\">\n <a href=\"https://opensource.org/licenses/Apache-2.0\">\n <img src=\"https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge&logo=apache\" alt=\"Apache 2.0 License\">\n </a>\n <!-- <a href=\"https://gitpod.io/#https://github.com/mlops-club/pyprojen\">\n <img src=\"https://img.shields.io/badge/Gitpod-ready--to--code-blue?style=for-the-badge&logo=gitpod\" alt=\"Gitpod ready-to-code\">\n </a> -->\n <a href=\"https://github.com/mlops-club/pyprojen/commits/main\">\n <img src=\"https://img.shields.io/github/commit-activity/w/projen/projen?style=for-the-badge&logo=github\" alt=\"Commit activity\">\n </a>\n <a href=\"https://www.youtube.com/watch?v=SOWMPzXtTCw\">\n <img src=\"https://img.shields.io/badge/Projen%20debut%20demo-red?style=for-the-badge&logo=youtube\" alt=\"Projen debut demo\">\n </a>\n</p>\n\n<br/>\n\n## Overview\n\nProject templates are great... except that they promote \"code duplication at scale\" and all the technical debt that come with that.\n\n[`projen`](https://projen.io/) (the tool this project is based on) represents a new generation of project template tools. `projen` helps you manage the \"day 2 problem\" for project templates, to avoid \"template drift\".\n\n`projen` also helps you treat project configuration as an abstraction, whose implementation details can be changed/improved, without disrupting the developer workflow. Elad Ben-Israel, creator of `projen`, `AWS CDK`, and Winglang gave a [talk on this at CDK day 2020](https://www.youtube.com/watch?v=SOWMPzXtTCw).\n\n1. \u26a1\ufe0f **Agility.** Centrally push unit-tested updates to all existing projects created from your templates in *minutes, not months*.\n2. \ud83e\uddf1 **Modularity.** Define composable, parameterized \"components\" that you can add/remove from your project as needed.\n\n## Real Examples\n\n`pyprojen` is a minimal port of `projen`'s core functionality to Python.\n\nSpecifically, it gets you\n\n1. \u26a1\ufe0f **Agility**\n\n - **Examples:**\n - 10x the speed of CI for all repos overnight by making CI steps run in parallel instead of serially\n - Update a team linting rule in `pyproject.toml`, `ruff.toml`, etc.\n - Add auth steps to publish to or install from a private PyPI registry in CI or `Dockerfile`s\n - Completely change CI systems with minimal disruption, e.g. switch from Bitbucket Pipelines to GitHub Actions to AWS CodeBuild and back\n\n2. \ud83e\uddf1 **Modularity**\n\n - **Examples**:\n 1. define an opinionated `PythonPackage` component, and\n 1. layer on top a\n - `FastAPIApp`,\n - `StreamlitApp`,\n - `CdkApp`,\n - `PulumiApp`,\n - `AirflowDag`,\n - `DagsterDag`,\n - `BentoMLService`,\n - `AwsLambdaPythonFunction`,\n - etc.\n 1. Add (or remove) as many of these to your repo as you like, whenever you like, and find these packages instantly set up with CI, linting, formatting, tests, packaging, publishing, deploying, etc.\n - For example, you might incrementally develop a \"mini data science app monorepo\" with\n 1. a `MetaflowDag` that trains a model\n 1. served in a `FastAPI` app\n 1. which you can interact with via a `Streamlit` app\n 1. both of which are deployed by an `AwdCdk` app\n - all of these components would ideally be instantly set up with CI, linting, formatting, testing, packaging, publishing, deployment, etc. the moment they are added. And \"un set up\" with those if they are removed.\n\n## Q&A\n\n> ### How does `(py)projen` compare to `copier` or `cookiecutter`?\n\n<details>\n<summary>Click to expand</summary>\n\n[`copier`](https://copier.readthedocs.io/en/stable/) is a reaction to `cookiecutter`, built to allow template updates to be propagated to existing projects.\n\n1. **Migration.** The migration process for `(py)projen` is a single CLI command (`python .pyprojenrc.py`). Whereas the migration process for `copier` is [a bit more manual](https://copier.readthedocs.io/en/stable/updating/#how-the-update-works) and prone to errors.\n\n2. **Composable components.** `copier` is more like `cookiecutter` in that it uses Jinja templates to generate a certain set of files. `(py)projen` lets you define re-usable components. You can add arbitrary numbers of these components to your project with different parameters and remove them just as easily.\n\nThat said, although `cookiecutter` and `copier` are more limited, they are also simpler.\n</details>\n\n> ### What is the difference between `pyprojen` and `projen`?\n\n<details>\n<summary>Click to expand</summary>\n\n#### 1. Fundamentally, `projen` offers a few things:\n\n1. A `Project`, `Component`, and `Construct` abstraction that lets you define reusable components that you can push updates to.\n2. Primitive components like `TextFile`, `YamlFile`, `JsonFile`, `MarkdownFile`, etc. that you can compose to build \"higher-level components\".\n3. A library of opinionated, higher-level components like `PythonProject`, `TypescriptProject`, `DockerCompose`, `GithubWorkflow`, ...\n4. An opinionated \"task runner\" system (think `Makefile/Justfile`, `poetry` scripts, etc.) to define project-related commands.\n5. A `projen new` command which creates the initial `.projenrc.py` config file for your project\n\n#### 2. `pyprojen` implements [1] and [2] from the list above (the unopinionated parts).\n\nIt is up to you to create your own components with your own opinions on things like\n\n- when, if, and how to manage virtual environments, e.g. `uv`, `pip`, `conda`, etc.\n- which linter/formatter to use, e.g. `ruff`, `pre-commit`, etc.\n- how to structure single- and multi-package repos (monorepos) and CI for them\n\nComing from tools like `cookiecutter` or `copier`, many people/teams prefer than using off-the-shelf templates or components.\n\n#### 3. `pyprojen` is not a drop-in replacement for `projen`, but it tries to get close.\n\nIf you write components in Python using `pyprojen`, it should be easy to move them over to the `projen` Python bindings if you decide to.\n</details>\n\n> ### Should I use `pyprojen` or `projen`?\n\n<details>\n<summary>Click to expand</summary>\n\n**TL;DR** Bias towards `projen`, unless you\n\n1. Want a Python-first dev experience, and\n2. Prefer to fully-define your own project template/components rather than using projen's existing project templates, higher-level components, or task runner system\n\n`projen` is a larger project and is primarily maintained by developers at AWS. `projen`,\n\nBut to develop with `projen`, you either need to write TypeScript, or use generated Python bindings that invoke TypeScript.\n\nIf you are familiar with writing AWS CDK in Python, developing with `projen` in Python is a similar experience, because they both use Python bindings generated from TypeScript using the [JSII](https://github.com/aws/jsii) project.\n\nThis means:\n\n1. Not all internals of the original TS/JS code is exposed in the TS bindings, e.g. private attributes. You can unexectedly hit dead ends when attributes or methods that are available in TS are simply not available in Python.\n2. Step debugging is limited. The bindings are thin wrappers around a tool that invokes the original TypeScript/JavaScript code\n3. Errors raised by python bindings are cryptic and difficult to parse.\n4. Autocompletion is poor\n5. You need to have NodeJS installed on your system and in CI\n6. The JSII is a bit slow. (seconds not milliseconds)\n\n> \ud83d\udccc Since `projen`'s Python bindings and `pyprojen` have a nearly identical API, you could switch to `projen` if you want to join the larger TypeScript-based ecosystem.\n\n</details>\n\n## Quick start (TODO)\n\n> [!NOTE]\n> Until this section is filled out, you can refer to [this repo](https://github.com/phitoduck/phito-projen) to get a sense of what projen can do. And the official [projen docs](https://projen.io/) contain many of the same concepts that this port uses.\n\n```bash\npip install pyprojen\n```\n\n```python\nfrom pyprojen import ...\n```\n\n## Developing/Contributing\n\n### System requirements\n\nYou will need the following installed on your machine to develop on this codebase\n\n- `make` AKA `cmake`, e.g. `sudo apt-get update -y; sudo apt-get install cmake -y`\n- Python 3.7+, ideally using `pyenv` to easily change between Python versions\n- `git`\n\n###\n\n```bash\n# clone the repo\ngit clone https://github.com/<your github username>/pyprojen.git\n\n# install the dev dependencies\nmake install\n\n# run the tests\nmake test\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Minimal, spiritual fork of projen. No JSII. Python focused.",
"version": "0.0.4",
"project_urls": null,
"split_keywords": [
"one",
" two"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8e7641d071711cd6a276fcde5230bfefa053d8ba92910b549c162ab84b6bedb7",
"md5": "8e336339bb2f6ed4a82416faaae49b70",
"sha256": "fd676f2dbefa260ea2d89ec49e820862f8eca81a2bcff3c10fbcb61cc3006d23"
},
"downloads": -1,
"filename": "pyprojen-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e336339bb2f6ed4a82416faaae49b70",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 29740,
"upload_time": "2024-09-30T08:47:02",
"upload_time_iso_8601": "2024-09-30T08:47:02.286181Z",
"url": "https://files.pythonhosted.org/packages/8e/76/41d071711cd6a276fcde5230bfefa053d8ba92910b549c162ab84b6bedb7/pyprojen-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d5c1902ceca28ee98bd9a98cf226f3882d60672030d89e735ae6d2331c61394b",
"md5": "3ff8b939a63f6076aedde9d535fbf7e6",
"sha256": "bf6de0a82958f7ca07447a234dee2e8987134362b3551681c6f74c33cecb29d1"
},
"downloads": -1,
"filename": "pyprojen-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "3ff8b939a63f6076aedde9d535fbf7e6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 27040,
"upload_time": "2024-09-30T08:47:03",
"upload_time_iso_8601": "2024-09-30T08:47:03.697208Z",
"url": "https://files.pythonhosted.org/packages/d5/c1/902ceca28ee98bd9a98cf226f3882d60672030d89e735ae6d2331c61394b/pyprojen-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-30 08:47:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyprojen"
}