dotrun


Namedotrun JSON
Version 2.2.0 PyPI version JSON
download
home_page
SummaryA tool for developing Node.js and Python projects
upload_time2023-08-10 08:57:43
maintainer
docs_urlNone
authorCanonical Web Team
requires_python>=3.6,<4.0
licenseLGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://assets.ubuntu.com/v1/14a3bac5-dotrun.svg?w=200" width="200" alt="dotrun" />

# A tool for developing Node.js and Python projects

`dotrun` makes use of a [Docker image](https://github.com/canonical/dotrun-image/) to provide a predictable sandbox for running Node and Python projects.

Features:

- Make use of standard `package.json` script entrypoints:
  - `dotrun` runs `yarn run start` within the Docker container
  - `dotrun foo` runs `yarn run foo` within the Docker container
- Detect changes in `package.json` and only run `yarn install` when needed
- Detect changes in `requirements.txt` and only run `pip3 install` when needed
- Run scripts using environment variables from `.env` and `.env.local` files
- Keep python dependencies in `.venv` in the project folder for easy access

## Usage

```bash
$ dotrun          # Install dependencies and run the `start` script from package.json
$ dotrun serve    # Run the python app only
$ 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
$ dotrun -m "/path/to/mount":"localname"       # Mount additional directory and run `dotrun`
$ dotrun serve -m "/path/to/mount":"localname" # Mount additional directory and run `dotrun serve`
```

## Installation

### Docker

First, install Docker ([Get Docker](https://docs.docker.com/get-docker/)).

Linux users may also need to follow the [post install instructions](https://docs.docker.com/engine/install/linux-postinstall/) to be able to run Docker as a non-root user.

### Linux

To install dotrun run:

```
sudo apt install python3-pip
sudo pip3 install dotrun
```

### Mac

To install dotrun on a mac you will need [Homebrew](https://brew.sh/) (follow
the install
instructions on that page).

Then run:

```
brew install python3
sudo pip3 install dotrun
```

### Requirements

- Linux / macOS
- Docker ([Get Docker](https://docs.docker.com/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)

[How to enable virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/)

## Add dotrun on new projects

To fully support dotrun in a new project you should do the following:

- For Python projects, ensure [Talisker](https://pypi.org/project/talisker/) is at `0.16.0` or greater in `requirements.txt`
- Add `.dotrun.json` and `.venv` to `.gitignore`
- Create a `start` script in `package.json` to 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](https://www.npmjs.com/package/concurrently) - you might want to consider this
- Older versions of Gunicorn [are incompatible with](https://forum.snapcraft.io/t/problems-packaging-app-that-uses-gunicorn/11749) strict confinement so we need Gunicorn >= 20
  - The update [landed in Talisker](https://github.com/canonical-ols/talisker/pull/502) 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.4` to the bottom of `requirements.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](.github/workflows/pr.yaml) 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.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "dotrun",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Canonical Web Team",
    "author_email": "webteam@canonical.com",
    "download_url": "https://files.pythonhosted.org/packages/24/2e/ea436a9784e1b4a448538df1b796e2cf7d2f84e7506e8beafb603f4668c0/dotrun-2.2.0.tar.gz",
    "platform": null,
    "description": "<img src=\"https://assets.ubuntu.com/v1/14a3bac5-dotrun.svg?w=200\" width=\"200\" alt=\"dotrun\" />\n\n# A tool for developing Node.js and Python projects\n\n`dotrun` makes use of a [Docker image](https://github.com/canonical/dotrun-image/) to provide a predictable sandbox for running Node and Python projects.\n\nFeatures:\n\n- Make use of standard `package.json` script entrypoints:\n  - `dotrun` runs `yarn run start` within the Docker container\n  - `dotrun foo` runs `yarn run foo` within the Docker container\n- Detect changes in `package.json` and only run `yarn install` when needed\n- Detect changes in `requirements.txt` and only run `pip3 install` when needed\n- Run scripts using environment variables from `.env` and `.env.local` files\n- Keep python dependencies in `.venv` in the project folder for easy access\n\n## Usage\n\n```bash\n$ dotrun          # Install dependencies and run the `start` script from package.json\n$ dotrun serve    # Run the python app only\n$ dotrun clean    # Delete `node_modules`, `.venv`, `.dotrun.json`, and run `yarn run clean`\n$ dotrun install  # Force install node and python dependencies\n$ dotrun exec     # Start a shell inside the dotrun environment\n$ dotrun exec {command}          # Run {command} inside the dotrun environment\n$ dotrun {script-name}           # Install dependencies and run `yarn run {script-name}`\n$ dotrun -s {script}             # Run {script} but skip installing dependencies\n$ dotrun --env FOO=bar {script}  # Run {script} with FOO environment variable\n$ dotrun -m \"/path/to/mount\":\"localname\"       # Mount additional directory and run `dotrun`\n$ dotrun serve -m \"/path/to/mount\":\"localname\" # Mount additional directory and run `dotrun serve`\n```\n\n## Installation\n\n### Docker\n\nFirst, install Docker ([Get Docker](https://docs.docker.com/get-docker/)).\n\nLinux users may also need to follow the [post install instructions](https://docs.docker.com/engine/install/linux-postinstall/) to be able to run Docker as a non-root user.\n\n### Linux\n\nTo install dotrun run:\n\n```\nsudo apt install python3-pip\nsudo pip3 install dotrun\n```\n\n### Mac\n\nTo install dotrun on a mac you will need [Homebrew](https://brew.sh/) (follow\nthe install\ninstructions on that page).\n\nThen run:\n\n```\nbrew install python3\nsudo pip3 install dotrun\n```\n\n### Requirements\n\n- Linux / macOS\n- Docker ([Get Docker](https://docs.docker.com/get-docker/))\n- Python > 3.6 and PIP\n\n### macOS performance\n\nFor 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:\n\n- macOS 12.2 and above (for Apple Silicon)\n- macOS 12.3 and above (for Intel)\n\n[How to enable virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/)\n\n## Add dotrun on new projects\n\nTo fully support dotrun in a new project you should do the following:\n\n- For Python projects, ensure [Talisker](https://pypi.org/project/talisker/) is at `0.16.0` or greater in `requirements.txt`\n- Add `.dotrun.json` and `.venv` to `.gitignore`\n- Create a `start` script in `package.json` to do everything needed to set up local development. E.g.:\n  `\"start\": \"concurrently --raw 'yarn run watch' 'yarn run serve'\"`\n  - The above command makes use of [concurrently](https://www.npmjs.com/package/concurrently) - you might want to consider this\n- Older versions of Gunicorn [are incompatible with](https://forum.snapcraft.io/t/problems-packaging-app-that-uses-gunicorn/11749) strict confinement so we need Gunicorn >= 20\n  - The update [landed in Talisker](https://github.com/canonical-ols/talisker/pull/502) but at the time of writing hasn't made it into a new version\n  - If there's no new version of Talisker, simply add `gunicorn==20.0.4` to the bottom of `requirements.txt`\n\nHowever, once you're ready to completely switch over to `dotrun`, simply go ahead and remove the `run` script.\n\n### Automated tests of pull requests\n\n[The \"PR\" action](.github/workflows/pr.yaml) builds the Python package and runs a project with dotrun. This will run against every pull request.\n\n### Publish\n\nAll the changes made to the main branch will be automatically published as a new version on PyPI.\n\n",
    "bugtrack_url": null,
    "license": "LGPL-3.0",
    "summary": "A tool for developing Node.js and Python projects",
    "version": "2.2.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47c126f72e40cbd6226b28a2ea8428125f067c3ae192636e812def55e5937494",
                "md5": "a13c6efaf95b7516b5dd03c57e9e55e8",
                "sha256": "0507b02a35a5cb6b0f52106cde4e3eea52a1c9aab33b17e0b79174ec68f75e44"
            },
            "downloads": -1,
            "filename": "dotrun-2.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a13c6efaf95b7516b5dd03c57e9e55e8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 5126,
            "upload_time": "2023-08-10T08:57:42",
            "upload_time_iso_8601": "2023-08-10T08:57:42.039130Z",
            "url": "https://files.pythonhosted.org/packages/47/c1/26f72e40cbd6226b28a2ea8428125f067c3ae192636e812def55e5937494/dotrun-2.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "242eea436a9784e1b4a448538df1b796e2cf7d2f84e7506e8beafb603f4668c0",
                "md5": "ef917edc9cdb8a1c07cd415fe3a11db5",
                "sha256": "e83b87062865ddcc9039779bba679938c9ab073fb627ccf5a77d5ac38530d63e"
            },
            "downloads": -1,
            "filename": "dotrun-2.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ef917edc9cdb8a1c07cd415fe3a11db5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 4551,
            "upload_time": "2023-08-10T08:57:43",
            "upload_time_iso_8601": "2023-08-10T08:57:43.435461Z",
            "url": "https://files.pythonhosted.org/packages/24/2e/ea436a9784e1b4a448538df1b796e2cf7d2f84e7506e8beafb603f4668c0/dotrun-2.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-10 08:57:43",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dotrun"
}
        
Elapsed time: 0.09343s