-
Notifications
You must be signed in to change notification settings - Fork 56
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
Windows Instruction for PipX #278
Conversation
@all-contributors please add @Vaunty for code, review |
I've put up a pull request to add @Vaunty! 🎉 |
@pre-commit autofix |
pre-commit.ci autofix |
Thanks @Vaunty for the PR. I've corrected the typo and CI is now running green. @lwasser @ucodery Please give this a look. I wasn't sure if we still wished to recommend pipx since hatch has improved their install experience. Whatever is decided about this PR, we are grateful that @Vaunty took the time to write up this PR 😄 |
oops - @willingc i see that you've seen this. i'm sorry! i left you a note on another issue about it. i haven't looked closely at the hatch installers. but if that is the easiest way to go we should update the lessons to suggest that route -- BUT get windows users to test it first. Then we can leave a note in the docs about the other ways to install linking to @ofek documentation on installing hatch. @ucodery do you have any opinion by chance? i myself don't yet have a windows instance to test but i thought about making one - there is a windows non profit license i think! |
Hmmmm, it does appear that Hatch has installers for Mac and Windows which is nice, but not for Linux (there are prebuilt binaries, but this is not a great install journey - it's the same as download.python.org basically). My personal strategy is to always install python software in the virtualenv I am doing all my package development work in. That keeps the install story the same between all three platforms, and stays away from system global installs which can get confusing even when they're not sharing environments with other global tools. It is also my personal preference to not use pipx, but IIRC the PyOS consensus was pro-pipx. If it was only a question of using a Hatch gui installer or using pipx gui installer and then pipx installing hatch, I think it could make sense to skip pipx and go straight to Hatch. But the issue is that hatch is not the one and only tool we might want to recommend be installed for all projects. Other software commonly installed with pipx: black, mypy, ipython, pipdeptree and for any of these other tools we would have to again answer the question of how users should install them; probably with pipx, but now hatch is the odd one out. A slightly different strategy for future tools is to recommend anything needed in a tutorial be installed using hatch envs. This would leverage hatch as a replacement for pipx, but it's not such a straightforward switch. Hatch can manage any number of envs and keep them isolated, but adopting this means we would have to teach hatch environment management, and how and when to switch envs before getting readers a win by installing a tool they need. Also Hatch is still a per-project environment management tool, nothing global. So each project could have a mypy env that isolates that tool from the project itself, but when moving to a new project that env would have to be copied over every time (in both config and the creation of a new virtual environment behind the scenes). my summay:
So we should probably get the pipx getting started guide rock solid and also give it its own page that can be linked to each time we reference it in a guide. |
After I get finished with workspaces I'm going to add a top level command group that is basically like pipx e.g. |
@ofek I didn't realize it was you that inherited Guido's crystal ball 😆 seems like you are always half a release away from a new feature that will greatly simplify guides like this! |
this is amazing. so @ucodery i'm just now reading your comments after just going through the other pipx issues (we had a lot of them!). it seems to me that installing pipx is really painful. i agree with your sentiment BUT i don't think the installation process is worth it right now. the other thing is hatch installs python for you if you don't have it. so a totally new user could install hatch + python will get installed and be up and running. i didn't even know about the pipx like functionality!! wow! i just opened this issue #301 i'm leaning towards the installers but i do want your input ucodery after reading that comment above that was super thoughtful and very much true. so i'm open to discussing this more. BUT it seems like the thing that is left here is to figure out how to best install hatch on linux? is that true? i always forget that even tho mac is linux-esk it's a totally different installation path. could you comment on #301 around the linux piece - we might now want to implement this update until we know we have a sound linux solution too! i will ping you and ofek there now if you don't mind. i feel like we are close to a solution! |
tutorials/get-to-know-hatch.md
Outdated
If Python is not installed, dont be alarmed! | ||
[Download Python Here](https://www.python.org/downloads/) | ||
|
||
* Step 2: Using the "curl" command install Pip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get-pip
is a great bootstrapping tool for packaging, but unless the user is forced to use a very old version of Python I would strongly recommend python -m ensurepip
instead which is part of the base language.
I guess I don't use Windows enough to know if there are any corner cases ensurepip won't work and get-pip would
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong, but I believe you're referencing Lines 26 to 32! If so, I can happily replace the dated 'get-pip' with 'python -m ensurepip'. That said, I would like to note that I was using the most recent version of Python at the time. Apologies for the tardy reply!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, I don't know why I had so many lines highlighted. get-pip
will work with any python version, it's just more roundabout that using the module provided with base Python. Thanks for the update.
replaced bootstrap command with native 'python -m ensurepip' command
hi everyone. i'm checking in here on this issue. We just merged another PR that has users install hatch from the installers rather than using pipx. At the same time - i think there is some good information here that we could still use for people that want to use pipx. i'm curious what you all think - @ucodery ? what i'm thinking is we merge this pr as is. Then we turn it into a dropdown help tip for people who want to use pipx. that way it's not the main way to install things but an option that is hidden at first but that can be opened to learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closes #265
https://www.pyopensci.org/python-package-guide/tutorials/get-to-know-hatch.html "Get to know hatch" tutorial's first step on a Windows system caused problems for me. So, here's how I fixed that.