smkent/safeway-coupons

Suggested development environment?

CDeLeon94 opened this issue · 2 comments

I'd like to contribute to maintaining this tool, however I am struggling to set up the dev environment.
I've got docker desktop running on my machine and created a 'dev environment' with my fork of the repo.
However, its not clear to me how to run the code to test if my changes work.

Resources, or even just the right keywords would be much appreciated.

smkent commented

Hi! Thanks for offering to contribute! safeway-coupons can be invoked inside or outside of Docker for development.

To use outside of Docker, clone and set up the repository using Poetry using the instructions in README.md. Then, the script can be run with:

poetry run safeway-coupons

This requires that Google Chrome on your system matches the version expected by selenium / undetected_chromedriver (Chrome 119 as of safeway-coupons version 0.2.7).

Running in Docker means safeway-coupons will use a copy of Google Chrome installed within the container instead of your system's Google Chrome. The Docker build will always install the latest stable version of Chrome.

I generally make one-off Docker container images for development, like this:

docker run -v path/to/local/test/accounts/file:/accounts --rm -it $(docker build -q .) safeway-coupons -c /accounts

This exposes the specified test accounts file in the container as /accounts, and then runs safeway-coupons using that file.

Hopefully that helps! Let me know if you have more questions.

smkent commented

I added a development docker-compose configuration file to make this easier. Check it out: https://github.com/smkent/safeway-coupons/tree/00e5f0ad0db043223abc73dba0cb14dc9301b707#invocation-with-docker-compose