r/Python • • Mar 28 '23

Tutorial Relieving your Python packaging pain

https://bitecode.substack.com/p/relieving-your-python-packaging-pain
1 Upvotes

36 comments sorted by

View all comments

Show parent comments

1

u/eigenein Mar 28 '23

Didn't even see a question lol, only statements. But let's talk about this suspicion, I'm curious what it is and how it relates to anything I said so far

0

u/someotherstufforhmm Mar 28 '23

My first sentence:

the article didn’t say anything about requirements.txt, did it?

After the question I laid out my issues with your comment, and stuck with them throughout. I’ve been consistent here.

Your answer then said the stuff weirdly assuming anyone using vanilla pip would be using requirements.txt, which is what led me to say what I said.

1

u/eigenein Mar 28 '23 edited Mar 28 '23

Okay, let me elaborate, but first I need to ask: what is your proposed workflow to restore a frozen state of app's dependencies using the vanilla pip without checking in some sort of lockfile (whatever it is)?

My assumption was that one needs it (in whatever form), even though the article doesn't mention it explicitly

-1

u/someotherstufforhmm Mar 28 '23

Most people shouldn’t and wouldn’t be “freezing state” as requirements.txt is intended for.

That’s a bad way to package, it’s a deployment technique, and not at all recommended or best practices for a package or a local install.

You’re asking a leading question, but it’s the wrong question.

Check on this sub alone, Google “requirements.txt” and you’ll find a ton of people calling it antiquated. I’d actually advocate anyone looking to lock state to look at poetry or conda before requirements.txt unless they’re also willing to use CI/CD to automate generating and updating via dependabot programmatically as a manually created requirements.txt will always lag behind and is a poor, poor method of packaging.

Feel free to survey this sub or current best practices, nothing I’m saying is in any way out there.

For packaging, you want setup.cfg, or more recently pp.toml and you only want to specify the minimum necessary, allowing your package to be in turn a requirement for other packages.

Poetry automates much of this in a pretty decent way, which is why even though I said I’m not a fan, I don’t participate in the packaging wars where I yell at people for liking a different approach. I only yell at people saying extreme things like, for example, you making the analogy that using pip is like writing in assembly, lol.

1

u/eigenein Mar 28 '23 edited Mar 28 '23

You’re asking a leading question, but it’s the wrong question.

Actually, it worked out pretty well:

unless they’re also willing to use CI/CD to automate generating and updating via dependabot programmatically

Right, and that's what I said earlier, but we (the article) are talking about the vanilla pip and venv, so what are we left with in a local environment? Perhaps, pp.toml but read the comment further

Feel free to survey this sub or current best practices, nothing I’m saying is in any way out there.

Not sure why you're saying that…

For packaging, you want setup.cfg, or more recently pp.toml and you only want to specify the minimum necessary, allowing your package to be in turn a requirement for other packages.

Exactly, but what about a development environment? I assume using tools like flake8, mypy, ruff, tox, or pytest – do you suggest restricting them to their major versions or exact versions in pp.toml/setup.cfg? Yes, another leading question

Poetry automates much of this in a pretty decent way, which is why even though I said I’m not a fan, I don’t participate in the packaging wars where I yell at people for liking a different approach.

Let's talk the vanilla approach the article recommends, for the sake of disproving myself in your eyes

I only yell at people saying extreme things like, for example, you making the analogy that using pip is like writing in assembly, lol.

I merely meant that «don't use poetry, use the bare pip» is as strict argument as «don't use C, use assembler». I never compared pip to assembly per se, this you assumed for me

as a manually created requirements.txt will always lag behind

And I said that as well in the very beginning. Not sure why you decided I'm going to use it manually or recommend it. Actually, my comment was a contra argument against it

0

u/someotherstufforhmm Mar 28 '23

What? Most of this comment has nothing to do with my core point, which was the requirements.txt thing you brought up initially, and was the whole central point i was speaking on.

As to everything you said, vanilla pip has excellent answers for all of that, but if you want to use poetry, go ahead. I’ve never been on here shitting on poetry, even though - yes, my preference is to not add it into the mix, but that’s never been the topic here.

I feel like you’ve forgotten how this entire conversation started.

You stated some weird things in response to the article, specifically your points 1 and 2 under the “like assembler” thing (ignoring the paths mistake and the macOS thing as it’s irrelevant, but that contributed to me being skeptics).

I asked you about requirements.txt to gauge what you actually knew, your response was still decently off - again, fine - you never claimed to be a vanilla pip expert as you’re a poetry proponent and that’s fine, but I said “ah you don’t know vanilla pip” and explained.

I still don’t get why you’re agitated over that in any way.

As far as your questions here, would you actually like me to respond with the vanilla pip answers? I’m not sure how this turned into a poetry vs pip thing, but I’m happy to explain if you’re actually asking and not just still angry about my initial reaction to your comment and looking for new topics.

In reference to your question of build environment stuff like pytest, of course - setup.cfg and pp.toml provide excellent vehicles for setting that up, it can be versioned, unversioned, or min/max bound.

Again, I don’t care if you don’t like vanilla pip, I was commenting because your initial comment on it was misleading - the things you said are consequences of using vanilla pip literally aren’t.

1

u/eigenein Mar 28 '23

I'll start from the middle because…

I still don’t get why you’re agitated over that in any way.

…my last comment was written completely calmly :) I sincerely addressed everything you said, yet you keep sticking to it, so sorry for that

which was the requirements.txt thing you brought up initially

And which I've started explaining but didn't have a chance to finish

You stated some weird things in response to the article, specifically your points 1 and 2 under the “like assembler” thing

Addressed as well, the very last response

As far as your questions here, would you actually like me to respond with the vanilla pip answers?

Yep, I sincerely wanted that

I’m not sure how this turned into a poetry vs pip thing

It didn't, except in your head. In my head, it was the article with the «only pip, only venv» thing

I was commenting because your initial comment on it was misleading - the things you said are consequences of using vanilla pip literally aren’t

You don't give a chance to elaborate, hence, I'm done here. Please, let people explain themselves before assuming things.

1

u/someotherstufforhmm Mar 28 '23

You meep saying I didn’t give you a chance to elaborate, yet your own initial words were incorrect. Your answer to my question confirmed you had mistaken understandings and your own words confirmed you don’t use vanilla pip.

Again, that’s fine, I’m not trying to argue you into using it, but there weren’t any assumptions. You said some incorrect stuff, I commented on it, you fixed some of it (the paths stuff), okay.

There wasn’t a mistaken assumption lol. None of the additional context you’ve given changes the initial point, which was quite small and specific.

Again, im not sure why you took umbrage over it. If you corrected something I said about poetry and said “ah you don’t know much about poetry”, I’d 100% agree. For example, your mention of it having built in lock files. Im intimately familiar with Condas state files, but didn’t know poetry had that, TIL.