mcmullenrich / PDICapstone1

2 stars 0 forks source link

Easing into Virtual Environments #6

Closed JnyJny closed 7 months ago

JnyJny commented 8 months ago

With your latest update to the project, you introduced some new dependencies for your project ( pandas and colorama in particular ).

If you want your code to run on someone else's machine, you'll need to communicate those dependencies to them somehow. Right now, the person on another computer would:

For your code it's not very onerous to install two things, but some projects have dozens or more dependencies and this will likely demotivate the user from even attempting to use your code.

So the first simple way we can address this problem is providing a requirements.txt file.

# requirements.txt
colorama
pandas
openpyxl

Now when a user clones your repo, the will see the requirements.txt file and perform the following to update the current Python environment:

$ python -m pip install -r requirements.txt

This particular topic will lead us into packaging which will require some small adjustments to the file/directory layout of the repository and using a packaging tools like poetry to manage project dependencies and building the package for distribution.

mcmullenrich commented 8 months ago

Created the requirements.txt file and pushed to github.