test command with dist-info and resources

0 views
Skip to first unread message

michael mulich

unread,
Jun 5, 2011, 11:17:34 AM6/5/11
to The Fellowship of the packaging
Good day folks,

I was attempting to use the test command (packaging.command.test). I'm
not sure if this command is complete yet, but I have noticed some
missing bits that I thought I would bring to your attention.

Should the package's dist-info be available to it while running the
test command?

And related to the dist-info question, but separate. Should the
packaging.resources api be available to the package being tested? For
example, say a test is trying to read in a default configuration that
has been registered in setup.cfg's file section under resources as
something like 'config/* = {config}'.

-Michael Mulich (pumazi)

Éric Araujo

unread,
Jun 6, 2011, 12:18:11 PM6/6/11
to the-fellowship-...@googlegroups.com
Hi,

> Should the package's dist-info be available to it while running the
> test command?

What’s the use case?

> And related to the dist-info question, but separate. Should the
> packaging.resources api be available to the package being tested? For
> example, say a test is trying to read in a default configuration that
> has been registered in setup.cfg's file section under resources as
> something like 'config/* = {config}'.

My understanding of the resources design doc was that running out of a
source checkout or unpacked tarball was supposed to work, so yes.

Cheers

michael mulich

unread,
Jun 8, 2011, 11:14:15 PM6/8/11
to the-fellowship-...@googlegroups.com
On Mon, Jun 6, 2011 at 12:18 PM, Éric Araujo <win...@netwok.org> wrote:
> Hi,
>
>> Should the package's dist-info be available to it while running the
>> test command?
> What’s the use case?
>
The use case is from my previous message. Since writing the first
email though, packaging.resources merged into packaging.database. Here
is the case without clouding it with generalities:

I've written a test for a function that is supposed to find the
default configuration or one provided in a users local area (or
userbase as sysconfig puts it). As part of the test, I'm ensuring that
the forcibly found default config is loaded correctly. The function
that finds the configuration uses sysconfig paths
(sysconfig.get_paths) which rely on the packaging database (PEP 376
API).

>> And related to the dist-info question, but separate. Should the
>> packaging.resources api be available to the package being tested? For
>> example, say a test is trying to read in a default configuration that
>> has been registered in setup.cfg's file section under resources as
>> something like 'config/* = {config}'.
> My understanding of the resources design doc was that running out of a
> source checkout or unpacked tarball was supposed to work, so yes.
>

Thanks for verifying that. I've started work, in my local clone, on
the distribution test loading for the above use case. I've currently
got the distribution test loading to work, but we lack a unittest for
this case. I'll be writing it some time within the next few days.

Before I move forward with the unittest, I'd like to know where this
RESOURCES file came from? I don't recall, nor see mention of it in PEP
376. I would also have expected to find something in
packaging.command.install_distinfo command related to this file. If
the install_distinfo command is lacking this logic and you'd like it
in, I can implement while working on this case. Just let me know if
this is the correct place.

Thanks.

-Michael Mulich (pumazi)

michael mulich

unread,
Jun 9, 2011, 6:59:36 PM6/9/11
to the-fellowship-...@googlegroups.com
Submitted my case as Issue 12302 (http://bugs.python.org/issue12302).
I'll work on it within the next few days.
Reply all
Reply to author
Forward
0 new messages