Import Debian changes 1:0.12.2-ok1
python-lockfile (1:0.12.2-ok1) yangtze; urgency=medium * Build for openKylin.
This commit is contained in:
parent
d303622b1b
commit
3909b840d0
|
@ -0,0 +1,15 @@
|
|||
python-lockfile (1:0.10.2-1) unstable; urgency=low
|
||||
|
||||
As of version 0.9, the Python API in ‘lockfile’ breaks backward
|
||||
compatibility with older versions. From the upstream release notes:
|
||||
|
||||
* The names of the three main classes have changed as follows:
|
||||
|
||||
LinkFileLock -> LinkLockFile
|
||||
MkdirFileLock -> MkdirLockFile
|
||||
SQLiteFileLock -> SQLiteLockFile
|
||||
|
||||
Any Python code written to use the names from older APIs will break in
|
||||
this version. Such code needs to be migrated to use the new names.
|
||||
|
||||
-- Ben Finney <ben+debian@benfinney.id.au> Wed, 06 May 2015 10:38:38 +1000
|
|
@ -0,0 +1,118 @@
|
|||
===========================================
|
||||
Debian source package for ‘python-lockfile’
|
||||
===========================================
|
||||
|
||||
|
||||
Package maintenance in VCS
|
||||
==========================
|
||||
|
||||
The ‘debian/control’ file declares the VCS repository used for
|
||||
tracking the Debian package maintenance work.
|
||||
|
||||
|
||||
VCS branches for package maintenance
|
||||
------------------------------------
|
||||
|
||||
The source for the Debian packaging is managed in these conventional
|
||||
Git branches:
|
||||
|
||||
* master: The current released code base.
|
||||
* packaging: Debian packaging development branch.
|
||||
* upstream: Upstream source code base, as imported from tarballs.
|
||||
* pristine-tar: Metadata for reproducibly generating upstream tarball.
|
||||
|
||||
|
||||
Work on a release in VCS
|
||||
------------------------
|
||||
|
||||
* Ensure the ‘upstream’ branch contains the correct upstream source.
|
||||
|
||||
* Ensure the ‘pristine-tar’ branch contains the corresponding metadata
|
||||
for the pristine upstream source tarball.
|
||||
|
||||
* In the ‘packaging’ branch, create a new Debian changelog entry.
|
||||
|
||||
Because the release is not complete, many aspects have not been
|
||||
decided and should not be recorded in the VCS:
|
||||
|
||||
* The target destination (in the header) is “UNRELEASED”.
|
||||
|
||||
* The person and timestamp of the release is undecided, so should be
|
||||
empty: the signature line should have no content, just the “ --”
|
||||
leader.
|
||||
|
||||
* While working on the package, temporarily finalise the signature
|
||||
line for testing the build.
|
||||
|
||||
This ephemeral state should not be part of the VCS history, though,
|
||||
so do not commit that finalised changelog entry; revert it to the
|
||||
above state to continue development.
|
||||
|
||||
|
||||
Build the source package from VCS
|
||||
---------------------------------
|
||||
|
||||
* Ensure the ‘packaging’ branch contains all the changes that are
|
||||
intended for the release to Debian.
|
||||
|
||||
* Until the work is ready for release, do not commit a finalised
|
||||
Debian changelog entry. The changelog entry should be in the state
|
||||
described in “Work on a release in VCS”, above.
|
||||
|
||||
This correctly leaves the decision of which destination for the
|
||||
upload, who uploads and when, to the point in time where that
|
||||
decision is made: the time of finalising the release.
|
||||
|
||||
* Rebase a working branch, e.g. ‘wip/packaging/4.2+dfsg.1-1’, from the
|
||||
HEAD of ‘packaging’.
|
||||
|
||||
* In this branch, finalise the ‘debian/changelog’:
|
||||
|
||||
* Declare a release name, e.g. “* The “Ananta Bijoy Das” release.”
|
||||
|
||||
* Set the target distribution, e.g. “unstable”.
|
||||
|
||||
* Set the signature line containing the correct person and timestamp,
|
||||
e.g. “Ben Finney <bignose@debian.org> Tue, 09 Aug 2016 06:05:28 +1000”.
|
||||
|
||||
* Commit the finalised changelog with a commit message of the form
|
||||
“Finalise release “4.2+dfsg.1-1”.”
|
||||
|
||||
* Test the source package in ‘master’:
|
||||
|
||||
* Merge the ‘upstream’ branch to ‘master’, with the commit message
|
||||
“Merge upstream version “4.2+dfsg.1”.”.
|
||||
|
||||
* Merge – but *do not yet* commit – the work-in-progress release
|
||||
branch ‘wip/packaging/4.2+dfsg.1-1’, into ‘master’.
|
||||
|
||||
* Build the source package from the resulting working tree.
|
||||
|
||||
* Test the source package by building it in a Sbuild or Pbuilder
|
||||
environment, with all Lintian checks enabled.
|
||||
|
||||
* Upload the successfully-built source package to Debian.
|
||||
|
||||
* Only when the package builds satisfactorily from the merged working
|
||||
tree in ‘master’:
|
||||
|
||||
* Commit the merged release to ‘master’, with the commit message of
|
||||
the form “Merge Debian packaging for release “4.1+dfsg.1-2”.”.
|
||||
|
||||
* Create and sign a tag for the release, ‘debian/4.2+dfsg.1-1’ with
|
||||
the commit message “Debian release “4.2+dfsg.1-1.”.
|
||||
|
||||
* Prepare the ‘packaging’ branch for ongoing work:
|
||||
|
||||
* Switch to the ‘packaging’ branch.
|
||||
|
||||
* Fast-forward merge the finalised changelog from
|
||||
‘wip/packaging/4.2+dfsg.1-1’.
|
||||
|
||||
* Delete the work-in-progress branch ‘wip/packaging/4.2+dfsg.1-1’.
|
||||
|
||||
* Optionally: Create a new work-in-progress for an upcoming release,
|
||||
as described in “Work on a release in VCS”, above.
|
||||
|
||||
|
||||
-- Ben Finney <bignose@debian.org>, Fri, 19 Aug 2016 21:48:44 +1000
|
|
@ -0,0 +1,5 @@
|
|||
python-lockfile (1:0.12.2-ok1) yangtze; urgency=medium
|
||||
|
||||
* Build for openKylin.
|
||||
|
||||
-- openKylinBot <openKylinBot@openkylin.com> Mon, 25 Apr 2022 22:03:04 +0800
|
|
@ -0,0 +1 @@
|
|||
9
|
|
@ -0,0 +1,90 @@
|
|||
Source: python-lockfile
|
||||
Priority: optional
|
||||
Maintainer: Ben Finney <bignose@debian.org>
|
||||
Section: python
|
||||
Homepage: https://pypi.python.org/pypi/lockfile/
|
||||
Build-Depends:
|
||||
debhelper (>= 9~),
|
||||
dh-python,
|
||||
python3-setuptools,
|
||||
python3-pbr (>= 1.8),
|
||||
python3-nose,
|
||||
python3-sphinx,
|
||||
python3-all,
|
||||
python-setuptools,
|
||||
python-pbr (>= 1.8),
|
||||
python-nose,
|
||||
python-all
|
||||
Standards-Version: 3.9.8
|
||||
VCS-Git: https://notabug.org/bignose/debian_python-lockfile.git
|
||||
VCS-Browser: https://notabug.org/bignose/debian_python-lockfile/
|
||||
X-Python-Version: >= 2.7
|
||||
X-Python3-Version: >= 3.2
|
||||
|
||||
Package: python-lockfile
|
||||
Architecture: all
|
||||
Depends:
|
||||
${python:Depends},
|
||||
${misc:Depends}
|
||||
Suggests: python-lockfile-doc
|
||||
Description: file locking library for Python — Python 2 library
|
||||
The ‘lockfile’ library exports a ‘LockFile’ class which provides a
|
||||
simple API for locking files.
|
||||
.
|
||||
The appropriate implementation for ‘LockFile’ is chosen automatically
|
||||
based on the OS capabilities for an atomic filesystem operation.
|
||||
These implementations are also available for explicit use as
|
||||
‘LinkLockFile’ and ‘MkdirLockFile’.
|
||||
.
|
||||
Other back ends are possible with the same semantics. Examples
|
||||
included are:
|
||||
* ‘SQLiteLockFile’, using records in an SQLite database.
|
||||
* ‘PIDLockFile’, using the semantics of a Unix PID file.
|
||||
.
|
||||
Unlike other Python locking libraries (the Windows ‘msvcrt.locking’
|
||||
function, the Unix ‘fcntl.flock’, ‘fcntl.lockf’, and the deprecated
|
||||
‘posixfile’ module), the API is identical across both Unix (including
|
||||
GNU/Linux and MacOS) and Windows platforms.
|
||||
.
|
||||
This package installs the Python 2 library.
|
||||
|
||||
Package: python3-lockfile
|
||||
Architecture: all
|
||||
Depends:
|
||||
${python3:Depends},
|
||||
${misc:Depends}
|
||||
Suggests: python-lockfile-doc
|
||||
Description: file locking library for Python — Python 3 library
|
||||
The ‘lockfile’ library exports a ‘LockFile’ class which provides a
|
||||
simple API for locking files.
|
||||
.
|
||||
The appropriate implementation for ‘LockFile’ is chosen automatically
|
||||
based on the OS capabilities for an atomic filesystem operation.
|
||||
These implementations are also available for explicit use as
|
||||
‘LinkLockFile’ and ‘MkdirLockFile’.
|
||||
.
|
||||
Other back ends are possible with the same semantics. Examples
|
||||
included are:
|
||||
* ‘SQLiteLockFile’, using records in an SQLite database.
|
||||
* ‘PIDLockFile’, using the semantics of a Unix PID file.
|
||||
.
|
||||
Unlike other Python locking libraries (the Windows ‘msvcrt.locking’
|
||||
function, the Unix ‘fcntl.flock’, ‘fcntl.lockf’, and the deprecated
|
||||
‘posixfile’ module), the API is identical across both Unix (including
|
||||
GNU/Linux and MacOS) and Windows platforms.
|
||||
.
|
||||
This package installs the Python 3 library.
|
||||
|
||||
Package: python-lockfile-doc
|
||||
Section: doc
|
||||
Architecture: all
|
||||
Depends:
|
||||
${sphinxdoc:Depends},
|
||||
${misc:Depends}
|
||||
Recommends: python3-lockfile
|
||||
Description: file locking library for Python — documentation
|
||||
The ‘lockfile’ library exports a ‘LockFile’ class which provides a
|
||||
simple API for locking files.
|
||||
.
|
||||
This package installs the API documentation, in plain text and
|
||||
rendered as HTML.
|
|
@ -0,0 +1,75 @@
|
|||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: pylockfile
|
||||
Upstream-Contact: OpenStack Foundation <openstack-dev@lists.openstack.org>
|
||||
Source: http://pypi.python.org/packages/source/l/lockfile/
|
||||
|
||||
Files: *
|
||||
Copyright:
|
||||
© 2014–2015 OpenStack Foundation <openstack-dev@lists.openstack.org>
|
||||
© 2007–2012 Skip Montanaro <skip@pobox.com>
|
||||
© 2008–2014 Ben Finney <ben+python@benfinney.id.au>
|
||||
License: Expat
|
||||
|
||||
Files: lockfile/pidlockfile.py
|
||||
Copyright:
|
||||
© 2008–2009 Ben Finney <ben+python@benfinney.id.au>
|
||||
License: Expat
|
||||
License-Grant:
|
||||
This is free software; you may copy, modify, and/or distribute this work
|
||||
under the terms of the Expat license as published by James Clark.
|
||||
No warranty expressed or implied.
|
||||
Comment:
|
||||
This is an additional grant of license, not yet published in the upstream
|
||||
source.
|
||||
|
||||
Files: debian/*
|
||||
Copyright:
|
||||
© 2009–2016 Ben Finney <bignose@debian.org>
|
||||
License: Expat
|
||||
License-Grant:
|
||||
This is free software; you may copy, modify, and/or distribute this work
|
||||
under the terms of the Expat license as published by James Clark.
|
||||
No warranty expressed or implied.
|
||||
|
||||
Files:
|
||||
debian/tests/smoke_test.py
|
||||
debian/tests/smoke-python*
|
||||
Copyright:
|
||||
© 2016 Ben Finney <bignose@debian.org>
|
||||
License: GPL-3+
|
||||
License-Grant:
|
||||
This is free software; you may copy, modify, and/or distribute this work
|
||||
under the terms of the GNU General Public License, version 3 or later.
|
||||
No warranty expressed or implied.
|
||||
|
||||
|
||||
License: Expat
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
License: GPL-3+
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 3 can be found in ‘/usr/share/common-licenses/GPL-3’.
|
||||
|
||||
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: debian-copyright
|
||||
# fill-column: 78
|
||||
# End:
|
||||
# vim: fileencoding=utf-8 textwidth=78 :
|
|
@ -0,0 +1,21 @@
|
|||
# debian/gbp.conf
|
||||
# Git-buildpackage configuration for ‘python-lockfile’.
|
||||
# Manpage: ‘gbp.conf(5)’
|
||||
|
||||
[DEFAULT]
|
||||
|
||||
# Overlay the exported source onto original upstream source?
|
||||
overlay = false
|
||||
|
||||
# Store the pristine upstream source in this VCS repository?
|
||||
pristine-tar = true
|
||||
|
||||
# Create the upstream source from this VCS repository?
|
||||
create-orig = true
|
||||
|
||||
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: conf
|
||||
# End:
|
||||
# vim: fileencoding=utf-8 filetype=conf noexpandtabs :
|
|
@ -0,0 +1,93 @@
|
|||
Description: Make doctest examples compatible with Python 2 and Python 3.
|
||||
.
|
||||
Existing doctests were written only for Python 2 and have not yet
|
||||
been updated upstream to work with Python 3.
|
||||
Author: Ben Finney <bignose@debian.org>
|
||||
Last-Update: 2015-05-16
|
||||
|
||||
diff --git a/doc/source/index.rst b/doc/source/index.rst
|
||||
index f76173d..b4bfd4d 100644
|
||||
--- a/doc/source/index.rst
|
||||
+++ b/doc/source/index.rst
|
||||
@@ -224,14 +224,14 @@ This example is the "hello world" for the :mod:`lockfile` package::
|
||||
from lockfile import LockFile
|
||||
lock = LockFile("/some/file/or/other")
|
||||
with lock:
|
||||
- print lock.path, 'is locked.'
|
||||
+ print(lock.path, "is locked.")
|
||||
|
||||
To use this with Python 2.4, you can execute::
|
||||
|
||||
from lockfile import LockFile
|
||||
lock = LockFile("/some/file/or/other")
|
||||
lock.acquire()
|
||||
- print lock.path, 'is locked.'
|
||||
+ print(lock.path, "is locked.")
|
||||
lock.release()
|
||||
|
||||
If you don't want to wait forever, you might try::
|
||||
@@ -244,7 +244,7 @@ If you don't want to wait forever, you might try::
|
||||
except LockTimeout:
|
||||
lock.break_lock()
|
||||
lock.acquire()
|
||||
- print "I locked", lock.path
|
||||
+ print("I locked", lock.path)
|
||||
lock.release()
|
||||
|
||||
You can also insure that a lock is always held when appropriately decorated
|
||||
diff --git a/lockfile/__init__.py b/lockfile/__init__.py
|
||||
index 419d122..339a205 100644
|
||||
--- a/lockfile/__init__.py
|
||||
+++ b/lockfile/__init__.py
|
||||
@@ -12,23 +12,23 @@ Usage:
|
||||
>>> try:
|
||||
... lock.acquire()
|
||||
... except AlreadyLocked:
|
||||
-... print 'somefile', 'is locked already.'
|
||||
+... print('somefile', "is locked already.")
|
||||
... except LockFailed:
|
||||
-... print 'somefile', 'can\\'t be locked.'
|
||||
+... print('somefile', "can't be locked.")
|
||||
... else:
|
||||
-... print 'got lock'
|
||||
+... print("got lock")
|
||||
got lock
|
||||
->>> print lock.is_locked()
|
||||
+>>> lock.is_locked()
|
||||
True
|
||||
>>> lock.release()
|
||||
|
||||
>>> lock = LockFile('somefile')
|
||||
->>> print lock.is_locked()
|
||||
+>>> lock.is_locked()
|
||||
False
|
||||
>>> with lock:
|
||||
-... print lock.is_locked()
|
||||
+... lock.is_locked()
|
||||
True
|
||||
->>> print lock.is_locked()
|
||||
+>>> lock.is_locked()
|
||||
False
|
||||
|
||||
>>> lock = LockFile('somefile')
|
||||
@@ -37,7 +37,7 @@ False
|
||||
... lock.acquire()
|
||||
...
|
||||
>>> # Though no counter is kept, so you can't unlock multiple times...
|
||||
->>> print lock.is_locked()
|
||||
+>>> lock.is_locked()
|
||||
False
|
||||
|
||||
Exceptions:
|
||||
|
||||
|
||||
|
||||
Local variables:
|
||||
coding: utf-8
|
||||
mode: diff
|
||||
time-stamp-format: "%:y-%02m-%02d"
|
||||
time-stamp-start: "^Last-Update:[ ]+"
|
||||
time-stamp-end: "$"
|
||||
time-stamp-line-limit: 20
|
||||
End:
|
||||
vim: fileencoding=utf-8 filetype=diff :
|
|
@ -0,0 +1 @@
|
|||
001.doctests-compatible-py2and3.patch
|
|
@ -0,0 +1,15 @@
|
|||
Document: python-lockfile
|
||||
Title: lockfile Python library documentation
|
||||
Author: Skip Montanaro
|
||||
Abstract: Programmer documentation for the Python ‘lockfile’ library.
|
||||
Section: Programming/Python
|
||||
|
||||
Format: HTML
|
||||
Index: /usr/share/doc/python-lockfile-doc/html/index.html
|
||||
Files:
|
||||
/usr/share/doc/python-lockfile-doc/html/*.html
|
||||
/usr/share/doc/python-lockfile-doc/html/*.js
|
||||
/usr/share/doc/python-lockfile-doc/html/_static/*
|
||||
|
||||
Format: Text
|
||||
Files: /usr/share/doc/python-lockfile-doc/index.rst.gz
|
|
@ -0,0 +1,5 @@
|
|||
README.rst
|
||||
ACKS
|
||||
AUTHORS
|
||||
doc/source/index.rst
|
||||
doc/html/
|
|
@ -0,0 +1,3 @@
|
|||
README.rst
|
||||
ACKS
|
||||
AUTHORS
|
|
@ -0,0 +1,3 @@
|
|||
README.rst
|
||||
ACKS
|
||||
AUTHORS
|
|
@ -0,0 +1,73 @@
|
|||
#! /usr/bin/make -f
|
||||
|
||||
# debian/rules
|
||||
# Part of Debian ‘python-lockfile’ package.
|
||||
#
|
||||
# Copyright © 2009–2016 Ben Finney <bignose@debian.org>
|
||||
# This is free software; you may copy, modify, and/or distribute this work
|
||||
# under the terms of the Expat license as published by James Clark.
|
||||
# No warranty expressed or implied.
|
||||
|
||||
export PYBUILD_NAME = lockfile
|
||||
export PYBUILD_TEST_NOSE = 1
|
||||
|
||||
DOC_SRC_DIR = doc/source
|
||||
DOC_HTML_DIR = doc/html
|
||||
|
||||
GENERATED_FILES += ${DOC_HTML_DIR}
|
||||
|
||||
# Send HTTP traffic to the “discard” service during packaging actions.
|
||||
export http_proxy = http://127.0.1.1:9/
|
||||
export https_proxy = ${http_proxy}
|
||||
|
||||
SPHINX = sphinx-build
|
||||
SPHINX_OPTS = -N
|
||||
|
||||
%:
|
||||
dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
|
||||
|
||||
|
||||
.PHONY: get-packaged-orig-source
|
||||
get-packaged-orig-source:
|
||||
$(uscan-download-source) --download-current-version
|
||||
|
||||
# Policy §4.9 strongly recommends the ‘get-orig-source’ target:
|
||||
# “This target is optional, but providing it if possible is a good idea.”
|
||||
#
|
||||
# This target is an anomaly: per Policy §4.9, it fetches the *latest*
|
||||
# upstream source, regardless of this package's version. To fetch the
|
||||
# upstream source corresponding to this package's *declared* version
|
||||
# in ‘debian/changelog’, use ‘get-packaged-orig-source’ instead.
|
||||
.PHONY: get-orig-source
|
||||
get-orig-source:
|
||||
$(uscan-download-source)
|
||||
|
||||
get-orig-source get-packaged-orig-source: http_proxy =
|
||||
get-orig-source get-packaged-orig-source: makefile_dir = $(abspath $(dir $(firstword ${MAKEFILE_LIST})))
|
||||
get-orig-source get-packaged-orig-source: package_dir = $(abspath $(dir ${makefile_dir}))
|
||||
|
||||
define uscan-download-source
|
||||
uscan --noconf --verbose \
|
||||
--force-download \
|
||||
--rename \
|
||||
--destdir=$(CURDIR) \
|
||||
--check-dirname-level=0 ${package_dir}
|
||||
endef # uscan-download-source
|
||||
|
||||
|
||||
.PHONY: override_dh_auto_clean
|
||||
override_dh_auto_clean:
|
||||
$(RM) -r ${GENERATED_FILES}
|
||||
dh_auto_clean
|
||||
|
||||
.PHONY: override_dh_auto_build
|
||||
override_dh_auto_build:
|
||||
dh_auto_build
|
||||
$(SPHINX) ${SPHINX_OPTS} -bhtml ${DOC_SRC_DIR}/ ${DOC_HTML_DIR}/
|
||||
|
||||
|
||||
# Local variables:
|
||||
# mode: makefile
|
||||
# coding: utf-8
|
||||
# End:
|
||||
# vim: filetype=make fileencoding=utf-8 :
|
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
|
@ -0,0 +1,20 @@
|
|||
# debian/tests/control
|
||||
# Control file for Debian ‘autopkgtests’.
|
||||
# Documentation: ‘/usr/share/doc/autopkgtest/README.package-tests.rst.gz’
|
||||
|
||||
Tests: smoke-python2
|
||||
Depends:
|
||||
python-pkg-resources,
|
||||
python-lockfile
|
||||
|
||||
Tests: smoke-python3
|
||||
Depends:
|
||||
python3-pkg-resources,
|
||||
python3-lockfile
|
||||
|
||||
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: conf
|
||||
# End:
|
||||
# vim: fileencoding=utf-8 filetype=conf :
|
|
@ -0,0 +1,47 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# debian/tests/smoke-python2
|
||||
# Part of Debian ‘python-lockfile’ package.
|
||||
#
|
||||
# Copyright © 2016 Ben Finney <bignose@debian.org>
|
||||
# This is free software; you may copy, modify, and/or distribute this work
|
||||
# under the terms of the GNU General Public License, version 3 or later.
|
||||
# No warranty expressed or implied.
|
||||
# See the file ‘/usr/share/common-licenses/GPL-3’ for details.
|
||||
#
|
||||
# Smoke test for package in Python 2 environments.
|
||||
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
|
||||
DISTRIBUTION_NAME=lockfile
|
||||
MODULE_NAMES=(
|
||||
lockfile
|
||||
)
|
||||
|
||||
program_dir="$(dirname "$(realpath --strip "$0")")"
|
||||
|
||||
# Use a working directory away from the source package root,
|
||||
# so that Python imports will not find the local source package.
|
||||
working_dir="$program_dir"
|
||||
cd "$working_dir"
|
||||
|
||||
test_opts="--distribution=$DISTRIBUTION_NAME"
|
||||
for mod in ${MODULE_NAMES[@]} ; do
|
||||
# Accumulate the module names.
|
||||
test_opts="$test_opts --module=$mod"
|
||||
done
|
||||
|
||||
for py in $(pyversions -i) ; do
|
||||
printf "Python command: %s\n" $py
|
||||
$py "$program_dir"/smoke_test.py $test_opts
|
||||
printf "\n"
|
||||
done
|
||||
|
||||
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: shell-script
|
||||
# End:
|
||||
# vim: fileencoding=utf-8 filetype=sh :
|
|
@ -0,0 +1,47 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# debian/tests/smoke-python3
|
||||
# Part of Debian ‘python-lockfile’ package.
|
||||
#
|
||||
# Copyright © 2016 Ben Finney <bignose@debian.org>
|
||||
# This is free software; you may copy, modify, and/or distribute this work
|
||||
# under the terms of the GNU General Public License, version 3 or later.
|
||||
# No warranty expressed or implied.
|
||||
# See the file ‘/usr/share/common-licenses/GPL-3’ for details.
|
||||
#
|
||||
# Smoke test for package in Python 3 environments.
|
||||
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
|
||||
DISTRIBUTION_NAME=lockfile
|
||||
MODULE_NAMES=(
|
||||
lockfile
|
||||
)
|
||||
|
||||
program_dir="$(dirname "$(realpath --strip "$0")")"
|
||||
|
||||
# Use a working directory away from the source package root,
|
||||
# so that Python imports will not find the local source package.
|
||||
working_dir="$program_dir"
|
||||
cd "$working_dir"
|
||||
|
||||
test_opts="--distribution=$DISTRIBUTION_NAME"
|
||||
for mod in ${MODULE_NAMES[@]} ; do
|
||||
# Accumulate the module names.
|
||||
test_opts="$test_opts --module=$mod"
|
||||
done
|
||||
|
||||
for py in $(py3versions -i) ; do
|
||||
printf "Python command: %s\n" $py
|
||||
$py "$program_dir"/smoke_test.py $test_opts
|
||||
printf "\n"
|
||||
done
|
||||
|
||||
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: shell-script
|
||||
# End:
|
||||
# vim: fileencoding=utf-8 filetype=sh :
|
|
@ -0,0 +1,136 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# debian/tests/smoke_test.py
|
||||
#
|
||||
# Copyright © 2016 Ben Finney <bignose@debian.org>
|
||||
# This is free software; you may copy, modify, and/or distribute this work
|
||||
# under the terms of the GNU General Public License, version 3 or later.
|
||||
# No warranty expressed or implied.
|
||||
# See the file ‘/usr/share/common-licenses/GPL-3’ for details.
|
||||
|
||||
""" Post-install Python smoke test for use in Debian autopkgtest.
|
||||
|
||||
Written for both Python 2 and Python 3, to test all installed
|
||||
versions of a package.
|
||||
|
||||
Smoke test the distribution::
|
||||
--distribution=DISTRIBUTION
|
||||
|
||||
Smoke test one or more modules::
|
||||
--module=MODULE_FOO --module=MODULE_BAR --module=MODULE_BAZ
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import importlib
|
||||
import pkg_resources
|
||||
|
||||
|
||||
def emit_implementation():
|
||||
""" Emit the details of the current Python implementation.
|
||||
|
||||
:return: ``None``.
|
||||
|
||||
"""
|
||||
sys.stdout.write(
|
||||
"Interpreter: {command}\n{version}\n".format(
|
||||
command=sys.executable, version=sys.version))
|
||||
|
||||
|
||||
def emit_distribution(name):
|
||||
""" Get the distribution `name` and emit its representation.
|
||||
|
||||
:param name: Name of the distribution to retrieve.
|
||||
:return: ``None``.
|
||||
|
||||
"""
|
||||
distribution = pkg_resources.get_distribution(name)
|
||||
sys.stdout.write(
|
||||
"Distribution ‘{name}’:\n\t{distribution!r}\n".format(
|
||||
name=name, distribution=distribution))
|
||||
|
||||
|
||||
def emit_module(name):
|
||||
""" Import the module `name` and emit the module representation.
|
||||
|
||||
:param name: Full name of the module to import.
|
||||
:return: ``None``.
|
||||
|
||||
"""
|
||||
module = importlib.import_module(name)
|
||||
sys.stdout.write(
|
||||
"Package ‘{name}’:\n\t{module!r}\n".format(
|
||||
name=name, module=module))
|
||||
|
||||
|
||||
def suite(args):
|
||||
""" Run the full suite of tests.
|
||||
|
||||
:param args: Namespace of arguments parsed from `ArgumentParser`.
|
||||
:return: ``None``.
|
||||
|
||||
"""
|
||||
emit_implementation()
|
||||
|
||||
if args.distribution_name:
|
||||
emit_distribution(args.distribution_name)
|
||||
|
||||
for module_name in args.module_names:
|
||||
emit_module(module_name)
|
||||
|
||||
|
||||
class SmokeTestArgumentParser(argparse.ArgumentParser):
|
||||
""" Command-line argument parser for this program. """
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SmokeTestArgumentParser, self).__init__(*args, **kwargs)
|
||||
|
||||
self.add_argument(
|
||||
'--distribution',
|
||||
dest='distribution_name', type=str,
|
||||
metavar="DISTRIBUTION", help=(
|
||||
"Test the Python distribution named DISTRIBUTION."))
|
||||
self.add_argument(
|
||||
'--module',
|
||||
dest='module_names', type=str, nargs='+',
|
||||
metavar="MODULE", help=(
|
||||
"Test the Python module named MODULE."))
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
""" Mainline code for this module.
|
||||
|
||||
:param argv: Sequence of all command line arguments.
|
||||
(Default: `sys.argv`)
|
||||
:return: The exit status (integer) for exit from the process.
|
||||
|
||||
"""
|
||||
exit_status = 0
|
||||
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
||||
try:
|
||||
program_name = argv[0]
|
||||
parser = SmokeTestArgumentParser(prog=program_name)
|
||||
args = parser.parse_args(argv[1:])
|
||||
|
||||
suite(args)
|
||||
|
||||
except SystemExit as exc:
|
||||
exit_status = exc.code
|
||||
|
||||
return exit_status
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit_status = main(sys.argv)
|
||||
sys.exit(exit_status)
|
||||
|
||||
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: python
|
||||
# End:
|
||||
# vim: fileencoding=utf-8 filetype=python :
|
|
@ -0,0 +1,18 @@
|
|||
# debian/watch
|
||||
# Debian uscan file for ‘python-lockfile’ package.
|
||||
# Manpage: ‘uscan(1)’
|
||||
|
||||
# Compulsory line, this is a version 3 file.
|
||||
version=3
|
||||
|
||||
# Current version from Python Package Index.
|
||||
opts=uversionmangle=s/(\d)((?:a|b|c|rc)\d*)$/$1~$2/ \
|
||||
http://pypi.debian.net/lockfile/lockfile-(\S+)\.tar\.(?:gz|bz2|xz) \
|
||||
debian
|
||||
|
||||
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: conf
|
||||
# End:
|
||||
# vim: fileencoding=utf-8 filetype=conf :
|
Loading…
Reference in New Issue