PyBites-Open-Source / eatlocal

This package helps users solve PyBites code challenges on their local machine.
MIT License
20 stars 9 forks source link

Make eatlocal work with Pybites Platform 2.0 #35

Closed bbelderbos closed 2 weeks ago

bbelderbos commented 1 month ago
olgamirth commented 1 month ago

Hi Bob and Russell:

I just forked your repo because I'd like to try contributing to an open source project.

I hope this is ok and that this is an appropriate venue to announce my intentions .. I've never worked on an open source. I just finished my PDM and thought this repo might be a good one for me to help with.

If you'd rather I not, I'm happy to step away.

Mike

rhelmstedter commented 1 month ago

Hi @olgamirth great to have you on board!

Compat mode or straight to v2? I think the latter because it's the way forward.

Agreed. v1 is getting sunsetting in the coming months correct? I say we start building straight to v2 and release eatlocal v2 as soon as v1 is no longer operational.

Does 2.0 still need to provide a zip file or do we just scrape the necessary data? Title+description + template code + test code?

I'm not sure if 2.0 needs to have a zip file. I'll know once I log in and start exploring the site. But I am hesitant to login to v2 until after we meet and discuss the school transition. Don't want to lose access to all the students lol.

I recommend going with Playwright over Selenium.

I can look into Playwright, I've never used it before.

Another thought I had would be to completely change how eatlocal works. Currently we have created an API endpoint for downloading the zip file. Submitting works by running git commands in the shell and then mimicking clicking through the user interface to log in, pull from GitHub, and submit.

Since we are starting from scratch, is it better to develop an API specifically for working offline. If we can eliminate the need for chrome and chromedriver, users no longer face the issues surrounding keeping them in sync and removing it from quarantine on macOS.

bbelderbos commented 1 month ago

Thanks Russell, I agree, let's focus on V2 only from this point.

I also think v2 does not need to provide a zipfile through api, the scraper can grab the template code + tests and save them to files locally.

I am not sure why we needed GitHub for submissions, Playwright can just authenticate again and then update the code editor with the passing code and hit the "run tests" button. I think this wrapper library can be developed totally independently from the platform. For starters we only need 3 functions I think:

Maybe we put the previous code in a v1 folder for now and start fresh?

Playwright is indeed going to simplify this 📈 - one thing that annoys me about Selenium is Chrome and Chromedriver going out of sync, it's not as seamless as it should be.

bbelderbos commented 1 month ago

I have not used it in a while, but one cool thing we definitely want to keep / port is the rich integration to show the exercise in the terminal.

rhelmstedter commented 2 weeks ago

Updated for v2 via #36.