[pygobject/drop-win-py2: 2/2] Drop Python 2 support on Windows



commit 981c059fec195eacdf536a439fb2270a2747abf2
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Fri Oct 4 18:53:51 2019 +0200

    Drop Python 2 support on Windows
    
    Fixes #363

 .gitlab-ci.yml | 14 --------------
 meson.build    |  4 ++++
 setup.py       |  3 +++
 3 files changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index be27ed22..7f0149e0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -51,20 +51,6 @@ pages:
   only:
     - master
 
-python2-mingw32:
-  variables:
-    PYTHON: "python2"
-    MSYSTEM: "MINGW32"
-    CHERE_INVOKING: "yes"
-  <<: *mingw-defaults
-
-python2-mingw64:
-  variables:
-    PYTHON: "python2"
-    MSYSTEM: "MINGW64"
-    CHERE_INVOKING: "yes"
-  <<: *mingw-defaults
-
 python3-mingw32:
   variables:
     PYTHON: "python3"
diff --git a/meson.build b/meson.build
index 9cdb1e96..e44f7be0 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,10 @@ platform_version = '@0@.0'.format(pygobject_version_major)
 pymod = import('python')
 python = pymod.find_installation(get_option('python'))
 
+if python.language_version().version_compare('< 3.0') and host_machine.system() == 'windows'
+  error('Python 2 on Windows no longer supported since 3.35. Use Python 3 instead.')
+endif
+
 python_dep = python.dependency()
 
 glib_version_req = '>= 2.48.0'
diff --git a/setup.py b/setup.py
index cf22ab18..0c817f81 100755
--- a/setup.py
+++ b/setup.py
@@ -1111,6 +1111,9 @@ class build_ext(du_build_ext):
             add_ext_compiler_flags(gi_cairo_ext, compiler)
 
     def run(self):
+        if os.name == "nt" and sys.version_info[0] == 2:
+            raise SystemExit("Python 2 on Windows no longer supported since 3.35. Use Python 3 instead.")
+
         self._write_config_h()
         self._setup_extensions()
         du_build_ext.run(self)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]