setup.py
branchstable
changeset 48315 a44bb185f6bd
parent 48303 2ce31dbde4b1
child 48423 fff5942d445f
child 48743 a1538c05d855
--- a/setup.py	Tue Nov 09 02:19:43 2021 +0100
+++ b/setup.py	Tue Nov 09 21:56:04 2021 +0530
@@ -1428,12 +1428,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
@@ -1481,9 +1478,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:
@@ -1605,7 +1604,9 @@
         extra_compile_args=common_cflags,
     ),
     RustStandaloneExtension(
-        'mercurial.rustext', 'hg-cpython', 'librusthg', py3_features='python3'
+        'mercurial.rustext',
+        'hg-cpython',
+        'librusthg',
     ),
 ]