Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@
"hypothesis",
"kiwisolver",
"numpy",
"pillow",
"pyface",
"pygments",
"pyparsing",
"pillow",
"pypdf2",
"reportlab",
"swig",
"traits",
"traitsui",
"pyface",
"pypdf2",
"swig",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure why you removed swig from the dependencies list here. Without this, swig won't get installed via edm into the python environment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was listed twice, see line 104, I should have mentioned that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh. i should have noticed that things were not in alphabetical order - which i what i was kinda expecting.

can you rearrange the set alphabetically, for readability? this could be done in a later PR

"unittest2",
}

# Dependencies we install from source for cron tests
Expand Down
24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,31 @@ def macos_extensions():
]


def verify_swig_version():
""" Verify we are using swiig version 3.0.x.
"""
msg = ("SWIG is a required build dependency of Enable. Furthermore, there "
"is currently a known issue with SWIG 4.0, "
"see enthought/enable#360. Please install SWIG 3.0.x "
"(see http://www.swig.org/).")
try:
cmd = ["swig", "-version"]
opts = {"stdout": subprocess.PIPE, "encoding": "utf-8"}
with subprocess.Popen(cmd, **opts) as proc:
# We expect text along the lines of "SWIG Version 3.X.Y"
swig_version_match = re.search(
r"(SWIG Version 3)\.\d{1,2}\.\d{1,2}",
proc.stdout.read()
)
if swig_version_match is None:
raise Exception(msg)
except FileNotFoundError:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not entirely sure what raises the FileNotFoundError

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if swig is not installed, then swig -version causes this:

$ brew uninstall swig
Uninstalling /usr/local/Cellar/swig/4.0.2... (725 files, 5.4MB)

(dumb)~/Desktop/enable/dist aayres  (verify-swig-version) $ swig -version
bash: /usr/local/bin/swig: No such file or directory

(dumb)~/Desktop/enable/dist aayres  (verify-swig-version) $ pip install enable-5.1.0.dev287.tar.gz
Processing ./enable-5.1.0.dev287.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/aayres/.edm/envs/dumb/bin/python3 /Users/aayres/.edm/envs/dumb/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/j9/ps8s26f91_1_lgf7mtd4smyr0000gn/T/tmp5st4ag4b
       cwd: /private/var/folders/j9/ps8s26f91_1_lgf7mtd4smyr0000gn/T/pip-req-build-w6n7h3n2
  Complete output (29 lines):
  Traceback (most recent call last):
    File "setup.py", line 439, in verify_swig_version
      stdout=subprocess.PIPE, encoding='utf-8') as proc:
    File "/Users/aayres/.edm/envs/dumb/lib/python3.6/subprocess.py", line 729, in __init__
      restore_signals, start_new_session)
    File "/Users/aayres/.edm/envs/dumb/lib/python3.6/subprocess.py", line 1364, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'swig': 'swig'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/Users/aayres/.edm/envs/dumb/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
      main()
    File "/Users/aayres/.edm/envs/dumb/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/aayres/.edm/envs/dumb/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 91, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/private/var/folders/j9/ps8s26f91_1_lgf7mtd4smyr0000gn/T/pip-build-env-017ig1uv/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 155, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/private/var/folders/j9/ps8s26f91_1_lgf7mtd4smyr0000gn/T/pip-build-env-017ig1uv/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/j9/ps8s26f91_1_lgf7mtd4smyr0000gn/T/pip-build-env-017ig1uv/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 449, in <module>
      verify_swig_version()
    File "setup.py", line 446, in verify_swig_version
      raise Exception(msg)
  Exception: SWIG is a required build dependency of Enable. Furthermore, there is currently a known issue with SWIG 4.0, see enthought/enable#360. Please install SWIG 3.0.x (see http://www.swig.org/).
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/aayres/.edm/envs/dumb/bin/python3 /Users/aayres/.edm/envs/dumb/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/j9/ps8s26f91_1_lgf7mtd4smyr0000gn/T/tmp5st4ag4b Check the logs for full command output.

raise Exception(msg)


if __name__ == "__main__":
verify_swig_version()

# Write version modules as needed
enable_version_path = os.path.join('enable', '_version.py')
write_version_py(filename=enable_version_path)
Expand Down