Skip to contentSkip to conversation

Require ply to build/install pynfs

PATCH Enji Cooper 1 participant 1 message Feb 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

From a2ebd5b08a659c0a3367fbed7d62cad8ee9d273c Mon Sep 17 00:00:00 2001
From: Enji Cooper <[email protected]>
Date: Wed, 15 Feb 2023 16:21:29 -0800
Subject: [PATCH 17/17] Require ply to build/install pynfs

This particular change enforces the build/install check at two different levels to ensure that the subdirectory's dependencies are explicitly called out, and the overall build/install will halt if ply isn't present.

Sponsored by: Dell EMC Isilon

---
 setup.py     |  7 +++++++
 xdr/setup.py | 10 +++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
setup.py +7 -0
index 4ec5d92..99155bd 100755
@@ -6,6 +6,13 @@ import os
 import subprocess
 import sys
 
+try:
+    import ply
+except ImportError:
+    # Avoid confusing cascading failures due to how xdrgen is imported via
+    # setup.py files in subdirs.
+    sys.exit("You must install ply first.")
+
 DESCRIPTION = """
 pynfs
 ============
xdr/setup.py +7 -3
index 3acb8a2..b5007c0 100644
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-from distutils.core import setup
+from setuptools import setup
 
 DESCRIPTION = """
 xdrgen
@@ -16,8 +16,12 @@ setup(name = "xdrgen",
       scripts = ["xdrgen.py"], # FIXME - make small script that calls module
       description = "Generate python code from .x files",
       long_description = DESCRIPTION,
-      #requires = "ply (>=2.0)",
-
+      install_requires=[
+          "ply >= 2.0",
+      ],
+      setup_requires=[
+          "ply >= 2.0",
+      ],
       # These will be the same
       author = "Fred Isaman",
       author_email = "[email protected]",
Signature · 1 line
2.39.0