Skip to main content

A simple dependency management tool and tasks executor for Python projects

Project description

A simple dependency management tool and tasks executor for Python projects

Installation

Make sure that you have a working Python >= 3.6 with pip and virtualenv installed and then execute

$ pip install caos

For information about the usage and how to contribute check the Documentation.

Usage Example

Here is an example of a web application's dependencies, tests, and execution being handle by caos.

Sample Project Structure:

my_project (Project's root Folder)
|___ caos.yml
|___ main.py
|___ tests
    |___ test.py

These are the commands used:

$ caos init                 # Initialize a Python virtual environment for the project
$ caos update               # Download the project dependencies
$ caos check                # Verify all the dependencies are installed
$ caos run test_and_start   # Execute the user defined task for testing and running the project 

This is the content of the caos.yml file presented in the example:

virtual_environment: "venv"

dependencies:
  pip: "latest"
  flask: "~1.1.0"

tasks:
  unittest:
    - "caos python -m unittest discover -v ./tests"

  start:
    - "caos python ./main.py"

  test_and_start:
    - unittest
    - start

This is the content of the main.py file presented in the example:

from flask import Flask
app = Flask(__name__)


@app.route('/')
def hello():
    return "Hello World!"

if __name__ == '__main__':
    app.run(host="127.0.0.1", port="8080")

This is the content of the test.py file presented in the example:

import unittest
from main import app

class TestApp(unittest.TestCase):

    def test_hello_world(self):
        self.app = app.test_client()
        response = self.app.get('/')
        self.assertEqual(200, response.status_code)
        self.assertIn(b'Hello World!', response.data)


if __name__ == '__main__':
    unittest.main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for caos, version 2.0.3
Filename, size File type Python version Upload date Hashes
Filename, size caos-2.0.3-py3-none-any.whl (87.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size caos-2.0.3.tar.gz (63.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page