A tool for developing Node.js and Python projects
Project description
A tool for developing Node.js and Python projects
dotrun makes use of a Docker image to provide a predictable sandbox for running Node and Python projects.
Features:
- Make use of standard
package.jsonscript entrypoints:dotrunrunsyarn run startwithin the Docker containerdotrun foorunsyarn run foowithin the Docker container
- Detect changes in
package.jsonand only runyarn installwhen needed - Detect changes in
requirements.txtand only runpip3 installwhen needed - Run scripts using environment variables from
.envand.env.localfiles - Keep python dependencies in
.venvin the project folder for easy access
Usage
$ dotrun # Install dependencies and run the `start` script from package.json
$ dotrun clean # Delete `node_modules`, `.venv`, `.dotrun.json`, and run `yarn run clean`
$ dotrun install # Force install node and python dependencies
$ dotrun exec # Start a shell inside the dotrun environment
$ dotrun exec {command} # Run {command} inside the dotrun environment
$ dotrun {script-name} # Install dependencies and run `yarn run {script-name}`
$ dotrun -s {script} # Run {script} but skip installing dependencies
$ dotrun --env FOO=bar {script} # Run {script} with FOO environment variable
Installation
To install dotrun run:
sudo pip3 install dotrun
Requirements
- Linux / macOS
- Docker (Get Docker)
- Python > 3.6 and PIP
macOS performance
For optimal performance on Docker we recommend enabling a new experimental file sharing implementation called virtiofs. Virtiofs is only available to users of the following macOS versions:
- macOS 12.2 and above (for Apple Silicon)
- macOS 12.3 and above (for Intel)
Add dotrun on new projects
To fully support dotrun in a new project you should do the following:
- For Python projects, ensure Talisker is at
0.16.0or greater inrequirements.txt - Add
.dotrun.jsonand.venvto.gitignore - Create a
startscript inpackage.jsonto do everything needed to set up local development. E.g.:"start": "concurrently --raw 'yarn run watch' 'yarn run serve'"- The above command makes use of concurrently - you might want to consider this
- Older versions of Gunicorn are incompatible with strict confinement so we need Gunicorn >= 20
- The update landed in Talisker but at the time of writing hasn't made it into a new version
- If there's no new version of Talisker, simply add
gunicorn==20.0.4to the bottom ofrequirements.txt
However, once you're ready to completely switch over to dotrun, simply go ahead and remove the run script.
Automated tests of pull requests
The "PR" action builds the Python package and runs a project with dotrun. This will run against every pull request.
Publish
All the changes made to the main branch will be automatically published as a new version on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dotrun-2.0.2.tar.gz.
File metadata
- Download URL: dotrun-2.0.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a15d14dd405697810e381746d5c34d35baf65f27b13d242a5c2e0f041bbe5f7f
|
|
| MD5 |
917e468995ae7f440a2ab5805c939a6a
|
|
| BLAKE2b-256 |
6923fc863464688518fc18182ae447f5e273640bacaaeb623ebf324de7fe4244
|
File details
Details for the file dotrun-2.0.2-py3-none-any.whl.
File metadata
- Download URL: dotrun-2.0.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e6b91dca38e7ad3dfd77f594ef5a87b8403491a5911956ffa0670f17db12cde
|
|
| MD5 |
1a120c5b136778c769c4182a38fa2093
|
|
| BLAKE2b-256 |
0fe5d915bf148deebc2d6c12817f397669cdb5c6582eaa4df2fd96b8d2fa1bb4
|