[Tutor] project directory structure

Alex Kleider akleider at sonic.net
Thu Aug 25 21:12:12 EDT 2016


I'm still struggling with what is the best way to set up a project
directory.

All the sources I've read seem to agree that one should have a top
level project directory under which one might expect to find the 
following:
     COPYING.txt # or LICENSE.txt
     README.rst
     setup.py
and if the project consists of only one .py file, it also goes here
but if there is to be more than one module, the code should be in a
subdirectory of the same name as the top level one so we now have
something like the following:
MyProject
     COPYING.txt # or LICENSE.txt
     MyProject
         data/
         src/
             module1.py
             module2.py
         tests/
             test1.py
             test1.py
     README.rst
     setup.py


Assuming the latter scenario, where should one run
virtualenv -p python3 venv?
... at the top level or within the second level?

During development I would expect to have MyProject/MyProject
as my working directory most of the time and hence think venv should
be there but perhaps it should be the level above so that it
encompasses setup.py.

The main reason I want to get this right is because all my .py files
begin with a shebang line of the form
#!../venv/bin/python3
which uses a relative path so the choice I make will determine
if I use the above or
#!../../venv/bin/python3


Any advice would be appreciated.

Alex


More information about the Tutor mailing list