Windows adaption#685
Conversation
lgautier
left a comment
There was a problem hiding this comment.
This looks awesome to have Windows mostly working. Thanks.
I have very minor comments. Even if you cannot solve the crash on exit this could already be helpful to Windows users, I'd be happy to merge it.
| /* include/Rembedded.h */ | ||
| int Rf_initialize_R(int ac, char **av); | ||
| extern void Rf_initEmbeddedR(int argc, char *argv[]); | ||
| extern int Rf_initEmbeddedR(int argc, char *argv[]); |
There was a problem hiding this comment.
My mistake. This should also be the case for Linux.
Fixed upstream in 5c05ae7
There was a problem hiding this comment.
I mean, the change is fine. I have just ported that upstream.
| def iter_info(): | ||
|
|
||
| yield _make_bold('rpy2 version:') | ||
| make_bold = _make_bold_win32 if sys.platform in ('win32', 'nt') \ |
There was a problem hiding this comment.
Is sys.platform in ('win32', 'nt) equivalent to os.name == 'nt' (found in the earlier change https://github.com/rpy2/rpy2/pull/685/files#diff-0832521949e3de64ae94194f4fe521dbR61) ?
There was a problem hiding this comment.
Also, the trailing backslash may make the linter unhappy.
Parenthesis will likely work:
make_bold = (_make_bold_win32 if sys.platform in ('win32', 'nt')
else _make_bold_unix)| yield _make_bold("R's additions to LD_LIBRARY_PATH:") | ||
| yield r_ld_library_path_from_subprocess(r_home) | ||
| # not applicable for Windows | ||
| if sys.platform not in ('win32', 'nt'): |
There was a problem hiding this comment.
See earlier comment/question about sys.platform vs os.name.
Codecov Report
@@ Coverage Diff @@
## master #685 +/- ##
==========================================
- Coverage 91.32% 91.02% -0.31%
==========================================
Files 39 39
Lines 5937 5959 +22
==========================================
+ Hits 5422 5424 +2
- Misses 515 535 +20
Continue to review full report at Codecov.
|
* Fix Windows startup parameters * Make rpy2.situation Windows-friendly * Add R_LIBS_USER to situation output Co-authored-by: dborovkov <[email protected]>
An effort to run rpy2 on Windows via API to R.dll
On my scripts it's running well, but Python process crashes when script terminates