点击式的包装格式完全独立于设施进行完整系统安装或升级。目前,该软件包应与Python 2.7、3.2、3.3和3.4;Ubuntu 12.04 LTS、Ubuntu 13.10和Ubuntu 14.04 LTS保持兼容性。如果您从一个新的bzr检出运行,请确保首先运行所需的构建依赖项。
$ dpkg-checkbuilddeps
然后运行:
$ ./autogen.sh
$ ./configure --prefix=/usr \
--sysconfdir=/etc \
--with-systemdsystemunitdir=/lib/systemd/system \
--with-systemduserunitdir=/usr/lib/systemd/user
$ make
to build the project.
依赖项
对于Ubuntu 14.04,确保已安装python2.7和python3.4软件包。除非您从以前的Ubuntu版本升级并且尚未删除它,否则您将无法使用Python 3.3和Python 3.2。如果需要,请从源代码构建它们,安装到/usr/local
,并确保它们在您的$PATH
中。您需要安装tox(Ubuntu软件包python-tox)才能运行完整的测试套件。您应该只需执行以下命令。
$ tox
要运行完整的套件。使用tox的-e选项来针对Python版本的子集运行测试。在tox创建的虚拟环境中,您不应该手动安装任何东西,但如果您的系统Python中没有安装所有依赖项,则可能需要手动安装。
引用:
您将需要mock和python-debian库。对于Ubuntu 13.10,
apt-get install以下软件包:
python-mock
python-debian
python3-debian
测试
在安装了上述所有内容之后,您可以使用tox运行测试套件以支持所有受支持的Python版本。" ./run-tests "脚本只是额外检查一下,确保您已经构建了预加载共享库。要运行特定的测试用例,请使用标准python unittest语法:
$ python3 -m unittest click.tests.test_install
or:
$ python2 -m unittest click.tests.test_build.TestClickBuilder.test_build
test coverage If you have python-coverage installed, you can get a
Python test coverage report by typing:
$ python-coverage combine
$ python-coverage report
This works also for
python3-coverage.
To get Vala/C coverage information, install the gcovr and lcov
packages and run:
$ ./configure –enable-gcov
$ make coverage-html
which will generate a
“coveragereport/index.html” file for you.
The combined coverage information can be obtained via:
$ make coverage.xml