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?

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 2020-06-08 17:30 +0200
Message-ID <AfrSO-6fO-29@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | 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