the article didn’t say anything about requirements.txt, did it?
It did say though about using only pip, I'm not sure not using requirements.txt, setup.py, or pyproject.toml to list dependencies makes any sense – they still usually contain only direct dependencies (unless pip-tools or some sort of make requirements.txt is used)
Also, not sure why you have a path for each python, it dumps a versioned executable in bin quite reliably.
Not on MacOS, there it's a protected directory. On MacOS one has to add all /Library/Frameworks/Python.framework/Versions/3.*/bin to the path
I will say re:commands/his final step some of his -m examples ignore packages that have a console_scripts option but don’t expose a main - for which
Good point, by the way
I also don’t really care if people prefer other ways as long as at work they’re not becoming unicorns, I’m a big believer in team uniformity, even if the team chooses a system that isn’t my fave.
Yeah, fine by me! The OP's article sounds just so… assertive that I couldn't ignore it
Oh, so you don’t understand pip - according to your first statement anyways.
Requirements.txt is more of a statefile, vs setup.cfg/pp.toml which is a min-to-install type, they both have different purposes.
I agree most people shouldn’t be using requirements.txt. It’s valuable for reproducible deploys, but really shouldn’t be done in isolation and definitely shouldn’t be used locally. We use it at work to preserve a deploys state.
A deploy involves generating requirements.txt, along with hashes for each dependency, from setup.cfg/pp.toml. We also have weekly dependabot stuff checking the cfg/toml.
All that would be way too much for a local package, for local dev we simply use setup.cfg/pp.toml and only list the min things we need - as intended. It makes local dev simple, but also means for any deploy we can reproduce exactly what happened if it needs re-pushing or recreation, meaning lower non-dev teams can use that requirements.txt sitting on the server to “reset” a server (statefil).
As for the rest of your stuff, I use macOS and each version creates a pythonX.Y file in the same bin directory.
My flow is to create a venv by writing python3.9 -m venv folder/blah, then run things from then on via folder/blah/python or folder/blah/python -m pip.
It doesn’t take me that much time, nor does it take newbies who ask how I work (happens at work a lot, I mentor a few people) that much time once I teach them to tap tab, and there is never any confusion about which venv is running what.
It’s an excellent method that also supports linux CLI skill building, as that’s not involved at all lol. We deploy on hundreds of linux hosts minimum for each app, so I expect them to be able to do that at speed seeing as they’ll also be expected to fluently hop around and search logs, involving way longer paths.
Like I said the only thing I disagree with in his post is the way he puts the -m thing. I do support using -m for pip as it means if someone is activating their venvs and using the PATHd python/pip it guarantees the pip is the correct one in case people did some path wonkiness- which they shouldn’t have, but as the guy who helps newbies, they sure do love putting weird shit that shouldn’t be in their path in their path and not checking it ever, so meh.
Oh, so you don’t understand pip - according to your first statement anyways.
That's pretty aggressive, you know? We're discussing the specific article, and re-writing «use only pip» section the right way never was my goal (and also my remark regarding pip-tools and make requirements.txt should've hinted at that, but who reads further anyway?). Hence, the rest is nothing new to me, despite the speedy conclusion about my understanding
As for the rest of your stuff, I use macOS and each version creates a pythonX.Y file in the same bin directory.
Okay, you got me here. In the past, I had to modify the PATH – for whatever reason, never mind. Still upgrading via the installers and cleaning up the frameworks and symbolic links hurts way more without Homebrew
It was just the way you said requirements.txt is an automatic use, when most pip users consider it antiquated and recommend against it, it’s far from automatic. My take on using it as a state file is very rare. same with your comments on setup.cfg, they just tell me you don’t actually know much about pip
It’s not aggressive, just commenting. I don’t assign value. I don’t use poetry or like it, but tons of people here do, I don’t really care what people use as long as they learn it - you’ve openly said you don’t prefer vanilla pip, which is fine so I wouldn’t expect you to know it.
I’m not sure why you’re annoyed or sensitive, you said a few outright incorrect things I was correcting, what part of me saying ah you don’t know pip is aggressive or insulting?
Seeing as the context was you criticizing an article which - albeit relatively reductive and I took some issue with - actually stands out in the sea of things bashing pip without actually getting it, I stand by what I wrote. I don’t get mad when someone points out I don’t know much about poetry - I openly stay vanilla piptools based on exacting work standards supported by industry experts (our python team is semi incredible and spends a lot of time on standardizing packaging / approach).
I’m not sure why you’re annoyed or sensitive, you said a few outright incorrect things I was correcting, what part of me saying ah you don’t know pip is aggressive or insulting?
Got judged too fast based on too few things said by me – that's why
Anyway, of course, one can use the vanilla pip (that is, without mere pip-tools) but I don't like the assertive tone of the article – no, it wouldn't relieve the pain – it'd make it worse – unless there's already an existing way of working in the team/department or for personal projects. I could start pretty quickly with either vanilla pip, or Poetry, or whatever – because I've been there, but there should be some assumptions made regarding that before saying «do not use X to relieve the pain»
1
u/eigenein Mar 28 '23
It did say though about using only
pip, I'm not sure not usingrequirements.txt,setup.py, orpyproject.tomlto list dependencies makes any sense – they still usually contain only direct dependencies (unlesspip-toolsor some sort ofmake requirements.txtis used)Not on MacOS, there it's a protected directory. On MacOS one has to add all
/Library/Frameworks/Python.framework/Versions/3.*/binto the pathGood point, by the way
Yeah, fine by me! The OP's article sounds just so… assertive that I couldn't ignore it