Skip to content
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

test convert's handling of win entry points better. Fix it. #1721

Merged
merged 7 commits into from
Feb 5, 2017

Conversation

msarahan
Copy link
Contributor

@msarahan msarahan commented Feb 3, 2017

Fixes #1718

also some flake8 in here.

CC @bryevdv @gomyhr

@msarahan
Copy link
Contributor Author

msarahan commented Feb 3, 2017

Sorry, just realized this won't quite work yet. I have to be less lazy and actually compute the file attributes for the bat file, or else conda will probably barf. I'll test that.

@msarahan
Copy link
Contributor Author

msarahan commented Feb 3, 2017

OK, should be working now. I have tested that this really works by building the recipe for the test entry points on OS X. I ran conda-convert in windows, targeting windows output. I installed the package from the converted output (note that dependencies were not installed, because installing paths with conda doesn't install dependencies. =( ) The entry points all work.

@gomyhr, I'd feel even better about this if you tested it and made sure that it works for you. Do you have time?

@msarahan msarahan force-pushed the fix_convert_win_entry_points branch from 3ee9249 to 1396737 Compare February 3, 2017 23:11
@msarahan msarahan force-pushed the fix_convert_win_entry_points branch from 1396737 to eb96270 Compare February 3, 2017 23:13
@@ -32,7 +32,7 @@
@echo off
set PYFILE=%~f0
set PYFILE=%PYFILE:~0,-4%-script.py
"%~f0\\..\\..\\python.exe" "%PYFILE%" %*
"%~dp0\..\python.exe" "%PYFILE%" %*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure that the entry point scripts ever worked. This expression was just wrong.

Copy link

Choose a reason for hiding this comment

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

The entry points worked fine before, but the new version is more direct (and maybe more robust). The old one would be

C:\path\to\anaconda\Scripts\entrypoint.bat\\..\\..\\python.exe

which works, although somewhat convoluted (and the double slashes are unneccessary). The new one gives

C:\path\to\anaconda\Scripts\..\python.exe

which is more direct.

Windows is actually very forgiving in evaluating paths with .., as this example shows:

C:\Users\gom\AppData\Local\Continuum\Miniconda2>this\path\\does\not\\\exist\thisfileneither.exe\..\..\..\..\..\..\python.exe --version
Python 2.7.12 :: Continuum Analytics, Inc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow! Makes sense, I guess. It must just do the parsing of all the .. before anything else. Thanks for teaching me.

@msarahan msarahan force-pushed the fix_convert_win_entry_points branch 2 times, most recently from d762557 to 40acb03 Compare February 4, 2017 03:09
@msarahan msarahan force-pushed the fix_convert_win_entry_points branch from 40acb03 to b4b1f7e Compare February 4, 2017 03:16
@gomyhr
Copy link

gomyhr commented Feb 4, 2017

@msaharan, I will have time to test - if not on the weekend, then probably on Monday.

@gomyhr
Copy link

gomyhr commented Feb 4, 2017

I have tested, and it works - both the test package described above and another package that I tried.

@gomyhr
Copy link

gomyhr commented Feb 4, 2017

I should also mention that I tried to review the commits, but I had to give up as most of them included additional changes, and e.g. what commit eb96270 does, seems unrelated to its commit message "copy data into -script.py/pyc files"

@msarahan
Copy link
Contributor Author

msarahan commented Feb 4, 2017

@gomyhr, thanks for testing. I do sometimes put too much into commits. The one you point out is actually not a case of that, though. Before that commit, what was happening was that the bat file and the py file generated we both just the bat file stub. The actual script was getting lost in the conversion.

@msarahan msarahan merged commit 9a01114 into conda:master Feb 5, 2017
@github-actions
Copy link

github-actions bot commented May 5, 2022

Hi there, thank you for your contribution!

This pull request has been automatically locked because it has not had recent activity after being closed.

Please open a new issue or pull request if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label May 5, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

conda-convert does not update entry points in paths.json
2 participants