setup.py
changeset 48182 01c3dd208c75
parent 48180 f78d8b8c46d7
child 48303 2ce31dbde4b1
--- a/setup.py	Sun Oct 03 20:11:42 2021 -0400
+++ b/setup.py	Fri Oct 08 11:06:03 2021 +0200
@@ -1398,12 +1398,9 @@
 
     rusttargetdir = os.path.join('rust', 'target', 'release')
 
-    def __init__(
-        self, mpath, sources, rustlibname, subcrate, py3_features=None, **kw
-    ):
+    def __init__(self, mpath, sources, rustlibname, subcrate, **kw):
         Extension.__init__(self, mpath, sources, **kw)
         srcdir = self.rustsrcdir = os.path.join('rust', subcrate)
-        self.py3_features = py3_features
 
         # adding Rust source and control files to depends so that the extension
         # gets rebuilt if they've changed
@@ -1451,9 +1448,11 @@
 
         feature_flags = []
 
-        if sys.version_info[0] == 3 and self.py3_features is not None:
-            feature_flags.append(self.py3_features)
-            cargocmd.append('--no-default-features')
+        cargocmd.append('--no-default-features')
+        if sys.version_info[0] == 2:
+            feature_flags.append('python27')
+        elif sys.version_info[0] == 3:
+            feature_flags.append('python3')
 
         rust_features = env.get("HG_RUST_FEATURES")
         if rust_features:
@@ -1575,7 +1574,9 @@
         extra_compile_args=common_cflags,
     ),
     RustStandaloneExtension(
-        'mercurial.rustext', 'hg-cpython', 'librusthg', py3_features='python3'
+        'mercurial.rustext',
+        'hg-cpython',
+        'librusthg',
     ),
 ]