I\'m new to Python and I\'m starting a mini Project, but I have some doubts on how to organize the folders in the \"Python Way\".
I\'m using PyDev
in my
You might want to check out the modern-package-template libary. It provides a way to setup a really nice basic layout for a project that walks you through a few questions and tries to help you get something that's able to be distributed fairly easily.
http://pypi.python.org/pypi/modern-package-template
See python-package-template
Directory structure
.
|-- bin
| `-- my_program
|-- docs
| `-- doc.txt
|-- my_program
| |-- data
| | `-- some_data.html
| |-- __init__.py
| |-- submodule
| | `-- __init__.py
| |-- helpers.py
|-- tests
| |-- __init__.py
| |-- test_helpers.py
|-- Makefile
|-- CHANGES.txt
|-- LICENSE.txt
|-- README.md
|-- requirements-dev.txt
|-- requirements.txt
`-- setup.py
cat Makefile
PYTHON=`which python`
NAME=`python setup.py --name`
all: check test source deb
init:
pip install -r requirements.txt --use-mirrors
dist: source deb
source:
$(PYTHON) setup.py sdist
deb:
$(PYTHON) setup.py --command-packages=stdeb.command bdist_deb
rpm:
$(PYTHON) setup.py bdist_rpm --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall
test:
unit2 discover -s tests -t .
python -mpytest weasyprint
check:
find . -name \*.py | grep -v "^test_" | xargs pylint --errors-only --reports=n
# pep8
# pyntch
# pyflakes
# pychecker
# pymetrics
clean:
$(PYTHON) setup.py clean
rm -rf build/ MANIFEST dist build my_program.egg-info deb_dist
find . -name '*.pyc' -delete