Skip to main content

Speed up your coding by running a command on every saved change

Project description

DevWatch

Speed up your coding by running your program, test suite, linter, etc on every saved changes.

Build Status

Installation

$ pip install devwatch

System requirements

  • Linux >= 2.6.13
  • Python >= 3.2

Basic usage

  • Execute python main.py when main.py is modified

    $ devwatch -f 'main.py' -c 'python main.py'
    
  • Watch for changes on all .txt files inside dir and its subdirectories and execute cat on the modified file

    $ devwatch -f 'dir/**/*.txt' -c 'cat @'
    
  • Execute main target

    $ devwatch -t main
    
  • Execute the first defined target

    $ devwatch
    

Configuration file

Create .devwatchrc.yml on your project directory or home folder

Example configuration file

   main:
       files: main.py
       command: python main.py    
   tests:
       files: tests/
       command: pytest @
   flake:
       files: main.py
       command: flake8 test.py
  • Define targets (main, tests and flake in this example)

  • For every target define:

    • files: File or directory to watch

    • command: Command to execute when a file change is detected

  • When watching on directories like on target tests, you can use @ to reference the modified file. In this example, when file tests/foo.py is amended pytest tests/foo.py will be execute

  • Warning: if no files exists for the target, the program will exit.

Tested on

  • Ubuntu 20.04, 22.04 x64
  • Debian 11 x64
  • Centos 7 x84

TODO

  • Hot reload configuration file
  • FreeBSD/OpenBSD/NetBSD support
  • MacOS support

Project details


Download files

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

Source Distribution

devwatch-0.0.6.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devwatch-0.0.6-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file devwatch-0.0.6.tar.gz.

File metadata

  • Download URL: devwatch-0.0.6.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for devwatch-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ffde508561fe20b59e9a77cce45a609954e11183b0f372489122897ccfb7c345
MD5 14e30d1ab17fc3bd24c92edcf368b544
BLAKE2b-256 639bd2924bbd7431f293ef7774139e43a77232ce1cc2aa3bf82f18c66e4fd9f1

See more details on using hashes here.

File details

Details for the file devwatch-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: devwatch-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for devwatch-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9707f885944ddab1847835adc4b8ebe00b8cfce8c72feb6e2ee47648deb9fb40
MD5 868d3363d7f8a4e0d032c41f4212145f
BLAKE2b-256 d8756cadbc6005882d7f306c797e59ac4e9261dd2c766cf8f6dfa04a1d2603a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page