aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python (follow)
Commit message (Collapse)AuthorAgeFilesLines
* python: Fix test environment creation.Justus Winter2017-05-101-1/+0
| | | | | | | * lang/python/tests/Makefile.am (pubring-stamp): Do not depend on the configuration files, this can trigger superfluous rebuilds. Signed-off-by: Justus Winter <[email protected]>
* tests: Make sure to kill all previously running daemons.Justus Winter2017-05-101-0/+1
| | | | | | | | | | | | | | | | * lang/python/tests/Makefile.am: Kill all previously running daemons before creating the private key store. * lang/qt/tests/Makefile.am: Likewise. * tests/gpg/Makefile.am: Likewise. * tests/gpgsm/Makefile.am: Likewise. -- Now that the daemons sockets are no longer created in the GNUPGHOME, we cannot rely on cleaning the build directory to make sure they are shut down. Therefore, we explicitly kill any running daemons when creating the test environment. Signed-off-by: Justus Winter <[email protected]>
* tests: Harmonize test suites.Justus Winter2017-05-101-1/+4
| | | | | | | | | | | | * lang/python/tests/Makefile.am: Create test environment as part of 'make all'. * tests/gpg/Makefile.am: Make sure the private keystore is created first. * tests/gpgsm/Makefile.am: Create test environment as part of 'make all'. Make sure the private keystore is created first. Signed-off-by: Justus Winter <[email protected]>
* python: Skip TOFU test if not supported by GnuPG.Justus Winter2017-04-112-0/+11
| | | | | | | | * lang/python/tests/support.py (have_tofu_support): New function. * lang/python/tests/t-quick-key-manipulation.py: Skip TOFU test if not supported by GnuPG. Signed-off-by: Justus Winter <[email protected]>
* python: use autoconf pre-processor when building via autoconfAlon Bar-Lev2017-04-111-0/+4
| | | | | | | * configure.ac: Add AC_PROG_CPP. * lang/python/Makefile.am: Set CPP environment for setup.py to use. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: fix run-tests missing python_libdirAlon Bar-Lev2017-04-111-1/+3
| | | | | | | * lang/python/tests/run-tests.py: Set python_libdir if --python-libdir is set. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: Prune CLEANFILES.Justus Winter2017-04-101-3/+1
| | | | | | -- Fixes-commit: e7d9c0c3d773f826dbd2ed417d04e25c410f3374 Signed-off-by: Justus Winter <[email protected]>
* python: Fix distcheck.Justus Winter2017-04-101-2/+2
| | | | | | | | | * lang/python/Makefile.am (uninstall-local): Explicitly request the scheme 'posix_prefix'. On Python2.7 the default scheme is 'posix_local', breaking distcheck. Fixes-commit: 25e6444b3f4601c7821beab06bc4520deacb007b Signed-off-by: Justus Winter <[email protected]>
* python: Support alternatate libdir for testsAlon Bar-Lev2017-04-101-10/+15
| | | | | | | | | | | | * lang/python/tests/run-tests.py: Add --python-libdir optional parameter. -- This will make the python tests usable for downstream that build python module outside of autotools build system. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: Read gpg-error.h using the pre-processorAlon Bar-Lev2017-04-101-25/+35
| | | | | | | | | | | | | | | * lang/python/setup.py.in: Read gpg-error.h using the pre-processor. -- The libgpg-error may be installed in multilib configuration in which there is a wrapper header at /usr/include that includes the actual header at /usr/include/*. This causes invalid errors.i generation. Let the pre-processor extract the header content instead reading it explicitly. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: Remove unneeded stats copyAlon Bar-Lev2017-04-101-6/+0
| | | | | | | * lang/python/setup.py.in: errors.i, gpgme.h are generated and always newer than the original. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: Remove usage of PYTHON_VERSIONSAlon Bar-Lev2017-04-102-14/+13
| | | | | | | | | | | | | | | | | | | | | * configure.ac: Remove PYTHON_VERSIONS subst. * lang/python/Makefile.am: Use basename of python as builddir prefix. * lang/python/tests/run-tests.py: Likewise. -- Two variables needs be at sync PYTHONS and PYTHON_VERSIONS, these may go out of sync in some cases, for example in Gentoo where default python is 3.4 we get: PYTHON='/usr/bin/python2' PYTHONS='/usr/bin/python /usr/bin/python2' PYTHON_VERSIONS='2.7 3.4' We can use the basename of the python interpreter to achieve similar effect without having to sync indexes between these two variables. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: support .pydistutils.cfg modeAlon Bar-Lev2017-04-101-15/+10
| | | | | | | | | | | * lang/python/setup.py.in: Do not parse arguments. -- The distutils settings can come from either command-line or configuration file. Parsing parameters is not working in all cases. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: simplify build, some fixupsAlon Bar-Lev2017-04-0730-39/+23
| | | | | | | | | | | | | | | | | | | | | * lang/python/gpg/version.py.in: Rename to lang/python/version.py.in. configure.ac: Generate version.py.in in lang/python. * lang/python/MANIFEST.in: Include version.py explicitly. * lang/python/gpg: Rename to 'src'. * lang/python/Makefile.am: Do not copy source files, do not use absolute directories, support lib64 in uninstall, clean also dist directory, use symlink for gpg src. * lang/python/setup.py.in: Use builddir, copy sources into builddir, copy version.py into module. -- Simplify build to symlink the gpg sources into builddir instead of copying. This requires handling of version.py as generated file. In addition apply some cleanups: Drop the absolution pathes, clean the dist directory as well, support lib64 for sitelib at uninstall. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: Fix vpath builds, fix distcheck.Justus Winter2017-04-054-75/+92
| | | | | | | | | | | | | | | | | | | | * lang/python/gpgme-h-clean.py: Delete file. * lang/python/MANIFEST.in: Adapt accordingly. * lang/python/Makefile.am (EXTRA_DIST): Likewise. (COPY_FILES_GPG): Bring variable back. (copystamp): Copy files. (clean-local): Delete copied files. (install-exec-local): Do not create and install list of installed files. (uninstall-local): Instead, create some explicit rules to uninstall the extension. * lang/python/setup.py.in: Parse arguments. Locate files either in the source directory, or in the build base directory. Inline the code from 'gpgme-h-clean.py'. Copy 'helpers.c', add source directory as include directory. Fixes-commit: 801d7d8c5dd530d26ad6c4bcc94d986e6e022da4 Signed-off-by: Justus Winter <[email protected]>
* python: Generate files into build directoryAlon Bar-Lev2017-04-053-64/+64
| | | | | | | | | | | | | | | | * lang/python/setup.py.in: Generate files within BuildExtFirstHack adjust build flags at this point instead of global. * lang/python/Makefile.am: Remove logic of separate source directory per python version in favor of build directory. * lang/python/tests/run-tests.py: Adjust build directory location. -- Generate files into build directory, leaving the source directory clean. Use the same source directory for multiple python version build. Result of 'prepare' target is a standard distutil layout that can be used easily by downstream to build all python targets in-place. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: Don't treat skipped tests as errorAndre Heinecke2017-03-301-1/+1
| | | | | * lang/python/tests/run-tests.py (failed): Don't count skipped tests for the return code.
* python: Fix skipping tests if running with GnuPG < 2.1.12.Justus Winter2017-03-3014-8/+17
| | | | | | | | | | | | | | | | | | | | | | * final.py: Import 'support.py' for the side-effect of checking the GnuPG version. * t-data.py: Likewise. * t-protocol-assuan.py: Likewise. * t-wrapper.py: Likewise. * t-callbacks.py: Avoid warning about 'support' being unused. * t-edit.py: Likewise. * t-encrypt-sym.py: Likewise. * t-file-name.py: Likewise. * t-idiomatic.py: Likewise. * t-sig-notation.py: Likewise. * t-trustlist.py: Likewise. * t-verify.py: Likewise. * t-wait.py: Likewise. * t-keylist-from-data.py: Trim unused imports. GnuPG-bug-id: 3008 Fixes-commit: 348da58fe0c3656e6177c98fef6b4c4331326c8e Signed-off-by: Justus Winter <[email protected]>
* python,build: Reinstate prepare target.Alon Bar-Lev2017-03-292-14/+20
| | | | | | | | | | | | | * lang/python/Makefile.am: Fix 'prepare' target. * lang/python/setup.py.in: Use 'abs_top_builddir' instead of guessing the path. -- 'prepare' will prepare target at PREPAREDIR. The automake integration will also make use of prepare target. Downstream distributors may also make use of prepare target. Signed-off-by: Alon Bar-Lev <[email protected]>
* python: Skip tests if running with GnuPG < 2.1.12.Justus Winter2017-03-271-1/+6
| | | | | | | | * lang/python/tests/support.py (assert_gpg_version): Fix error message. Skip all tests when we use GnuPG older than 2.1.12. GnuPG-bug-id: 3008 Signed-off-by: Justus Winter <[email protected]>
* python: Wrap 'gpgme_op_keylist_from_data_start'.Justus Winter2017-03-215-5/+242
| | | | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.keylist): New keyword argument 'source'. If given, list keys from 'source'. * lang/python/gpgme.i: Wrap the argument to 'gpgme_op_keylist_from_data_start'. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/support.py (EphemeralContext): Do not throw an error if no agent has been started in the context. * lang/python/tests/t-keylist-from-data.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Fix version check.Justus Winter2017-03-201-1/+3
| | | | | | | | * lang/python/tests/support.py (assert_gpg_version): Cope with non-released versions. Fixes-commit: e1cf8bab319ba1dea41ba5d711dbb66ffd8e6fd6 Signed-off-by: Justus Winter <[email protected]>
* tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable.Justus Winter2017-03-201-1/+0
| | | | | | | | | | | * lang/python/tests/Makefile.am (gpg-agent.conf): Do not hard-code the option. This breaks gpg-agent from GnuPG 2.0. * tests/start-stop-agent: Rather, check if the option is supported and add it to the configuration if it is. GnuPG-bug-id: 3008 Fixes-commit: bbf19124bbec9eb6298cef2914baae7ac74382fe Signed-off-by: Justus Winter <[email protected]>
* python: Skip tests if GnuPG is too old.Justus Winter2017-03-207-0/+16
| | | | | | | | | | | | | | * lang/python/tests/support.py (assert_gpg_version): New function. * lang/python/tests/t-callbacks.py: Use the new function to skip the test if GnuPG is too old. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-quick-key-creation.py: Likewise. * lang/python/tests/t-quick-key-manipulation.py: Likewise. * lang/python/tests/t-quick-key-signing.py: Likewise. GnuPG-bug-id: 3008 Signed-off-by: Justus Winter <[email protected]>
* python: Remove superfluous initialization.Justus Winter2017-03-2021-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/tests/support.py (init_gpgme): Remove. This is an remnant from the c tests. Nowadays, the Python bindings initialize GPGME automagically. * lang/python/tests/initial.py: Remove call to 'support.init_gpgme'. * lang/python/tests/t-callbacks.py: Likewise. * lang/python/tests/t-decrypt-verify.py: Likewise. * lang/python/tests/t-decrypt.py: Likewise. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-large.py: Likewise. * lang/python/tests/t-encrypt-sign.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-export.py: Likewise. * lang/python/tests/t-file-name.py: Likewise. * lang/python/tests/t-idiomatic.py: Likewise. * lang/python/tests/t-import.py: Likewise. * lang/python/tests/t-keylist.py: Likewise. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-sign.py: Likewise. * lang/python/tests/t-signers.py: Likewise. * lang/python/tests/t-trustlist.py: Likewise. * lang/python/tests/t-verify.py: Likewise. * lang/python/tests/t-wait.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Make error message more helpful.Justus Winter2017-03-141-6/+11
| | | | | | | * lang/python/tests/run-tests.py: Make the error message shown when we cannot locate the python module in the build tree more helpful. Signed-off-by: Justus Winter <[email protected]>
* python: Make tests more robust.Justus Winter2017-03-141-11/+10
| | | | | | | | | * lang/python/tests/support.py (TemporaryDirectory): Always use our own version even if 'tempfile.TemporaryDirectory' is provided, because we need to use 'shutil.rmtree(..., ignore_errors=True)' to avoid it tripping over gpg-agent deleting its own sockets. Signed-off-by: Justus Winter <[email protected]>
* python: Improve build system integration.Justus Winter2017-03-141-11/+10
| | | | | | | * lang/python/Makefile.am: Use 'set -e' when chaining shell commands together in rules. Signed-off-by: Justus Winter <[email protected]>
* python: Print path of the Python module used during tests.Justus Winter2017-03-021-0/+3
| | | | | | | | * lang/python/tests/initial.py: Print path of the Python module used during tests. Useful to detect if by any mistake the wrong module is picked up. Signed-off-by: Justus Winter <[email protected]>
* python: Fix test.Justus Winter2017-02-201-1/+2
| | | | | | | | | * lang/python/tests/t-quick-key-manipulation.py: Modify the configuration file in the ephemeral home directory, not the one used by all the tests. Fixes-commit: 15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5 Signed-off-by: Justus Winter <[email protected]>
* python: Support manipulating the TOFU policy.Justus Winter2017-02-177-3/+100
| | | | | | | | | | | | | | * NEWS: Update. * doc/gpgme.texi: Fix typos. * lang/python/gpg/constants/__init__.py: Import new files. * lang/python/gpg/constants/tofu/__init__.py: New file. * lang/python/gpg/constants/tofu/policy.py: New file. * lang/python/gpg/core.py (Context.key_tofu_policy): New function. * lang/python/gpgme.i: Nice reprs for gpgme_tofu_info_t. * lang/python/setup.py.in: Install new package. * lang/python/tests/t-quick-key-manipulation.py: Extend test. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick key signing.Justus Winter2017-02-175-3/+190
| | | | | | | | | | | | | * NEWS: Update. * doc/gpgme.texi (gpgme_op_keysign): Fix the description of the 'expire' argument. * lang/python/gpg/constants/__init__.py: Import new file. * lang/python/gpg/constants/keysign.py: New file. * lang/python/gpg/core.py (Context.key_sign): New function. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/t-quick-key-signing.py: New test. Signed-off-by: Justus Winter <[email protected]>
* python: Fix teardown of ephemeral contexts.Justus Winter2017-02-174-260/+250
| | | | | | | | | | | | | | | | | | * lang/python/tests/support.py (EphemeralContext): New function. * lang/python/tests/t-quick-key-creation.py: Use the new function to manage ephemeral contexts. * lang/python/tests/t-quick-key-manipulation.py: Likewise. * lang/python/tests/t-quick-subkey-creation.py: Likewise. -- Previously, there was a problem with cleaning up ephemeral home directories. shutil.rmtree deleted the agents main socket, gpg-agent detected that, and deleted the other sockets as well, racing shutil.rmtree which did not cope will with that. Fix this by asking the agent nicely to shut down. Signed-off-by: Justus Winter <[email protected]>
* python: Fix using strings as commands in the assuan protocol.Justus Winter2017-02-172-4/+7
| | | | | | | | | * lang/python/gpg/core.py (Context.assuan_transact): Fix testing whether the command is a string on Python2. * lang/python/tests/t-protocol-assuan.py: Improve the test to detect this problem. Signed-off-by: Justus Winter <[email protected]>
* python: Support adding and revoking UIDs.Justus Winter2017-02-163-1/+129
| | | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.key_add_uid): New function. (Context.key_revoke_uid): Likewise. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/t-quick-key-manipulation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick subkey creation.Justus Winter2017-02-163-1/+195
| | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.create_subkey): New function. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/t-quick-subkey-creation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick key creation.Justus Winter2017-02-166-5/+275
| | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/constants/__init__.py: Import new file. * lang/python/gpg/constants/create.py: New file. * lang/python/gpg/core.py (Context.create_key): New function. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/support.py (TemporaryDirectory): New class. * lang/python/tests/t-quick-key-creation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Fix passphrase callback wrapping.Justus Winter2017-02-161-1/+15
| | | | | | | * lang/python/helpers.c (pyPassphraseCb): Cope with 'passphrase_info' being NULL. Signed-off-by: Justus Winter <[email protected]>
* python: Fix error handling.Justus Winter2017-02-161-1/+6
| | | | | | | * lang/python/gpgme.i (typemap gpgme_key_t[]): Set an error if a non-key element is discovered. Signed-off-by: Justus Winter <[email protected]>
* python: Fix build system integration.Justus Winter2017-02-152-19/+20
| | | | | | | | | | | | | * lang/python/Makefile.am (copystamp): Also copy the setup script, and link the header files. (all-local): Use local setup script. (sdist): Fix Python source distribution creation. (CLEANFILES): Remove now obsolete files. (install-exec-local): Use local setup script. * lang/python/setup.py.in: Adjust relative paths to in-tree files. Fixes-commit: fe65a26ab584bd70fad45c7c4d44330e30a748a4 Signed-off-by: Justus Winter <[email protected]>
* python: Update lists of functions returning gpgme_error_t.Justus Winter2017-02-151-6/+18
| | | | | | | | | * lang/python/gpg/core.py (Context._errorcheck): Add instructions how to update the list. Update list. (Data._errorcheck): Likewise. (Context.set_engine_info): Simplify. Signed-off-by: Justus Winter <[email protected]>
* python: Wrap utility functions.Justus Winter2017-02-142-0/+51
| | | | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (pubkey_algo_string): New function. (pubkey_algo_name): Add docstring. (hash_algo_name): Likewise. (get_protocol_name): Likewise. (addrspec_from_uid): New function. * lang/python/gpgme.i (gpgme_pubkey_algo_string): Result must be freed. (gpgme_addrspec_from_uid): Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Use the correct function to free buffers.Justus Winter2017-02-141-1/+1
| | | | | | * lang/python/gpgme.i (char *): Free using 'gpgme_free'. Signed-off-by: Justus Winter <[email protected]>
* python: Add keylist mode parameter.Justus Winter2017-02-141-2/+5
| | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.keylist): Add 'mode' parameter. Signed-off-by: Justus Winter <[email protected]>
* python: Nicer repr for user ids.Justus Winter2017-02-141-0/+4
| | | | | | | * lang/python/gpgme.i (_gpgme_user_id): Provide a nicer repr() for user ids. Signed-off-by: Justus Winter <[email protected]>
* python: Add convenience functions for the home directory.Justus Winter2017-02-141-2/+12
| | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.__init__): Add 'home_dir' argument. (__repr__): Include 'home_dir'. (Context.home_dir): New property. Signed-off-by: Justus Winter <[email protected]>
* python: Extend SWIG gpgme_{sub,}key with a __repr__ method.Tobias Mueller2017-02-141-0/+27
| | | | | | | | | | | | | | | | | | | * lang/python/gpgme.i: Added a genericrepr macro and use it for gpgme_key, gpgme_subkey, and gpgme_key_sig. -- To look nicer in Python's REPL. We define a generic __repr__ as a SWIG macro and use that to extend some defined SWIG objects. The alternative would have been to write a custom __repr__ function for each class but that would need to be changed everytime the object's structure changes. The bindings should be easy to maintain, I guess. This comes at the expense that the reprs are now relatively long and contain, for example, both keyid and fingerprint. Signed-off-by: Tobias Mueller <[email protected]>
* python: Remove the -builtin flag for SWIG.Tobias Mueller2017-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/setup.py.in: Call SWIG without the builtin flag. -- The SWIG documentation <http://www.swig.org/Doc2.0/Python.html#Python_nn28> leaves the impression that -builtin is solely for increasing performance: New in SWIG version 2.0.4: The use of Python proxy classes has performance implications that may be unacceptable for a high- performance library. The new -builtin option instructs SWIG to forego the use of proxy classes, and instead create wrapped types as new built-in Python types. When this option is used, the following section ("Proxy classes") does not apply. Details on the use of the -builtin option are in the Built-in Types section. While not wasting CPU cycles is good, it also prevents Python code being written in the wrapper itself. That, however, may be useful to make it easier to extend the wrapper. Partially reverts: 856bcfe2934237011984fab0bc69800a7c25c34b Signed-off-by: Tobias Mueller <[email protected]>
* python: Call SWIG_NewPointerObj rather than SWIG_Python_NewPointerObj.Tobias Mueller2017-02-141-1/+11
| | | | | | | | | | | | | | | | | | | | * lang/python/gpgme.i (pygpgme_wrap_gpgme_data_t): Provide a "self" variable for SWIG_NewPointerObj and call SWIG_NewPointerObj rather than SWIG_Python_NewPointerObj. -- SWIG_Python_NewPointerObj seems to be an implementation detail, because SWIG's documentation does not mention that function at all. In fact, SWIG_NewPointerObj is a call to SWIG_Python_NewPointerObj with the first parameter being either NULL or the "self" variable, depending on whether SWIG is called with the -builtin flag. So far, the first parameter was hard-coded to NULL. This change also hard-codes it to NULL but makes it more explicit. The benefit is that the documented function is being used and that compilation works regardless of the -builtin flag. Partially reverts: 856bcfe2934237011984fab0bc69800a7c25c34b Signed-off-by: Tobias Mueller <[email protected]>
* python: Conditionally provide py3 argument to SWIGTobias Mueller2017-02-141-2/+3
| | | | | | | | | | | | | | | * lang/python/setup.py.in: Only call with -py3 when we run under python3 or higher. -- If we ever remove the -builtin flag and leave the the -py3 flag, SWIG will generate Python code which will be incompatible with Python 2, because the py3 flag generates python3 code which is incompatible with python2. So we conditionally generate SWIG bindings with -py3. Signed-off-by: Tobias Mueller <[email protected]>