Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

Poetry is the cleanest python deps handling experience, and I would recommend it as well.

But it is very slow.


For those who are wondering what is the benefit over pip freeze: pip freeze dumps you entire venv, while pip compile gets project dependancies, and infer the requirements file from that.


I'm not sure I get it -- if you had your core dependencies in setup.py / setup.cfg / pyproject.toml (for development) and then pip freeze (for creating a highly reproduced venv for applications), would that be similar?

Why would one want to infer the requirements file? Would that be like `pip list --not-required --format-freeze`?


When in Africa, I worked around that problem and many others using a pypi proxy. Today devpi is the standard: https://devpi.net/docs/devpi/devpi/stable/%2Bd/index.html

You pip install from it instead of pypi. It will in turn download from pypi and give the result to you. It will also keep itself updated, and you can batch download during the nigh packages you assume you will work.

As a result, our entire team always as most packages locally available. Changing machine, location or purging cache didn't mean loosing this benefit.

Besides, pip caching wheels doesn't mean it's not making any requests, so it's still a better experience.

For big companies, I recommend it anyway: it speeds up the entire team work, CI, allow you to publish private packages, etc.

If you can't do that, the next best things is to do "pip download", instead of "pip install", and save the wheels into a hard drive.


Thanks for the tips, I'll definitely look into them.

EDIT: And thanks for the tip from godmode2019. I upvoted you both.

However, they don't change the fact that pip by default assumes a decent Internet connection, with its short timeout and no resume on downloads, and thus is unusable with anything less.

Again, IMHO that's simply unacceptable for the official Python package manager.


Unfortunately this is the the norm of most package managers these days, and I feel sorry pip can’t make the out-of-the-box experience more pleasant for you. If you got ideas how pip can improve the experience without compromising the zero-config default (which a lot of Python newcomers rely on), please definitely feel free to suggest them; we are all ears.

I would say that Python, and especially pip, is actually relatively friendly to scenarios where non-obstructed Internet is not generally available, compared to many other offerings from other programming languages (especially those without corporate backing). Devpi was already mentioned as a solution; in fact, since pip’s --index-url accepts a file:// URL, you can even simply pre-download the wheels, arrange them in the correct hierarchy (see PEP 503) inside a thumb drive, and just pass that around. The --find-links --no-index combination may also be an interesting approach for simple setups. There are a lot of things to try, before you conclude things do not work.


I do have a few suggestions, starting from least effort for most impact:

1. AFAICT pythonhosted.org is hosted at fastly.net, which seems to be heavily throttling downloads from certain disprivileged locations, as well as downloads from cloud providers such as Linode. It would help a lot if they could ease up a little on the aggressive throttling.

2. Make the pip download timeout longer to better accommodate spotty connections.

3. Make pip downloads resumable so that a download makes progress each time pip install is run.

4. Make pip download each file over multiple HTTP connections in parallel. Download throttling applies to a single connection, so downloading over multiple connections will speedup the download.

Thanks a lot for listening!


I've had ~5 mbps download speeds for the last 5 years in a rural US location. I set up devpi on an old Raspberry Pi hoping to have this same experience, but after several months I disabled it and found it was actually slowing things down. If memory serve, the issue was that the local package lookups were excruciatingly slow (even if done in localhost), and I was surprised to see that devpi would routinely soak up multiple GB of memory and start swapping (I recall a few issues on memory leaks in their repo).

Seemed like a great idea, and perhaps I just needed something beefier than an RPi 3, but it didn't work out for me.


It's interesting if you got a lot of wheels to build locally, but this is very specific: most wheels are pre-built for you, that kinda the point.

It still happens from time to time, but if somebody else read this comment, you want to check how many wheels you build before doing so.

Also, you may want to cache those build once and for all.


Depends on your platform. If you're using ARM (like AWS Graviton, and possibly Apple M1) you might find that many wheels are not available. That might be different now, my information is 2 years old, but I remember 'pip install numpy' taking ages. Every time someone pushed a change we'd have a 15 minute job clogging the pipes. Luckily I had already created an artifact repo (AWS CodeArtifact) for our own internalpackages, so I added a step to our build process to push locally built wheels, so a painfully slow build would only happen once.


"PEP compliant" is kinda saying "convention compliant", it's not meaningful unless you provide the PEP number.

However, pdm and the likes are interesting because they are, indeed, PEP 582 compliants, which let you use __pypackages__ like one uses node_modules.


oh hi, sorry for the late reply. indeed you are right; i was typing from my phone and was a bit too hasty. i am not a fan of poetry after reading these; TLDR poetry does not support PEP621 about pyproject.toml either, and i feel this is the direction the python community has been going towards recently.

* https://iscinumpy.dev/post/bound-version-constraints/

* https://iscinumpy.dev/post/poetry-versions/

also pdm is developed by frostming, who's on PyPA (Python Packaging Authority) and more libraries are extending support for pdm (streamlit just today).

but in general i am not against poetry. it's a good tool and it pushed package managers a fair bit further - providing a superior alternative to conda imho


A $1800 energy bill would supposedly be the triple of a $600 energy bill that people pay for their fridge ?

