This can be used as a base for Python projects.
Download sources:
git clone https://github.com/siso/pybaseproject
Amend changes to suit your needs:
- rename pybaseproject to your PROJECT_NAME
- rename bin/pybaseproject to bin/YOUR_MAIN_SCRIPT_NAME
Edit:
- bin/YOUR_MAIN_SCRIPT_NAME
- setup.py
Admittedly, the most interesting part is coding under PROJECT_NAME directory!
When you are done just run:
make all
to check and test sources, create pip and Debian packages.
pybaseproject comes with a basic Makefile which might comes in handy to speed up getting hands dirty.
Just run:
make check
: check source codesmake test
: run testsmake source
: create a pip package (python setup.py sdist
)make deb
: create Debian packagemake all
: run the above commands in one go
Create Python virtual-environment and install pybaseproject:
mkvirtualenv pybaseproject
cp /PATH/TO/pybaseproject/dist/pybaseproject-0.1.tar.gz .
tar xvfz pybaseproject-0.1.tar.gz
cd pybaseproject-0.1/
python setup.py install
execute it:
(pybaseproject)simone@nls206:~/tmp/20131103-115131/pybaseproject-0.1$ pybaseproject
pybaseproject.foo
Hola!
Logging can be configured with 'logging.conf' (see pybaseproject.foo), or hardcoding settings directly in source code (easier to set up but harder to maintain).
Logging to stdout supports ANSI-coloured output. To activate it logging.conf should look like:
[logger_root]
...
handlers=fileHandler,colouredConsoleHandler
If default black-and-white output is OK:
[logger_root]
...
handlers=fileHandler,consoleHandler
Simone Soldateschi - simone.soldateschi@gmail.com