Bug#900526: testing of modules which rely on entry points is broken

2018-05-31 Thread Yaroslav Halchenko
Seemed to work like a charm, thank you Piotr!  Feel free to close
if you think this should be done manually (and not by default)

On Thu, 31 May 2018, Piotr Ożarowski wrote:

> [Yaroslav Halchenko, 2018-05-31]
> > I will meanwhile provide a workaround one way (skipping tests) or another
> > (symlinking .egg-info may be), but it would be nice if pybuild --test 
> > handled
> > those usecases smoother

> is debian/pybuild.testfiles smooth enough?

> (just put file/dir name there and pybuild will copy it to build
> directory before tests and remove them before installing files)


-- 
Yaroslav O. Halchenko
Center for Open Neuroscience http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834   Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik



Bug#900526: testing of modules which rely on entry points is broken

2018-05-31 Thread Piotr Ożarowski
[Yaroslav Halchenko, 2018-05-31]
> I will meanwhile provide a workaround one way (skipping tests) or another
> (symlinking .egg-info may be), but it would be nice if pybuild --test handled
> those usecases smoother

is debian/pybuild.testfiles smooth enough?

(just put file/dir name there and pybuild will copy it to build
directory before tests and remove them before installing files)



Bug#900526: testing of modules which rely on entry points is broken

2018-05-31 Thread Yaroslav Halchenko
Package: dh-python
Version: 3.20180326
Severity: normal

My use case is datalad.  In upcoming release we will rely on entry points more
and our tests verify that entry points could be correctly loaded etc.

For the "scripts" we just provided a custom workaround, but now we will use
pkg_resources.iter_entry_points which seems to rely on having
module.egg-info/entry_points.txt available.  But testing is launched from under
.pybuild/ directory so those entry points aren't found and thus tests fail.

mkdir -p build; \
export 
HOME=/home/yoh/proj/datalad/build-area/datalad-0.10.0~rc4+git167-g88f3ea8f/build;
  \
git config --global user.name "TESTING"; \
git config --global user.email "test...@example.com"
# Skipping a failing test for now: https://github.com/datalad/datalad/issues/357
# Since pybuild overrides HOME for its own purposes, we will rely on our
# setup_package placing it back into HOME
GIT_HOME=/home/yoh/proj/datalad/build-area/datalad-0.10.0~rc4+git167-g88f3ea8f/build
 
PATH=/home/yoh/proj/datalad/build-area/datalad-0.10.0~rc4+git167-g88f3ea8f/bin:$PATH
 \
PYBUILD_TEST_ARGS="-s -v --pdb datalad.metadata.extractors.tests" \
WRAPT_DISABLE_EXTENSIONS=1 \
dh_auto_test -- --test-nose
pybuild --test --test-nose -i python{version} -p 2.7 --test-nose
I: pybuild base:217: cd 
'/home/yoh/proj/datalad/build-area/datalad-0.10.0~rc4+git167-g88f3ea8f/.pybuild/cpython2_2.7_datalad/build';
 python2.7 -m nose -s -v --pdb datalad.metadata.extractors.tests
datalad.metadata.extractors.tests.test_audio.test_audio ... > 
/home/yoh/proj/datalad/build-area/datalad-0.10.0~rc4+git167-g88f3ea8f/.pybuild/cpython2_2.7_datalad/build/datalad/metadata/metadata.py(462)_get_metadata()
-> extractors = {ep.name: ep for ep in 
iter_entry_points('datalad.metadata.extractors')}
(Pdb) p list(iter_entry_points('datalad.metadata.extractors'))
[]
(Pdb) os.getcwd()
'/home/yoh/proj/datalad/build-area/datalad-0.10.0~rc4+git167-g88f3ea8f/.pybuild/cpython2_2.7_datalad/build'
(Pdb)
[2]  + 25084 suspended  fakeroot debian/rules clean binary

$> ls 
/home/yoh/proj/datalad/build-area/datalad-0.10.0~rc4+git167-g88f3ea8f/.pybuild/cpython2_2.7_datalad/build
datalad/

$> cat datalad.egg-info/entry_points.txt
[datalad.metadata.extractors]
annex = datalad.metadata.extractors.annex:MetadataExtractor
audio = datalad.metadata.extractors.audio:MetadataExtractor
datacite = datalad.metadata.extractors.datacite:MetadataExtractor
datalad_core = datalad.metadata.extractors.datalad_core:MetadataExtractor
datalad_rfc822 = datalad.metadata.extractors.datalad_rfc822:MetadataExtractor
exif = datalad.metadata.extractors.exif:MetadataExtractor
frictionless_datapackage = 
datalad.metadata.extractors.frictionless_datapackage:MetadataExtractor
image = datalad.metadata.extractors.image:MetadataExtractor
xmp = datalad.metadata.extractors.xmp:MetadataExtractor

$> find -iname entry_points*
./datalad.egg-info/entry_points.txt


I will meanwhile provide a workaround one way (skipping tests) or another
(symlinking .egg-info may be), but it would be nice if pybuild --test handled
those usecases smoother

Cheers

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (600, 'unstable'), (300, 'experimental'), (100, 
'unstable-debug'), (100, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), 
LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dh-python depends on:
ii  python3  3.6.5-3

Versions of packages dh-python recommends:
ii  python3-distutils  3.6.5-3

Versions of packages dh-python suggests:
ii  dpkg-dev  1.19.0.5
ii  libdpkg-perl  1.19.0.5

-- debconf-show failed