-
Notifications
You must be signed in to change notification settings - Fork 45
verify swig version in setup.py #811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
38ac19c
verify swig version in setup.py
aaronayres35 1e9e6da
Apply suggestions from code review
aaronayres35 426c106
pull out a verify_swig_version function
aaronayres35 1cd1298
alphabetize deps and remove unittest2
aaronayres35 34b7fe7
use regex
aaronayres35 f520c3c
Nitpicky formatting
jwiggins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm not entirely sure what raises the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if |
||
| 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) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
swigfrom the dependencies list here. Without this,swigwon't get installed via edm into the python environment.There was a problem hiding this comment.
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
There was a problem hiding this comment.
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