This is an automated notification sent by LCG Savannah.
It relates to:
                task #13958, project CDS Invenio

==============================================================================
 LATEST MODIFICATIONS of task #13958:
==============================================================================

Follow-up Comment #2, task #13958 (project cdsware):

For me, I have an alias like:

reinstall='sudo make install;sudo inveniocfg --update-all; sudo /sbin/service
httpd restart'

and this is part of my development process (i.e. edit, reinstall, test,
debug, etc)  

If you are using ipython, of course, you can import directly from the current
directory, but this only gets one file.   better to just use something like
reinstall and just test/debug modules in their eventual installed location to
avoid a nightmare of "oh, I've been testing against the wrong file."

YMMV of course...


==============================================================================
 OVERVIEW of task #13958:
==============================================================================

URL:
  <http://savannah.cern.ch/task/?13958>

                 Summary: Imports should look in current tree before
site-packages / dist-packages
                 Project: CDS Invenio
            Submitted by: vengmark
            Submitted on: 2010-02-16 15:00
         Should Start On: 2010-02-16 00:00
   Should be Finished on: 2010-02-16 00:00
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                  Effort: 0.00

    _______________________________________________________


Symptom: Whenever you run code in the cds-invenio repo, it will import from
the Python site-packages / dist-packages.

Problem: This makes the development cycle longer since any code changed by
git pull / merge would have to be copied to the Invenio source directory
before running.

Workaround: using "sudo -u <www-data/apache> make install" on the right
level.

Fix 1: Use relative imports across the board.

Fix 2: Use the same directory structure in site-packages / dist-packages as
in cds-invenio/modules, so that absolute imports look in the current
directory. Someone more skilled with imports would have to check whether this
even makes sense.

    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: 2010-02-17 19:42              By: Travis Brooks <tbrooks>
For me, I have an alias like:

reinstall='sudo make install;sudo inveniocfg --update-all; sudo /sbin/service
httpd restart'

and this is part of my development process (i.e. edit, reinstall, test,
debug, etc)  

If you are using ipython, of course, you can import directly from the current
directory, but this only gets one file.   better to just use something like
reinstall and just test/debug modules in their eventual installed location to
avoid a nightmare of "oh, I've been testing against the wrong file."

YMMV of course...


-------------------------------------------------------
Date: 2010-02-17 13:42              By: Victor Engmark <vengmark>
Checking Stack Overflow
<http://stackoverflow.com/questions/2280761/python-imports-with-different-directory-structures>
for opinions on the subject.





    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
3364                                | -COM-
3964                                | -SUB-




==============================================================================

This item URL is:
  <http://savannah.cern.ch/task/?13958>

_______________________________________________
  Message sent via/by LCG Savannah
  http://savannah.cern.ch/

Reply via email to