Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #12645

Re: SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in autopkgtest?

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Simon McVittie <smcv@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in autopkgtest?
Date Tue, 09 Jun 2020 13:30:01 +0200
Message-ID <AfKC5-Mt-3@gated-at.bofh.it> (permalink)
References <AfrSO-6fO-29@gated-at.bofh.it> <AfIgW-7Hn-7@gated-at.bofh.it> <AfJcZ-8g3-1@gated-at.bofh.it>
X-Original-To debian-python@lists.debian.org
X-Mailbox-Line From debian-python-request@lists.debian.org Tue Jun 9 11:29:29 2020
Old-Return-Path <smcv@debian.org>
X-Amavis-Spam-Status No, score=-5.901 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, LDO_WHITELIST=-5, LONGWORD=2, RCVD_IN_DNSWL_LOW=-0.7] autolearn=no autolearn_force=no
Dkim-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.master; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-ID:Content-Description; bh=NWjrq89nX44KeFebdz/tEzYE32dpUHStMCUmeveg8Ac=; b=A6/e+cYmMbtLsPb11j9L+SUvTs czqnp/nAZAFxlxXunmhTksSm9S/H4mB9W7HzZb6aInOSQ73CLdYKgmmHOq0ttLbmIIesQCaotHi4S NRIYneAmOL7J6i0Ulq59jDpECaN3TGbYBWbAYMZ2CQdB26yCO6/v6XLsANkPXcE+sZbvxDuGUfOWk n/U13Dnv+xMaxxtgfSRnMwS/OcNDOSWyePmh+2cuA6sqPX0MeY9THkKFlKZuy3VZHYJ2Iyivi781R nGQTFlT/VyzjicUdxBB0GatHWAWBHhLIDX1srYFf6SmevB5ALIaGRFJRK5OyLcpNLr29B8WEFlgNr gbG127yQ==;
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
X-Mailing-List <debian-python@lists.debian.org> archive/latest/18352
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/20200609112905.GA504113@espresso.pseudorandom.co.uk
Approved robomod@news.nic.it
Lines 32
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Tue, 9 Jun 2020 12:29:05 +0100
X-Original-Message-ID <20200609112905.GA504113@espresso.pseudorandom.co.uk>
X-Original-References <bceabdb219ff133c25c5b1a48a35d2b76307239c.camel@gmail.com> <CAOO6c=zC8S6SAHbHstmmL+kXByLKr94-aNJwRr3vcsg-6=8cvw@mail.gmail.com> <f65c4b50e569353a8c5b17381321d8cce547787a.camel@gmail.com>
Xref csiph.com linux.debian.maint.python:12645

Show key headers only | View raw


On Tue, 09 Jun 2020 at 11:50:02 +0200, Julien Puydt wrote:
> (1) during the autopkgtest run, we're not in the package source tree,
> are we? So there should be no access do d/changelog?

    The cwd of each test is guaranteed to be the root of the source
    package, which will have been unpacked but not built. However note
    that the tests must test the installed version of the package,
    as opposed to programs or any other file from the built tree.
    — https://salsa.debian.org/ci-team/autopkgtest/blob/master/doc/README.package-tests.rst

I've found that a lot of the time, what makes most sense is to gather
the information you need from the source tree, copy the files you
need from the source tree into a temporary directory, cd into the
temporary directory, and do the rest of your testing there. This avoids
things like Python's default "add the script's directory to sys.path"
behaviour accidentally picking up the version of the library that's in
the source package, which would result in not testing the installed copy
as required. For example, src:python-mpd does this.

Another way to get a similar result is to install the tests as part of the
binary packages, cd into an empty temporary directory, and run them from the
installed location. src:tap.py does this (the tests are small, so they're
just included in the main binary package) and so does src:dbus-python (the
tests are larger and have non-trivial dependencies, so they're a separate
binary package).

autopkgtest guarantees that $AUTOPKGTEST_TMP is an empty temporary
directory, or you can make your own with mktemp -d or similar, or you
can use a tool like ginsttest-runner (aka gnome-desktop-testing-runner,
in the gnome-desktop-testing package) that does it for you.

    smcv

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in autopkgtest? Julien Puydt <julien.puydt@gmail.com> - 2020-06-08 17:30 +0200
  Re: SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in autopkgtest? Ondrej Novy <novy@ondrej.org> - 2020-06-09 11:00 +0200
    Re: SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in  autopkgtest? Julien Puydt <julien.puydt@gmail.com> - 2020-06-09 12:00 +0200
      Re: SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in  autopkgtest? Simon McVittie <smcv@debian.org> - 2020-06-09 13:30 +0200

csiph-web