Bug#997044: ITP: markdown-it-py -- a Python port of markdown-it and some its associated plugins

2021-10-22 Thread Emmanuel Arias
Package: wnpp
Severity: wishlist
Owner: Emmanuel Arias 
X-Debbugs-Cc: debian-python@lists.debian.org

* Package name: markdown-it-py
  Version : 1.1.0
  Upstream Author : Chris Sewell 
* URL : https://github.com/executablebooks/markdown-it-py
* License : Expat
  Programming Lang: Python
  Description : a Python port of markdown-it and some its associated
plugins
.
markdown-it-py is a Python port of markdown-it and its associated plugins.
The
design philosophy of the port has been to change as little of the
fundamental code
structure (file names, function name, etc) as possible. just sprinkling in
a little Python
syntactic sugar.
.
I plan to maintain it under the DPT umbrella.


Chers,
Emmanuel


Re: .egg-info for entry points during dh_auto_test

2021-10-22 Thread Thomas Goirand
On 10/21/21 8:55 PM, Michael Fladischer wrote:
> Hi,
> 
> I'm working on src:pytest-lazy-fixtures and was trying to get the
> unittests to run but it seems that I have run into a problem that I'm
> not sure on how to fix it in a clean way.
> 
> pytest-lazy-fixtures is a pytest plugin and registers itself through the
> Python entrypoints mechanism. In its unitests, it assumes that this
> registration has already happened but during dh_auto_test there is no
> .egg-info directory available. I could use "python3 setup.py develop -x"
> to generate it, but this registers the package in /usr inside the build
> chroot which I think is not the best solution.
> 
> Is there an other, less intrusive way to register the entrypoint before
> running the tests?
> 
> Thanks,
> Michael
> 

Hi Michael,

I do this in many of my packages (or a variation of this) to solve that
problem:

override_dh_install:
python3 setup.py install --install-layout=deb \
--root=$(CURDIR)/debian/tmp

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages \
dh_auto_test
endif

dh_install

override_dh_auto_test:
echo "Do nothing..."

I hope this helps,
Cheers,

Thomas Goirand (zigo)



Re: .egg-info for entry points during dh_auto_test

2021-10-22 Thread Michael Fladischer

Hi Stefano,

Am 22.10.2021 um 05:44 schrieb Stefano Rivera:

pytest also has a mechanism to register plugins through an environment
variable, but I couldn't figure out how to get the test suite to work
with that.


thanks for this hint, that seems like a clean solution for my case:

PYTEST_PLUGINS="pytest_lazyfixture" python3.9 -m pytest

There is also the "-p" option which shoul early-load plugins by module 
name but it didn't work for me. The environment variable did.


Thanks,
Michael



Re: .egg-info for entry points during dh_auto_test

2021-10-22 Thread Stuart Prescott
Hi Michael

I wrestled with something similar some years ago with translate-toolkit, which 
has a set of tests that run the binaries it ships but these (entry-points) 
binaries are not generated until after installation.

The pybuild/debhelper sequence is to build, test then install; upstream's view 
is to build, install then test, and so that is what I faked for that package, 
overriding the normal test invocation, and running the tests in an 
execute_after_dh_install step:

https://sources.debian.org/src/translate-toolkit/unstable/debian/rules/#L59

I help the test suite find the binaries in debian/translate-toolkit/usr/bin and 
pybuild points the test harness at the modules in the normal place in 
.pybuild/.

That's pretty ugly, but it has worked out ok for this package.

A related problem is the PEP517 builders go from source to wheel and then 
install the wheel; the entry_points and scripts only appear after 
installation, and so once again, testing most probably lives after 'install' 
not before.

Given that entry_points, plugin registration, PEP517 are all pointing us 
towards build/install/test as the paradigm rather than build/test/install, do 
we need to look for an additional dh step to be added to our normal sequence 
to help us with what is becoming a common task?

regards
Stuart

-- 
Stuart Prescotthttp://www.nanonanonano.net/   stu...@nanonanonano.net
Debian Developer   http://www.debian.org/ stu...@debian.org
GPG fingerprint90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7