Quote:
Originally Posted by lostmypw
I'm forking a python project that doesn't have any dependency versioning stuff. I hardly know python. It took me a while to get my system python packages up to date (I used apt-get install python-packagename which felt dirty). Now that I have everything working I want to set it up to use pipenv. Is this the only way to do it or is there a new tool? Also how can I even tell what versions of modules I'm using now? Do I have to print out stuff from the imported packages at runtime manually?
Also lol python. Even 10 years later this project is using 2.7 because it relies on libs that never got updated. What a cluster ****.
I haven't used "pipenv" for anything but I use virtualenvs for basically everything. It lets every project have it's own set of libraries. Basically assuming you have all your requirements in a file called requirements.txt, you do
Code:
virtualenv ./myenv
. ./myenv/bin/activate
pip install -r requirements.txt
to "leave" the virtualenv you just run "deactivate" from your terminal. To get into it again just run
. ./myenv/bin/activate
When it's active, any pip stuff you do will change the virtual env, not your system env. I am imagining pipenv is similar but manages stuff for you implicitly.
Regarding python 2.7, most of the libraries are ported. I use python 2.7 for work because converting it would be a big task but I use 3 for almost everything now. There are probably a lot of relatively obscure libraries that never got converted because their authors are no longer active. The same thing happened with Perl 6. Perl 6 was announced in the year 2000, and I still don't think it's ascended past perl 5.
Python made a huge mistake by making not only several breaking changes, but making changes that might not be caught until run time, and that might be relatively subtle. It's not too hard to convert a big project if it will just fail to start and give an error (like happens with, say, the new print() or exception syntax), but if it will compile/start but still have some code that needs converting, that's a somewhat more difficult sell.