I got a fridge, a freezer, a giant screen a phone, a dyson, an electrical water heater and a computer and various electrical cooking appliances.

I pay $60 a month. Who pays $600? Is that a common price in the US?


I dunno about $600. $200-300 was a typical bill for an older detached 3BR when I was in college. split several ways of course. it wouldn't surprise me if people with significantly larger (and poorly insulated) houses paid a lot more, but that wouldn't be common. AFAIK, the vast majority of an energy bill typically comes from heating and cooling. appliances don't contribute that much.

in my current 1BR, with great insulation and neighbors above, below, and on both sides, I too pay about $60 for utilities.


For an older McMansion in TX or FL, not far out of line.


Do you have an air-conditioner?


No, however heating is $200 if electrical. But I work from home, so it's always on high temps, unlike for most people.

Also, that's still far from $600, that's not anymore "preventing your food to spoil", and that's only a few months a year. A/C as well, you don't usually use it in december in most parts of the US.

So yeah, I find this number surprising for a very rich country that should have great infrastructures.


A tree of code scopes is a graph, and you have one per module, plus a navigation history, which makes it 3d, even 4.

A device like that could be adapted for dev.


I wish CUElang is going to succeed.

From what I'm seeing, it's already better than Taxi at what Taxi is supposed to be excellent at, and yet does much more, while still not being Turing complete.

I enjoy it better than JSON, YAML, TOML, and any respective schema associated to those. Sum and Union types are a killer feature, espacially since CUE can define a type and a value using the same syntax.

But it must be hard to implement, because for now, only the reference implementation, in Go, exists.


I also personally think CUE hits a sweet spot. The union (pun intended) between types and values (both sets) is really a game changer!

CUE is indeed not trivial to implement, especially its intricate semantics are tricky. I work an a CUE alternative, called ReSeT to really understand the semantics better.

See: https://old.reddit.com/r/ProgrammingLanguages/comments/uukxv...


I've wanted to use cuelang twice already, but having to install the go language on Ubuntu is a major inconvenience. Instead I used NestedText (I tend to do all my parsing with Pydantic anyway).


Because you can still use cash.

But once you can't, then the temptation to coerce people into "the right way" is going to be too big.

Then you need to hope you don't need to go to a gay bar in an anti gay state, pay for an abortion without your parent knowing, or give financial support to a controversial political group.


So the problem isn’t the existence of a USD digital system.

The issue would only arise if cash was eliminated.

I completely agree on the need for cash, but as long as we’re also keeping cash a digital USD would solve every problem crypto claims to solve while still allowing for a non dystopian future.

In fact, crypto is completely dystopian because there is absolutely no space for cash in it, and further, by being distributed and therefore pseudonymous at best, it actually opens massive privacy and security pandora boxes.


Oh, I though it was the idea to go full electronic.

Then yes, a perfect ledger for all monetary transactions would be great, espacially for big sums.

Appart from that, the current financial system is mostly digital and satisfactory for day to day payments.


> In fact, crypto is completely dystopian because there is absolutely no space for cash in it, and further, by being distributed and therefore pseudonymous at best, it actually opens massive privacy and security pandora boxes.

I don't think crypto positions itself as the only option (Bitcoin maxis aside). So there is definitely space for cash, space for tokenized USD, space for collateralized algo stablecoins.

Why distributed implies "pseudonimous at best"? Have you looked into what can be done with zero-knowledge proofs? With MPC?


> In fact, crypto is completely dystopian because there is absolutely no space for cash in it, and further, by being distributed and therefore pseudonymous at best, it actually opens massive privacy and security pandora boxes.

Is this true of all coins though? I know little about crypto, but I gather from reading on here while the privacy of bitcoin was greatly exaggerated/false other coins use actually privacy respecting schemes. Of course, that would assume that the schemes they use work perfectly which is probably a ridiculous assumption.


For now. Modern chips will make it harder and harder, until one day we will have almost no control over the machine we are running. For our own good, of course. Plus nobody will care appart from us. And not all of us. Not the us that are working on this techs at least.


As long as signature enforcement in BIOS can be disabled, everything is possible. And it will always be possible to disable it because otherwise someone would sue the hell out of Microsoft, OEM, or both, for not being able to run Linux or other competing OS on a PC they bought.


Given we have one win for a 1000 fails with big companies, and that they clearly don't pay much consequences for their bad actions but benefit a lot from it, I doubt it.

Espacially if this becomes state mendated for national security reasons. Indeed, have you seen anyone been sued for the PRISM program?

In fact, it's already happening: have you seen a lot of things modified in iOS lately? It's super hard, so few people even attempt now.


> have you seen a lot of things modified in iOS lately?

There's an unpatchable bootrom exploit in all devices up to and including the iPhone X. But yes, I agree with your sentiment.

Though one thing to keep in mind: phones and tablets are content-consumption devices and they have historically been locked down for about as long as they existed. Computers are productivity devices. You may want to multi-boot 10 different operating systems for very practical reasons and no one should prevent you from doing that. Manufacturers understand this. Even the Apple M1 is capable of booting arbitrary, unsigned OSes, despite being a direct descendant of the same line of locked-down SoCs used in iPhones and iPads.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: