[Distutils] setuptools include_package_data ignore data under a 'package'?

Trent Mick trentm at ActiveState.com
Wed Jan 25 03:14:15 CET 2006

[Phillip J. Eby wrote]
> Yeah, this is actually on my list, just haven't got 'round to it yet.  For 
> systems that include their control data in-band (as files/dirs in the 
> project area) it's pretty easy, but my impression was that most things 
> besides CVS and Subversion don't do this.  It would help if folks using the 
> other tools could give some idea of how you go about finding tracked files 
> using them, so I could get a better idea of how the extension API should work.

If I understand what you are asking here, you get the list of Perforce
files in the current client view (kinda the equivalent of an SVN working
copy) with the "p4 have ./..." command:

    $ p4 help have
        have -- List revisions last synced

        p4 have [ file ... ]

        List revisions of named files that were last synced from the depot.
        If no file name is given list all files synced on this client.
        The format is
            depot-file#revision - client-file

    $ p4 have ./...
    //depot/main/Apps/ActivePython-devel/README.txt#9 - c:\trentm\as\ActivePython-devel\README.txt

Some notes:
- Why "./..."?
  Firstly, you need to specify a path argument because otherwise p4
  defaults to the *whole* client view, which may (and likely does)
  include directories outside of your current dir.
  Secondly, "..." is Perforce's way of say "recursively under the given
  directory". So "./..." as a path argument effectively makes a p4
  command behave like an svn/cvs command's default: recursively under
  the current dir.
- If you *do* get into the business of doing this Perforce stuff, you
  may want to steal from or use my "p4lib.py" (either of which you are welcome
  todo -- MIT license):
  which provides parsing of some of the common p4 commands. (It is not
  perfect and arguably the Right Thing for Python/Perforce bindings
  would use Perforce's C++ API. 'p4lib.py' does have the benefit of
  being pure Python.)

    >>> import p4lib, sys, pprint
    >>> sys.displayhook = pprint.pprint
    >>> p4 = p4lib.P4()
    >>> p4.have("./...")
    [{'depotFile': '//depot/main/Apps/ActivePython-devel/README.txt',
      'localFile': 'c:\\trentm\\as\\ActivePython-devel\\README.txt',
      'rev': 9},


Trent Mick
TrentM at ActiveState.com

More information about the Distutils-SIG mailing list