Background Story I have a python project which uses setuptools for building the source distribution. Pylint is integrated for running tests. And I come from a heavy NodeJs background.
Problem After doing changes to the code, I have several steps which should be run before distributing the application.
- Run tests
- Run pylint
- Clean build/dist directories
- Build source distribution using setuptools and distutils
- etc etc etc
And some other requirements like,
- Install packages using
pip install -r requirements.txt
- Activate virtualenv
- Trigger pre-commit & pre-push git hooks (Not yet implemented)
In NodeJs projects, I can write a set of shell commands with pre and post subscripts in the package.json file which does the job in a real nice way.
Currently for the python project, I am using a shell script which executes the required steps in required order. One other option I thought of was having a package.json just for the sake of handling the dev environment. But it doesn't sound pythonic!
How can I automate these steps in an elegant pythonic way?