I'm developing a personal program and sometimes I think it would be a good idea to update the Python modules used in the program but I don't want the program to stop working because of updated functions on the updated modules or something like that. So, since when I started making the program (1 year ago), I've never updated the modules and keep all the installers inside one of the folders of the program to be able to install the correct version of each one (with an automatic installer I made to be faster when installing them). Am I doing right or is this a bad idea? I just don't want to have to reprogram many things in my program if the functions, classes,... of the modules are updated. Does this happen or they will always work? Btw, I'm a Python beginner.
Updating the modules can of course lead to corrupt code in your project. The module may of course have rewritten functions or classes, removed deprecated code, etc. in another version.
One possible approach would be to create a virtual environment for the project, as already proposed by roganjosh. Here is a helpful link: http://docs.python-guide.org/en/latest/dev/virtualenvs/ .
In this virtual environment you can record your modules in the current versions in a requirements file. This is often done and I think it is also a good practice. An additional advantage of this is that by simply changing the version number in the requirements file you can try out whether a newer version crashes your program or not (of course you can certainly also read the module's documentation, "breaking changes" or similar). Another disadvantage is that the project can only be updated at great expense at some point (too many changes at once). You could then successively update one module after the other and see whether project code needs to be changed here and there.
If you just want to run your project and there are no security concerns, then it's probably enough to fix the versions and that's it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With