On Wed, 27 May 2015 15:39:17 -0400
Johan Huldtgren <[email protected]> wrote:

> On 2015-05-27 11:36, Adam Wolk wrote:
> 
> > For net/py-oauth2 the __init__ file is empty.
> 
> FWIW, removing those files will cause 'make test' to fail. That said

Possibly because in order to be able to import a library from a 'folder'
that folder has to contain an __init__.py file (even if empty) in order
for Python to treat it as a package.

> currently the tests also fail, seems I missed that when I submitted
> this port. Some googling led me to this:
> 
> http://lists.opensuse.org/archive/opensuse-commit/2013-04/msg01807.html
> 

That's interesting. When I reported tests failing I meant
www/py-paste-script. Your port passes tests correctly *without* the
patch.

----------------------------------------------------------------------
Ran 65 tests in 1.598s

OK

 RUN_DEPENDS =  www/py-httplib2
+
+TEST_DEPENDS = devel/py-mock \
+               devel/py-coverage \
+               ${RUN_DEPENDS}

I see you added dependencies. In my test they got pulled in
automatically from requires.txt:

Installed /usr/ports/pobj/py-oauth2-1.5.211/oauth2-1.5.211/mock-1.0.1-py2.7.egg
Installed 
/usr/ports/pobj/py-oauth2-1.5.211/oauth2-1.5.211/coverage-4.0a5-py2.7-openbsd-5.7-amd64.egg
running egg_info
writing requirements to oauth2.egg-info/requires.txt


> where they simply patch away the offending tests. I'm not sure why
> this was the chosen path but the fact that upstream hasn't been
> touched in four years might be a clue. So I adapted a similar patch
> for the port and now 'make test' succeeds.
> 
> This "fixes" the port but doesn't address the original issue raised.
> I'm not sure what the correct solution is here, however I will say
> that I submitted this port as a dependency for py-discogs-client.
> However once the current update gets commited py-oauth2 will cease to
> be a dependency, as it seems pretty dead upstream I would have no
> objections to it being removed at that time.
> 
> thanks,
> 
> .jh

To reiterate. This specific port passes `make test` on amd64 -current
May 20th on amd64 at least on my box. I'm really surprised that it
doesn't on your machine.

I do think that Python ports shouldn't install unit tests system wide
as there is barely any benefit from it though I know that a lot of
Python libraries like to do this (that's an issue not limited to
OpenBSD).


I did test your patch in case you actually hit an issue that doesn't
manifest on my version.

Make test still passes cleanly.

----------------------------------------------------------------------
Ran 61 tests in 0.044s

OK
# 

For the initial issue. I wonder if it would actually be OK to just
remove the test files after the test phase and have them dropped from
PLIST.

Where the tests are installed seem strongly dependent on how the
project structures their source repository layout. One could move the
tests directory inside lib/oauth or some other mockery like that which
is probably more effort than value gained.

Fun fact, there are 2 copies of the test suite. One in lib/tests the
second in top-level tests :)

Regards,
Adam

Reply via email to