Skip to content

Latest commit

 

History

History
65 lines (58 loc) · 2.42 KB

00README-FIRST.md

File metadata and controls

65 lines (58 loc) · 2.42 KB

Python Package Bootstrap

This is a template when starting Python projects.

Spirit/Principles

    pip install flake8
    flake8 foo.py

Overview of Structure

python-package-bootstrap/
|__ foopackage/  # the actual package (to be renamed)
|   |__ __init__.py  # always set `__version__` to x.y.z 
|   |__  # more code goes here
|   |__ tests/
|   |   |__ data/  # test data files (if none, you don't need this directory)
|   |   |__ run_tests.py  # unittest style testing, see https://docs.python.org/3/library/unittest.html
|__ .gitignore  # Python-based files to ignore
|__ LICENSE  # update project name, set year (YYYY)
|__ MANIFEST.in  # if there are non-python files that should be included in the distribution (see https://docs.python.org/3/distutils/sourcedist.html#specifying-the-files-to-distribute)
|__ README.md  # provide a description and items as per the headings in [Markdown](https://en.wikipedia.org/wiki/Markdown) format
|__ requirements.txt  # dependencies, see https://pip.pypa.io/en/latest/user_guide/#requirements-files
|__ requirements-dev.txt  # developer-centric dependencies (testing, packaging, etc.)
|__ setup.py  # setup script, set UPPERCASE variables scripts should be set as list

## Common workflows

```bash
# work in a virtualenv
virtualenv -p python3 myvenv
cd myvenv
. bin/activate
git clone https://github.com/tomkralidis/python-project-bootstrap.git
cd python-project-bootstrap
# run tests
cd tests && python run_tests.py
# create a distribution
python setup.py sdist  # result is in dist/foopackage-x.y.z.tar.gz