[reportlab-users] More 2.2 questions - package rearrangement
Robin Becker
robin at reportlab.com
Mon Sep 1 12:30:27 EDT 2008
Dirk Holtwick wrote:
> Andy Robinson schrieb:
>> - README, CHANGES etc
>
> I would like to them be called: README.txt, CHANGES.txt, LICENSE.txt etc
> because this way most Operating Systems know how to open them.
>
>> - setup.py
>> - reportlab/ - the pure python package
>> - reportlab/fonts/ - has more fonts added
>>
>> - rl_addons/ - contains all C source code
>> rl_accel/
>> renderPM/
>
> These two directories could also be placed under "src/". In your
> setup.py with Setuptools you then just have to add the line:
>
> package_dir = {
> '': 'src'
> },
>
OK so what packages get built with this scheme? reportlab is a package, but
rl_addons is just a folder containing sources for two extensions. Surely I have
to refer to those codes in the same way as before.
> Maybe reportlab/fonts/ and reportlab/tools/ should also move to the top
> directory because they are not an essential part of reportlab toolkit.
>
>> - docs/ - code for userguide etc, moved up out of the Python package
>> - tests/ - ditto
>
> You might add:
>
> test_suite = "tests",
>
> to setup.py then, so the tests may be executed easily like this:
>
> $ python setup.py test
>
what actually gets executed when this happens? There is presumably some standard
entry point, but looking in the 2.5 "Distributing Python Modules" stuff I can't
see the word test anywhere in the index.
......
> I think this is a good idea to cleanup a bit.
>
Another thing which came up in my preliminary testing of this scheme is that we
need to refer to files which are either in the docs folder or the tests folder.
Previously we did this by assuming that the container was a package that could
be imported. Now if tests/docs etc are not packages I need to have some more
utilities to locate my files. What's the correct way to do that? I know that
normally people will cd into tests to do python runAll.py, but nothing prevents
them from doing stuff like python verylongpath/tests/runAll.py so presumably I
need to obtain my script path and ensure it(or its parent) is on the path so I
can locate my modules etc etc.
--
Robin Becker
More information about the reportlab-users
mailing list