Codebase list dh-python / e2eec24
pybuild tox plugin: Delete pydistutils.cfg before calling tox, to avoid breaking it. Switching keys to underscores in 5.20211022 brought them to pip's attention, and it tried to install to /usr. (closes: 997485, 998581) Stefano Rivera 2 years ago
16 changed file(s) with 91 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
44 * pybuild: Only generate --test-* dependencies in the test target.
55 * pybuild: Fix tox autodetection, broken since it was renamed from
66 python3-tox.
7 * pybuild tox plugin: Delete pydistutils.cfg before calling tox, to avoid
8 breaking it. Switching keys to underscores in 5.20211022 brought them to
9 pip's attention, and it tried to install to /usr. (closes: 997485, 998581)
710
811 -- Stefano Rivera <stefanor@debian.org> Sun, 24 Oct 2021 18:43:33 -0700
912
4141 fakeroot,
4242 python3-all,
4343 python3-setuptools,
44 python3-toml
44 python3-toml,
45 tox
4546 Restrictions: allow-stderr
4647
4748 Tests: pybuild-py2
00 #!/bin/sh
1 exec debian/tests/run-installed testpb01 testpb02
1 exec debian/tests/run-installed testpb01 testpb02 testpb04
217217 elif self.cfg.test_pytest:
218218 return 'cd {build_dir}; {interpreter} -m pytest {args}'
219219 elif self.cfg.test_tox:
220 # tox will call pip to install the module. Let it install the
221 # module inside the virtualenv
222 pydistutils_cfg = join(args['home_dir'], '.pydistutils.cfg')
223 if exists(pydistutils_cfg):
224 remove(pydistutils_cfg)
220225 return 'cd {build_dir}; tox -c {dir}/tox.ini -e py{version.major}{version.minor}'
221226 elif args['version'] == '2.7' or args['version'] >> '3.1' or args['interpreter'] == 'pypy':
222227 return 'cd {build_dir}; {interpreter} -m unittest discover -v {args}'
00 #!/usr/bin/make -f
11
22 # enable or disable tests here:
3 #TESTS := test101 test201 test202 test203 test204 test205 test206 test207 test301 test302 test303 test304 test305 test306 testpb01 testpb02 testpb03
3 #TESTS := test101 test201 test202 test203 test204 test205 test206 test207 test301 test302 test303 test304 test305 test306 testpb01 testpb02 testpb03 testpb04
44 TESTS := test101 test301 test302 test303 test304 test305 test306
55
66 all: $(TESTS)
0 #!/usr/bin/make -f
1 include ../common.mk
2
3 check:
4 test -f debian/python3-foo/usr/lib/python3/dist-packages/foo.py
5 test -e test-executed
6
7 clean:
8 ./debian/rules clean
0 foo (1.2.3) unstable; urgency=low
1
2 * Initial release
3
4 -- Piotr Ozarowski <piotr@debian.org> Tue, 02 Jul 2013 11:02:06 +0200
0 Source: foo
1 Section: python
2 Priority: optional
3 Maintainer: Piotr Ożarowski <piotr@debian.org>
4 Build-Depends: debhelper-compat (= 12)
5 , python3-all
6 , python3-setuptools
7 , tox
8 # , dh-python
9 Standards-Version: 3.9.4
10
11 Package: python3-foo
12 Architecture: all
13 Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}
14 Description: package with public CPython modules
15 example package #1
0 The Debian packaging is © 2013, Piotr Ożarowski <piotr@debian.org> and
1 is licensed under the MIT License.
0 #!/usr/bin/make -f
1
2 export PYBUILD_NAME=foo
3
4 %:
5 dh $@
6
7 override_dh_auto_build:
8 ../../pybuild --build
9
10 override_dh_auto_install:
11 ../../pybuild --install
12
13 override_dh_auto_test:
14 ../../pybuild --test --test-tox --test-args=-v
15
16 override_dh_auto_clean:
17 ../../pybuild --clean
18 rm -rf .pybuild .tox foo.egg-info test-executed
19
20 override_dh_installinit:
21 DH_VERBOSE=1 ../../dh_python3
22 dh_installinit
23
24 override_dh_python3:
25 # ignore any system dh_python3
0 [metadata]
1 name = foo
2
3 [options]
4 py_modules = foo
0 from setuptools import setup
1
2 setup()
0 from unittest import TestCase
1
2
3 class RequiredTest(TestCase):
4 def test_tests_are_executed(self):
5 open('test-executed', 'w').close()
0 [tox]
1 envlist = py39
2
3 [testenv]
4 commands = python -m unittest discover