Python example project. Example of:
- Entry point (
app.py) - module (
pyexample) - module with resources (
pyexample/resources) - dependencies via
requirements.txt(used insetup.py) - setuptools (
setup.py,MANIFEST.in) - unit tests via standard
unittestmodule - continuous integration via Travis CI
Install
sudo dnf install pip3 sudo pip3 install git+https://github.com/Kedrigern/pyexample.git
dnf is install software for Fedora. On other OS use another app.
After git url you can specify tag:
sudo pip3 install git+https://github.com/Kedrigern/pyexample.git@v0.4.0
Run
With any parameter output is quit different:
Run tests
cd <git-repository-with-project> python3 -m unittest
Create OS packages
If pip is not enough, you can create distribution packages.
RPM
DEB
./setup.py --command-packages=stdeb.command bdist_deb
Links
File hierarchy
├── DESCRIPTION.rst
├── MANIFEST.in
├── pyexample
│ ├── hello.py
│ ├── __init__.py
│ ├── __main__.py
│ └── resources
│ ├── config.ini
│ ├── dir
│ │ └── resource3.dat
│ ├── __init__.py
│ ├── resource1.dat
│ └── resource2.dat
├── readme.md
├── requirements.txt
├── run
├── setup.cfg
├── setup.py
└── test
├── __init__.py
└── test_hello.py