61 points · by BerislavLopac · 6y ago · 35 comments
I don't expect to have to click through to Github to get a summary of what your project's about. Consider putting some of the text from your readme onto the main project page, it's good copy and I think wants to be front and centre.
I went to the docs first to try to find this, but bounced off the terse three word descriptions and lists of verbs.
Good luck with the project!
We love DepHell. I migrated some work repos from Pipenv (and plain ol' pip) to Poetry. However, we didn't want to have a flag day where we updated our build tooling to be 100% Poetry, so I made a Makefile target that builds requirements.txt and setup.py from pyproject.toml. Now developers can work with pleasant tooling, but the build system can use the old stuff it already knows.
We're close to having everything migrated to Poetry. When that day comes, we can throw out all the compatibility stuff, update the build server, and be happy. Until that day, DepHell gives us an easy compatibility layer so that we don't have to do the migration all at once. It's awesome.
# Generate setup.py and requirements.py until we can get off that treadmill.
# This *must* be done every time you update dependencies, as pyproject.toml is
# now the official source of project configuration and packages.
python_oldfiles:
dephell deps convert; dephell deps convert --env requirements
and pyproject.toml blocks: [tool.dephell.main]
from = {format = "poetry", path = "pyproject.toml"}
to = {format = "setuppy", path = "setup.py"}
[tool.dephell.requirements]
from = {format = "poetry", path = "pyproject.toml"}
to = {format = "pip", path = "requirements.txt"}
Now when a dev does `poetry add foo`, they can run `make python_oldfiles` to autogenerate updated "compatibility" files.curl -L dephell.org/install | python3
* Trying 185.154.12.127:80...
* TCP_NODELAY set
* Connected to dephell.org (185.154.12.127) port 80 (#0)
> GET / HTTP/1.1
> Host: dephell.org
> User-Agent: curl/7.65.1
> Accept: /
> Referer:
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
you're begging to get owned at that point
JFC, I twitch every time I see this. "Download my script from my website and pipe it to python/perl/ruby". I want to "rm -rf /" people's computers just to stop this trend.
Please never do this! Always read the scripts you're going to run on your computer.
python setup.py
Do people ever open up setup.py to check the code and all that imports for side effects?As a matter of fact the construct makes it easier to inspect the code without running it:
curl -L dephell.org/install | more
I do understand the main concern though - that supposedly websites are easier to hack than a repository. It is also a valid concern that a hostile agent may serve different versions of the code to different people.But all those concerns apply when downloading code as well.When one needs to checkout and run setup.py, the packages are almost always nice -- they install packages and that's it. If the compiler is missing it fails. The worst I have seen is super confusing error message because of missing dependencies.
On the other side, I have seen `curl | sh` do completely insane things -- like install packages system-wide, mess with global PATH, create new users on the computers, remove random databases from localhost.
I suspect there are two reasons:
- checked out code can be inspected by random person just by clicking around on github site, every commit has a author name and a message. Feedback is simple and immediate -- there is the "create issue" button is right there.
- If someone tries to update my .bashrc from setup.py, it is pretty clearly a bug. It is unlikely to happen in the first place, and if it does happen, there will be plenty of users who can confirm it is a bad idea.
If someone tries to update my .bashrc from | curl site, it is not usually a bug. The maintainer will likely refuse to fix it, and claim something about user experience.
I consider this harmful advice. You're promoting a false sense of security, which I think anyone that's spent 10 minutes looking through an underhanded code contest can see.
If your threat model includes the packages you're installing, then you need to do multi-person audits, sandboxing, etc. This applies to software obtained from package managers as well, which aren't typically pre-audited (and let's not forget popular packages that have been hijacked or acquired and injected with malicious code).
pip install this-or-that
do you actually first download the source and look at what takes place? probably not.In that sense curling is better as you can see the code beforehand just pipe it into a pager.
If "| curl" does this, it is basically normal to do anything. And root access is required in a lot of cases.
Maybe that's why it is called DepHell instead of DepHeaven.
If you don't have access to clean Python interpreters that don't have "global modules", including in the user's own "site" directory, eventually you will be praying that your builds work.
For a system like "dephell" to have a chance of solving the problem that it tries to solve, it has to have a "place to stand from where to move the Earth" -- without it, it's just a faster way to trash your Python install and have to reinstall it.