-
Notifications
You must be signed in to change notification settings - Fork 59
HATCH tutorials update: Provide CLI example commands for Windows users #240
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
Comments
It would be great if we could provide examples for native Windows users, as we do for POSIX users. We very occasionally reference command differences between command examples for those on Windows, but we don't every provide them as alternative top-level sample code. We do IME try to craft commands in such a way they they will work unaltered on the most systems possible, but it is not always possible. The As a possible solution, we could adopt tabbed code callouts, using a library like https://sphinx-tabs.readthedocs.io/en/latest/ or https://pypi.org/project/sphinx-code-tabs/ (although using an extension directive could limit our ability to do other more advanced code examples like #239). One thing to decide is which environment to target as the native Windows environment. I would say that all of WLS(2), git-bash, cygwin, mingw, msys2 can be skipped as our POSIX examples should already generally work there. That leaves either a |
Also, this is strongly related to #134 |
All excellent points! And good eye on noting the other issue re. general unfamiliarity with command line use. Sounds like it is time for me to install hatch under Windows, and try out the various options. I had better not offer to do this until after Tax Day, though. 😁 |
Just FYI, I have not forgotten...just got swamped with other things. |
oh no worries @ptressel i just spent some time today trying to wrap up issues and pr's and am behind as well ✨ i think the windows tabs idea is a great one. the challenge that i have personally is that i don't have a windows computer / vm here right now to test things on. i have considered making a vm on my mac to test all things windows. i also don't have a good sense of what shells windows users prefer. When i taught Python and bash we used to suggest that all windows users use gitbash as it was the most straight forward tool to download, install and use. however most of my students were new to shell / bash so they didn't have a preference. i don't know what to suggest here in terms of which shell to add a tab for. @ptressel @ucodery do you have any suggestions? we literally ran into this in our workshop the other week. i agree 💯 that it's important!! |
There are at least five options...listed here in likely preference order.
Windows users will have cmd, and may have used it. If they install git from git-scm.com, then they'll have Git Bash (IIRC). Those are likely the two best options. If we find out that the commands for use with Git Bash are identical to those for Linux, then asking folks to install git gets a big boost in preference, as there would be no need for separate Windows commands beyond some setup. (I predate the command line -- started with FORTRAN coding sheets and punched cards. :D ) |
Just to add to what @ptressel already said
|
my first pick would be WSL, for some reasons:
of course, mainly of my points are based on my experience, and of course, my point here is not about to use it as a preferred tool, but at least it would be nice to not ignore it. and additionally, it is really easy to configure and easy to use it. |
I've found myself in the need of a python development environment for a beginner on Windows just some days ago.
|
@cmarmo i am a HUGE fan of miniforge but i never knew about the prompt that it offers. how do you invoke a miniforge prompt? my quick read on WSL (i could be wrong y'all) is that it might be more involved to install / setup. can anyone confirm and or tell me my read is wrong!? What if we consider a few options:
@ptressel and @ucodery both have the cmd prompt first for windows users. we could include commands for that prompt (if they will consistently work) i'm just nervous about things consistently working across various versions of windows. btw i do remember using windows ages ago and the DOS prompt. |
At least in the last version I've installed, the installer put it in the Windows Start menu, I looked for it with the search bar.... sorry I can't provide a screenshot, I don't have a Windows system on hand right now. |
no worries - please do not apologize! that is helpful to know!! |
I want to circle back on this issue. i think right now there still isn't enough information for an external contributor to work on this. i'm going to keep it open but remove it from the help-wanted board for the time being! |
About command line stuff... I was hesitating to bring this up, but... There are a fair number of folks using Windows. The commands may look a bit different if executed in cmd...but not always. A fair number of tools that come in from the *x world will use forward slashes in paths, or not understand a drive letter, or require their own special syntax for that. Others will take back slashes, but need them quoted. The best ones know what OS they're running on, and do "when in Rome...".
Windows users could install Git Bash. Or Windows Subsystem for Linux (WSL; which allows having an entire Linux distro under Windows). Or the classic Cygwin. Or adapt the commands for running directly on Windows. The easiest option is likely Git Bash. It's not entirely friction-free, however, as Git Bash's executable path may differ from the Windows path.
I've mostly ended up modifying commands so they work on cmd, except when the documentation strongly encourages use of Git Bash. Or when there's a canned development environment that can be run on a virtual machine. That's what we used to do for an open-source emergency management tool I used to work on, when we participated in hackathons. It could take the entire day to set up our environment, so instead, we prepared pre-configured virtual machine images.
The following has a good list of the options, one could just drop in a reference to this at the outset, wherever it says "we don't support Windows". :D :D :D
https://itsfoss.com/run-linux-commands-in-windows/
Originally posted by @ptressel in #224 (comment)
The text was updated successfully, but these errors were encountered: