Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Windows support #8

Open
pfmoore opened this issue Aug 15, 2023 · 3 comments
Open

Add Windows support #8

pfmoore opened this issue Aug 15, 2023 · 3 comments

Comments

@pfmoore
Copy link

pfmoore commented Aug 15, 2023

From a quick check, the main problems with Windows support seem to be assumptions about how a virtual environment is laid out (hard coded bin directory, the Python executable is python, not python.exe). To make the code cross-platform, it should be possible to use the context object that's used by the venv creation functions. It is documented here for Python 3.12, but with the exception of the lib_path attribute, the rest of the object is available in older versions of Python.

I'd be happy to help with testing on Windows, if you don't have access to the OS.

@daylinmorgan
Copy link
Owner

daylinmorgan commented Aug 15, 2023

if you don't have access to the OS.

Oh I have access just deep dislike, so I avoid when I can... but windows support is a good idea.

I think you're right that mostly only the venv creation handling has unix specific assumptions in it.

@daylinmorgan
Copy link
Owner

There is probably also some logic in the manual installation (viv manage install) that would need to be generalized to properly handle windows paths. Though since folks can't easily run python3 <(curl -fsSL viv.dayl.in/viv.py) anyways it would probably be less common over handling the file themself or just using pip.

@daylinmorgan
Copy link
Owner

There might still be an encoding issue when using viv run -s <remote script> but running packages seems to work fine.

I don't have a lot of first hand experience working around Windows finickiness with encodings. Might be enough to add encoding="utf-8" to the write calls but then again maybe this has to do with user environment settings.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants