Metadata-Version: 2.1
Name: projen_practical_constructs
Version: 0.0.0
Summary: Constructs and utilities for managing projects (Python, NodeJS etc) with Projen enforcing solid build, test and linting structures
Home-page: https://github.com/flaviostutz/projen-practical-constructs.git
Author: Flavio Stutz<flaviostutz@gmail.com>
License: MIT
Project-URL: Source, https://github.com/flaviostutz/projen-practical-constructs.git
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved
Requires-Python: ~=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: constructs<11.0.0,>=10.4.2
Requires-Dist: jsii<2.0.0,>=1.110.0
Requires-Dist: projen<0.92.0,>=0.91.13
Requires-Dist: publication>=0.0.3
Requires-Dist: typeguard<4.3.0,>=2.13.3

# projen-practical-constructs

Constructs and utilities for managing projects with Projen enforcing solid build, test and linting structures.

This repo have additional Constructs not present in [official projen repo](https://github.com/projen/projen) such as RUFF, Makefile etc.

Currently there is support for Python projects, but in the future more will be added.

Check in /examples folder the target structure that these project types will produce.

## For Python project types

Project type name: python_basic

The basic stack supported by this project is:

* Makefile: scripts management
* pip: virtual environments management
* Mypy: code Type check
* RUFF: code formatting and linting
* pytest + coverage: test management
* pip-audit: dependencies vulnerability checks
* pip-tools: dependencies lock file generation (contrainsts.txt)
* vs-code plugins: code editor feedback

[This project](https://github.com/flaviostutz/monorepo-spikes/tree/main/shared/python/hello_world_reference) was used as reference for the target project structure created by this projen project type.

## Usage

```sh
npx projen new --from projen_practical_constructs python_basic
```

The constructs can be used separately to adapt to your specific needs, but you can use the PythonProject construct with a default configuration of the entire stack to easily have a full project structure with build, test and linting capabilities.

## Development

### Tests

* We use a lot of snapshots on our tests, which in general is not a good practice. But in our case we decided to use it because there are lots of files and the snapshots will check if the file contents were changed.
* Be careful checking manually the errors on snapshots before updating them to be sure that it's not a breaking change to the users of the library

### JSII

* The options of the constructs have to be "interface", not "types" because they are exposed to JSII and it works well only with interfaces
* The Project type must have an attribute with name "options" in constructor
* https://aws.github.io/jsii/specification/2-type-system/

### References

* Projen quick start: https://projen.io/docs/quick-starts/python/hello-world/
* https://projen.io/docs/concepts/projects/building-your-own/
* Sample code for Python contructs: https://github.com/projen/projen/blob/main/src/python/pip.ts
* https://kennethwinner.com/2021/03/07/projen-external-module-github/
* Example project of a Python Projen Type: https://github.com/kcwinner/projen-github-demo
