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


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

SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in autopkgtest?

Path csiph.com!news.neodome.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Julien Puydt <julien.puydt@gmail.com>
Newsgroups linux.debian.maint.python
Subject SETUPTOOLS_SCM_PRETEND_VERSION trick : how to use it in autopkgtest?
Date Mon, 08 Jun 2020 17:30:02 +0200
Message-ID <AfrSO-6fO-29@gated-at.bofh.it> (permalink)
X-Original-To Debian Python <debian-python@lists.debian.org>
X-Mailbox-Line From debian-python-request@lists.debian.org Mon Jun 8 15:22:12 2020
Old-Return-Path <julien.puydt@gmail.com>
X-Amavis-Spam-Status No, score=-4.562 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, LDO_WHITELIST=-5, LONGWORD=2, RCVD_IN_DNSWL_NONE=-0.0001, SARE_MSGID_LONG40=0.637] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate: -5.5
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:user-agent:mime-version :content-transfer-encoding; bh=eRU5ggoBYgrMwfJoddLhxgmA5TROBnpRANJX6u9iWIY=; b=KloabJ9uJjhZ8WdsrbmKVIi1IrUmSBjKTXDnYX8vvQhLTtOv+IpR4D04pULuNMjJAj qD+bdJho26cnxOCwsfFestzngDTXHF1mVAM21bKjDqa8vHIM4atTws+o1Nts5FR8qua9 gOzUtp0LIt1Gv9R5XlwF4XLno07rFbQyxw1Oi3LAXwrRSroa67+sLleFn5rNe/uCuLOI fm6cFUZgMDGNWyHdg/sINxDUtOnrarqJKeyihcpMJQeWlu5PFx/gM8jp/pWMYdrjg1GU zE5sdGgbJgdaMLaKpSV9dAGSURGj9Vd0TbGYVTp0B254qnvIbsSwB2nCx0nsMrn9CQzZ zJaQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:user-agent :mime-version:content-transfer-encoding; bh=eRU5ggoBYgrMwfJoddLhxgmA5TROBnpRANJX6u9iWIY=; b=qehxtPkF1oxFUXSvazQqUvO8Wv1Y9D8Ws1EfXxHJjPTruH8Rj+rKCh0e1gc2Zj66Ze FJZxkiBHTZzxy8bQu1MahYwhiIpaTzrZUdJ2gvTICbUKyRlnpMocaTmWMhi6ESlT5DVR 2lMyUy+NfbQ1mQ4+NgF4/DfbE01E0jcMNJoOCiThi6rx6ypEbZ6YqxHjhdBVBrvhGaLD B52APmV9ESIOfAep8LTQ9ztWOETzaReg9AjyrAmj2pHO65BV6r87lL7CzNVNxDrHrM4U bXMzdehxg3rs4lU9E7EeHyNiymfUABDkg6KebuAUbPC9AEHxx8fRPZa2av8jH32a16Zi WF1Q==
X-Gm-Message-State AOAM532FWvDDxEaNbin6oBUcdlWP7hT45BKb80/+6wVy8coNfLWI4qNQ S8vcoMFiIGR/bXoPAlHCjvjxFLZTTWI=
X-Google-SMTP-Source ABdhPJytsbBM3igHSsCN6YbsjyyhIc48XQHV7Gbq025PHXdXksKq6UvP8XadYVfiGYFhwYlKIBNeRg==
X-Received by 2002:a1c:2457:: with SMTP id k84mr15997212wmk.96.1591629716874; Mon, 08 Jun 2020 08:21:56 -0700 (PDT)
Content-Type text/plain; charset="UTF-8"
User-Agent Evolution 3.36.2-1
MIME-Version 1.0
Content-Transfer-Encoding 7bit
X-Mailing-List <debian-python@lists.debian.org> archive/latest/18348
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/bceabdb219ff133c25c5b1a48a35d2b76307239c.camel@gmail.com
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Mon, 08 Jun 2020 17:21:55 +0200
X-Original-Message-ID <bceabdb219ff133c25c5b1a48a35d2b76307239c.camel@gmail.com>
Xref csiph.com linux.debian.maint.python:12641

Show key headers only | View raw


Hi,

I know about the SETUPTOOLS_SCM_PRETEND_VERSION trick when it is used
in d/rules :

include /usr/share/dpkg/pkg-info.mk
export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM)

so setuptools-scm won't have trouble finding the correct version
outside of a git repository. But the situation I'm facing is that the
upstream testing code also needs this. Not at build-time, but at
autopkgtest-time.

My initial d/tests/control was:

Tests: upstreamtestsuite
Depends: @, python3-setuptools, python3-setuptools-scm

and d/tests/upstreamtestsuite was:

#!/bin/sh
set -e
python3 setup.py test 2>1

which of course failed because setuptools-scm couldn't find the
version.

I got around by turning d/tests/upstreamtestsuite to:

#!/bin/sh
set -e
SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 python3 setup.py test 2>&1

which worked because in fact the tests don't care about the version.

But if they did, how would I inject the right version into this script?

Thanks,

JP

Back to linux.debian.maint.python | Previous | Next — Next 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