1. Build Docker image out of requirements.txt 2. Develop application 3. Repeat 1-2 until ready to deploy 4. Run Docker image in production with same dependencies as development 5. ?? 6. Profit! As long as you don't rebuild in between steps 3-4, you'll have the same set of dependencies down to the exact patch level.
Doesn't help developers not get different versions of packages. Lockfiles are necessary regardless of Docker.
Freezing Python’s Dependency Hell
91–100 of 152 posts
Re: Freezing Python’s Dependency Hell
#92Re: Freezing Python’s Dependency Hell
#93Earlier quoted context omitted.
I think you are supposed to use `pipenv sync` on the remote to get the pinned versions from the lock file
That's honestly my biggest gripe with pipenv: which command is best for a CI run? My current magic is: pipenv sync $(pipenv --venv > /dev/null || echo '--python 3.6') --dev The reason is that (magically) adding --python 3.6 will always create a new virtual environment, and I'd rather not do that if the cache is up to date, but running sync by itself won't. And I think I also want to run `install --deploy`, to check i…
Of course, I definitely understand where you're coming from. It took quite a while for me to figure that out, because --deploy is not well documented.
Re: Freezing Python’s Dependency Hell
#94As a form of version pinning, this locks in old versions and creates technical debt. A few years downstream, you're locked into library modules no longer supported and years behind in bug fixes.
Re: Freezing Python’s Dependency Hell
#95Earlier quoted context omitted.
Is there a reason you don't "activate" your virtualenv? That (with the addition of using mkvirtualenv and friends) is the workflow I use to both dev and prod and am really happy with!
I don't like "magic". I don't need anything to hijack PS1 and muck around with my shell.
Tools like nvm, rvm, ros ... If I can use a solution for managing a development context that doesn't involve mucking around with the shell environment I much prefer it. Configuration via the sourcing of shell scripts is a very fragile interface, doesn't work when with good (ie non-bash) shell, and almost always eventually leads to bugs when some workflow triggers processes in a manner that fails to inherit the shell environment...
Re: Freezing Python’s Dependency Hell
#96I'm not sure why the scientists don't use VMs and simply save the virtual disk files? That would at the very least allow them to verify the settings at a later date. Fresh install reproducibility doesn't seem necessary to verify experimental findings as long as the original vm is available to boot up.
VMs are an easy copout to a problem that shouldn't be a problem in the first place.
Re: Freezing Python’s Dependency Hell
#97Is there some commercial advantage?
Why not just post the medium url
https://medium.com/p/f1076d625241
This 302 redirects to tech.instacart.com
Re: Freezing Python’s Dependency Hell
#98Unfortunately, software does not work this way. You cannot just ask for an arbitrary combination of versions and rely on it to work. Conflicts and diamond dependencies lurk everywhere.
Sensible package systems (see specifically Nix & nixpkgs) have realized this and follow a "distribution" model where they periodically settle upon a collection of versions of packages which generally are known to work pretty well together (nixpkgs in particular tries to ensure packages' test suites pass in any environment they're going to be installed in). A responsible package distribution will also take it upon themselves to maintain these versions with (often backported) security fixes so that it's no worry sticking with a selection of versions for ~6 months.
However, I can't say I'm particularly surprised that these systems tend to lose out in popularity to the seductively "easy" systems that try to promise the user the moon.
Re: Freezing Python’s Dependency Hell
#99ruby practices based around bundler aren't perfect, but they did solve _this_ level of problem ~7 years ago. It remains a mystery to me why python seems to have won the popularity battle against ruby. They are very similar languages, but in all ways they differ ruby seems superior to me.
Re: Freezing Python’s Dependency Hell
#100What's wrong with pipenv? I am genuinely curious. On local : mkdir my_project_directory cd my_project_directory export PIPENV_VENV_IN_PROJECT=1 (To make the virtual environment folder determininstic(.venv/) otherwise you will get a hash based directory(my_project_directory-some-hash-value) which might not be suitable for automatic deployments in applications like docker. I don't know why this is not default.) pipenv…
pipenv has a huge issue that they refuse to fix: no init command. That means you can only run pipenv commands from the root directory of your project. If you accidentally run pipenv install X in a subdirectory, guess what? You just created a new Pipfile and virtualenv! npm actually got this right, init helps, and it makes sense to traverse up directories to find a package.json.
Regarding "init", are you complaining that many commands will create a new virtualenv when really only one ought to? Automagically creating the virtualenv definitely seemed cool and modern to me... for about 3 minutes.