SetupTools deprecation warnings cause python conanfile.py to fail

314 views
Skip to first unread message

benjamin....@u-space.fr

unread,
Jul 19, 2022, 10:13:45 AM7/19/22
to Basilisk Forum
Hello everyone, 

Following updates to my Python distribution, I've encountered a situation where 'python conanfile.py' fails due to several deprecation warning issued by setuptools.

I guess there are two distinct points to discuss here: 

1. These tools are indeed deprecated, and though Basilisk can probably be installed just fine with them as of today, the Basilisk build process probably needs to be revised to account for this impending change

2. Even though these messages are just warnings, they cause the python connafile.py to fail because add_basilisk_to_sys_path() will exit should any message (error or warning) be issued. This is certainly more blocking.

Has this issue been encountered by the BSK developers ? 

Cheers, 
Ben


Error /home/bbercovici/utopia_env/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.

  warnings.warn(
/home/bbercovici/utopia_env/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.


  warnings.warn(
/home/bbercovici/utopia_env/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.


Dave Singh

unread,
Jul 27, 2022, 4:35:36 PM7/27/22
to Basilisk Forum
I'm getting this exact error using Linux on a virtual machine. My next step for debugging was going to be reverting back to Python 3.9 and trying the install again. What OS are you using? 

Hanspeter Schaub

unread,
Jul 28, 2022, 9:48:21 AM7/28/22
to Basilisk Forum
Howdy Benjamin, Are you using Python 3.10?  I don't have much experience with this latest version.  I tend to run 3.9 right now. Revisiting these dependencies is on my list of BSK to do's this fall.  Please post any findings here to share.

Enrique Carlos Toomey

unread,
Aug 1, 2022, 4:35:02 AM8/1/22
to Basilisk Forum
Just found this thread while dealing with the same problem on mac with python 3.9.13. My suggested fix is to replace Popen by run command, as suggested by subprocess docs, with check=True to fail if the command fails. stderr is pipe into stdout and both printed so that warning messages are still visible:

diff --git a/conanfile.py b/conanfile.py
index 39899be50..150cd23c6 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -305,13 +305,8 @@ class BasiliskConan(ConanFile):
         if not is_running_virtual_env() and self.options.autoKey != 's':
             add_basilisk_module_command.append("--user")
 
-        process = subprocess.Popen(add_basilisk_module_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        output, err = process.communicate()
-        if err:
-            print("Error %s while running %s" % (err.decode(), add_basilisk_module_command))
-            sys.exit(1)
-        else:
-            print("This resulted in the output: \n%s" % output.decode())
+        completed_process = subprocess.run(add_basilisk_module_command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True)
+        print("This resulted in the output: \n%s" % completed_process.stdout.decode())
 
 if __name__ == "__main__":
     parser = argparse.ArgumentParser(description="Configure the Basilisk framework.")

Hanspeter Schaub

unread,
Aug 3, 2022, 11:06:01 AM8/3/22
to Basilisk Forum
I've been looking at this issue and have a fix for the depreciation warning.  I'm finding that with Python 3.9.13, and Python 3.10.x I suspect, we need to have the newest `pip` installed.  Following the BSK install instructions, we install `wheel` and `conan`, then run the `conanfile.py` file.  However, I then get the same errors.  however, if I update the `pip` to the latest everything runs fine.  I'm adding code to the conanfile to ensure we are running the latest pip version.  I'm doing another test build this morning on macOS and Linux, and will then push to develop.
Reply all
Reply to author
Forward
0 new messages