bellingcat / EDGAR

Tool for the retrieval of corporate and financial data from the SEC
https://colab.research.google.com/github/bellingcat/EDGAR/blob/main/notebook/Bellingcat_EDGAR_Tool.ipynb
GNU General Public License v3.0
95 stars 12 forks source link

build: Add Pipenv for dependency management #12

Closed jordan-gillard closed 4 months ago

jordan-gillard commented 4 months ago

Summary

This PR adds Pipenv for improved dependency management.

Rationale

1) Pipenv automatically creates and manages virtual environments. 2) The Pipfile.lock file locks dependencies to ensure consistent dependencies across environments, reducing "it works on my machine" issues. 3) Pipenv enhances project security by checking for known dependency vulnerabilities. 4) Pipfile is more readable and clear compared to requirements.txt, it also has a really neat [scripts] section. 5) Pipenv distinctly separates development and production dependencies. This will make developers who want to work on this project & users who want to install from PyPI live's easier. 6) Last but not least it's endorsed by the Python Packaging Authority.

I would like to make some enhancements to this project (like adding tests - #11), which would require installing pytest. I don't want to make pytest a production dependency. Users who just want to use the script shouldn't have to install it. So I decided a good first step to enhancing EDGAR is to add a nicer dependency manager. Users can still use requirements.txt for the original workflow. In the future developers can generate requirements.txt via pipenv requirements > requirements.txt.

Pipenv is great. Another alternative is Poetry. Please lmk if you would like further explanation/justification for this PR.

GalenReich commented 4 months ago

I didn't spot this PR before merging #10, but in general am very much in favour of adding better dependency management πŸ™Œ

jordan-gillard commented 4 months ago

I didn't spot this PR before merging #10, but in general am very much in favour of adding better dependency management πŸ™Œ

@GalenReich Rad. I'll refactor this to account for the latest changes. Probably not until Wednesday tho πŸ™‚

jordan-gillard commented 4 months ago

@GalenReich lmk what you think.

Edit: I saw last night that other Bellingcat Python projects use Poetry. Would you prefer that? It's no big