Git Product home page Git Product logo

hupper's Introduction

hupper

https://github.com/Pylons/hupper/workflows/Build/test%20on%20Linux/badge.svg?branch=master https://github.com/Pylons/hupper/workflows/Build/test%20on%20MacOS/badge.svg?branch=master https://github.com/Pylons/hupper/workflows/Build/test%20on%20Windows/badge.svg?branch=master Documentation Status

hupper is an integrated process monitor that will track changes to any imported Python files in sys.modules as well as custom paths. When files are changed the process is restarted.

Command-line Usage

Hupper can load any Python code similar to python -m <module> by using the hupper -m <module> program.

$ hupper -m myapp
Starting monitor for PID 23982.

API Usage

Start by defining an entry point for your process. This must be an importable path in string format. For example, myapp.scripts.serve.main.

# myapp/scripts/serve.py

import sys
import hupper
import waitress


def wsgi_app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/plain')])
    yield b'hello'


def main(args=sys.argv[1:]):
    if '--reload' in args:
        # start_reloader will only return in a monitored subprocess
        reloader = hupper.start_reloader('myapp.scripts.serve.main')

        # monitor an extra file
        reloader.watch_files(['foo.ini'])

    waitress.serve(wsgi_app)

Acknowledgments

hupper is inspired by initial work done by Carl J Meyer and David Glick during a Pycon sprint and is built to be a more robust and generic version of Ian Bicking's excellent PasteScript paste serve --reload and Pyramid's pserve --reload.

hupper's People

Contributors

bertjwregeer avatar dstufft avatar ericatkin avatar icemac avatar j-carl avatar mmerickel avatar nphilipp avatar toxadx avatar tseaver avatar yohanboniface avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.