AstreusCoding / lol-account-manager

account manager
MIT License
19 stars 4 forks source link

minor cleanup for standard python practices #2

Closed Frontear closed 2 years ago

Frontear commented 2 years ago

FIrst, I decided to move everything (behind the scenes) into a virtual environment. You would not see this in commit history, since this is actually something users can opt-in to, however it's often recommended and done especially in situations where there are a lot of requirements.

In order to access the VENV operations, you can run python -m venv .venv in the root directory of your project. Usually after this you would re-import your project through your IDE, most can automatically detect a virtual environment.

Next, I moved the requirements into a more standard requirements.txt. This is practiced standard by most python developers and also is a cross-platform friendly solution since then, all you need to do is run pip install -r requirements.txt.

Whether you are in a virtual environment or not will not affect the requirements (though its still recommended to be in a virtual env, since then anything installed by pip is only installed for this project specifically).

Finally, I just removed an unused import. Nothing major, I saw it and decided it could go with no hassle.

Overall just some quality of life changes. Functionally your code operates in exactly the same way as before.

Note: The virtual environment is NOT mandatory. I added support for it through the gitignore change, however it does NOT have to be used. That being said, if you don't use it, you run the risk of bleeding unnecessary dependencies if you ever update your requirements.txt, since pip freeze > requirements.txt would drag more than just what is necessary for this project.