aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/setup.py.in
diff options
context:
space:
mode:
authorBen Greiner <[email protected]>2024-05-29 13:17:58 +0000
committerIngo Klöcker <[email protected]>2024-05-29 15:04:10 +0000
commit5844d9e700239ad10a5956cd7789bd02360bb0fa (patch)
treef1fb2aa4bcb63fe19c99562df4fc4d9775dde72a /lang/python/setup.py.in
parenttests: Add new files to distribution (diff)
downloadgpgme-5844d9e700239ad10a5956cd7789bd02360bb0fa.tar.gz
gpgme-5844d9e700239ad10a5956cd7789bd02360bb0fa.zip
build,python: Build Python bindings without distutils
* m4/python.m4: Add python3.12 and 3.11 as valid interpreters, remove EOL 3.4, 3.5, 3.7 (keep 3.6 because some distributions still ship and maintain it). * lang/python/Makefile.am (clean-local): Remove dist and gpg.egg-info created by Python 3.9+ on make install. * lang/python/setup.py.in: switch from distutils to setuptools where possible, remove obsolete and deprecated -py3 option of swig, add classifiers up to 3.12, remove 3.4, 3.5, 3.7. * lang/python/doc/src/gpgme-python-howto.org: replace distutils with setuptools * lang/python/examples/howto/advanced/cython/setup.py: replace distutils with setuptools -- This fixes building the Python bindings for Python 3.12 where distutils has been removed. Based on D545
Diffstat (limited to '')
-rwxr-xr-xlang/python/setup.py.in19
1 files changed, 12 insertions, 7 deletions
diff --git a/lang/python/setup.py.in b/lang/python/setup.py.in
index 6f36861d..7b64ba7b 100755
--- a/lang/python/setup.py.in
+++ b/lang/python/setup.py.in
@@ -18,8 +18,12 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from distutils.core import setup, Extension
-from distutils.command.build import build
+try:
+ from setuptools import setup, Extension
+ from setuptools.command.build import build
+except ImportError:
+ from distutils.core import setup, Extension
+ from distutils.command.build import build
import glob
import os
@@ -225,9 +229,8 @@ class BuildExtFirstHack(build):
build.run(self)
-py3 = [] if sys.version_info.major < 3 else ['-py3']
swig_sources = []
-swig_opts = ['-threads'] + py3 + extra_swig_opts
+swig_opts = ['-threads'] + extra_swig_opts
swige = Extension(
'gpg._gpgme',
sources=swig_sources,
@@ -282,10 +285,12 @@ GPGME and these bindings is available here:
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
+ 'Programming Language :: Python :: 3.12',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Topic :: Communications :: Email',