-
Notifications
You must be signed in to change notification settings - Fork 106
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
make script compatible to pypy / having scripts in bin #95
Conversation
…pied into most scripts with varying levels of fidelity. This is an attempt to collect these into one file, and also to make the work in #95 easier to implement.
Hi @wamserma and thank you for the PR, it's really appreciated. I see a few problems that needs to be fixed before I can merge this.
This will always succeed for users that have a (default) pypy installed on As an aside: Escaping env vars: You are defining a couple of environment variables that escape to the user's environment after the script is run (e.g. We have a number of environment variables that historically have escaped (e.g.
and then clean them up at the end using a for loop:
(I've started to document some of this on the docs branch if you're interested, e.g.: https://github.com/davidmarble/virtualenvwrapper-win/blob/docs/docs/codingstyle.rst) Duplication: There's a lot of duplicated setup code. This isn't your fault (at all), but your additions certainly puts a spotlight on this problem. For a while I've toyed with creating a script that would run the setup code and could be called from every other script. I've just pushed such a script now ( NB: As per now, the Bookkeeping: You should add a bullet in CHANGELOG.rst (it can be as simple as "added pypy support @wamserma ") |
Mmmh yes, this was just a quick batch edit to get things rolling for me. To be honest, I always assumed that one was checking for the availability of pypy.exe outside of the VirtualEnv. Edit: Regarding errorlevel, I know that this is a GTE-check. I'll put it on the review-list, though. |
Added pypy-support
There are two situations that need to be handled with respect to pypy/python.
In a few situations virtualenvwrapper-win uses py(py|thon) to execute commands that are unruly in .bat. Great care is taken so the Python code used is universal (can be ran on all supported Python versions). Up until now the Apparently it is possible to run post-install code (re. checking for pypy from the outside)[1], but that only solves half the problem.
Yes, stay away from setlocal whenever possible. Using a name that is unique and unsetting it at the end is preferrable.
That is certainly a possibility, and one that I've contemplated a couple of times. The natural choice for preprocessor would be Jinja2 if you're interested in going this route. It would also require an extra step during the build/publish(/test?) phase.
Excellent. The only thing that's coming from me in the near/medium future is a full hook implementation, but it shouldn't interfere with this PR. |
* upstream/master: upversion debug leftover Typo fix in CHANGELOG.rst Getting ready for next release.. Publish the vwenv.bat script. It's starting to be a lot of setup that needs to be done, and it's copied into most scripts with varying levels of fidelity. This is an attempt to collect these into one file, and also to make the work in davidmarble#95 easier to implement. Push 1.2.4 to PyPI. Fix workon, rmvirtualenv, and mkvirtualenv -a when virtualenv and/or project contain spaces. This fixes davidmarble#89. Remove debug echo. Fix 3 failing tests (test-code issues). "Number" headers in CHANGELOG similar to README (the files are concatenated and must match). Updates to add2virtualenv to fix davidmarble#93. Tests for add2virtualenv and setprojectdir. Convert tabs to spaces, fix som issues with spaces in paths, and exit with a distinct error level for each error. Make sure we call cleanup, even on a successful run, and set ERRORLEVEL to zero. Missing return from error_msg. Add support for -h, --help switches, and fix davidmarble#92. Add support for -h --help options, and fix davidmarble#92. tests for mkproject Add publishing step that checks syntax of the reStructuredText in README.rst. updated mkproject to follow coding style of mkvirtualenv. updated readme and changelog as requested. New commands need to be installed.. Add virtualenvwrapper.bat command: Print a list of commands and their descriptions as basic help output. (The linux version has it: https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html#virtualenvwrapper) Added top-comment and usage block to whereis.bat Changed some awkward verbiage in README.rst Missed a goto:eof.. Fix a number of issues with spaces in virtualenv names in rmvirtualenv.bat and simplified the removal algorithm. Allow spaces in virtualenv names. Start next version. Added mkproject script (with better default PROJECT_HOME) to setup.py upversion Added invoke tasks.py file. ignore PyCharm files Grab fix for path with env-var issue from @nakedmin2017 (nakedmind2017@de4ada2) virtualenv doesn't need an equal sign for parameters with double dashes, fixes davidmarble#86. Fix for davidmarble#85. Fix other potential dir-with-spaces problems. Test for davidmarble#85 Add -k option to run_tests.bat for running single tests. Fix (?) PyPI barfing on readme. Bump Version Release notes for v1.2.2 Implement -a, -i, and -r options to mkvirtualenv. This is a little bit of a hefty rewrite, but it's needed to be able to handle some options, and let other options through to virtualenv. Start of test-suite.
As I've moved to greener pastures (mostly non-Windows) I'm abandoning this PR, releasing it to the public domain. |
I had a take on #30
Works for me, had no issues so far.