3 ms·
I am not very familiar with PHP dependency management. If you are using Python, you should use virtualenv. Apart from providing you a repeatable development env
by irahul 13y ago
I am not very familiar with PHP dependency management. If you are using Python, you should use virtualenv. Apart from providing you a repeatable development environment, it also enables you to use 2 versions of the same library in 2 different projects.
I deploy within virtualenv mainly because I use the same machine to host multiple services. I sometimes use requirements.txt.freeze(pip freeze -l requirements.txt > requirements.txt.freeze) for production deployments, but in the end, I find specifying versions in requirements.txt itself more convenient.
If you are building async services in python, have a look at gevent and learn the basics of event loops. gevent abstracts the event loops(there isn't an explicit loop) but there are cases where you are better off rolling your own select/epoll loop. Also, the article paints too rosy a picture - "I've built backends that do authentication, query a few million rows in Solr and return JSON in a couple of milliseconds thanks to Python" If you structure your applications properly, and your application is IO bound, you can get good performance out of Python. But it goes without saying that Python isn't a performance powerhorse. You might need to replace CPU intensive services with some other language or write a c extension or write cython ...
- marklit 13y agoI came across this gem for listing and installing packages in Ubuntu yesterday in a way similar to pip: https://github.com/progrium/buildstep/blob/master/stack/prepare#L9-L11 https://github.com/progrium/buildstep/blob/master/stack/prep...
- pekk 13y agoYou can use pip for system packages. But either way, this means you don't get any of the advantages of virtualenv which were just described.
- ihsw 13y agoDependency management in PHP is generally done through Composer. http://getcomposer.org/ http://getcomposer.org/ There is no analogue to virtualenv, and dependencies are loaded into a directory rather than somewhere in the operating system.