Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmuller/pants-example-monorepo
https://github.com/pmuller/pants-example-monorepo
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmuller/pants-example-monorepo
- Owner: pmuller
- Created: 2022-09-29T20:57:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-05T20:34:24.000Z (over 2 years ago)
- Last Synced: 2024-11-24T01:27:50.773Z (about 2 months ago)
- Language: Shell
- Size: 67.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example Python monorepo using Pants
This is a sample Python monorepo I use to learn how to use Pants.
## Generate IDE configuration
Must be ran every time a new package is added.
```shell
$ ./scripts/setup-pants-ide-env.sh
Exporting virtualenvs...
Generating .env file...
Generating .vscode/settings.json file...
```Configuration validated with VSCode.
TODO: Check if it also works in vim with [dotenv.vim](https://github.com/tpope/vim-dotenv).
## Update requirements lock file
Must be ran every time a dependency is added/modified/removed.
```shell
$ ./pants generate-lockfiles
18:32:51.53 [INFO] Initializing scheduler...
18:32:51.71 [INFO] Scheduler initialized.
18:32:52.87 [INFO] Completed: Generate lockfile for python-default
18:32:52.87 [INFO] Wrote lockfile for the resolve `python-default` to 3rdparty/python/default.lock
```## Run all tests
```shell
./pants test ::
```## Run linters
```shell
./pants lint ::
```## Run type checker
```shell
./pants check ::
```## Run REPL
```shell
./pants repl ::
```## Build packages
```shell
./pants package ::
```### Run bundled CLI package
```shell
$ ./dist/packages.hello.src.hello/hello.pex foo
Hello foo
```