Modernize tooling: uv + Selenium 4 - #7
Open
benpetty wants to merge 1 commit into
Open
Conversation
Replaces the Pipenv + Selenium 3 setup with `uv` and Selenium 4 to get the project off two EOL stacks. Behavior is preserved end-to-end; only the dependency manager, Selenium API surface, and one latent bug change. Tooling - Replace `Pipfile` / `Pipfile.lock` / `requirements*.txt` with `pyproject.toml` (PEP 621, hatchling build backend) and `uv.lock`. - Rewire `Makefile` to call `uv sync` / `uv run scrape`; require `uv` alongside `geckodriver` in the bin-check. Add `export` so `.env` values reach the child process. - Bump minimum Python to 3.12 in `pyproject.toml`. Selenium 4 migration (`scrape/radio_nat_turner.py`) - Bump `selenium` to `>=4.27`; remove the now-deprecated `find_element_by_*` calls in favor of `find_element(By.*, ...)`. - Drop unused imports: `random`, `Select`, `strip_accents`. Bug fix - `RadioNatTurner.__init__` now uses `os.makedirs(folder_name, exist_ok=True)` instead of `os.mkdir`, so the first run no longer crashes when the parent `data/` directory doesn't exist. Docs / hygiene - Replace the one-line extensionless `README` with a proper `README.md` covering install, configuration, usage, project layout, and known limitations. - Extend `.gitignore` with Python build artifacts and `.worktrees/`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uv(pyproject.toml+uv.lock)find_element_by_*call sites to thefind_element(By.*, ...)APIRadioNatTurner.__init__(os.mkdir→os.makedirs(..., exist_ok=True))READMEwith a properREADME.md.gitignorewith Python build artifacts and.worktrees/This gets the project off two EOL stacks (Python 3.9 + Selenium 3) in a single atomic change while preserving behavior end-to-end.
What changed
Tooling
pyproject.toml— PEP 621 metadata, hatchling build backend, declaresscrapeconsole-script entry pointuv.lock— pinned resolution (replacesPipfile.lock)Pipfile,Pipfile.lock,requirements.txt,requirements-dev.txtMakefilemake install→uv sync --extra devmake scrape→uv run scrapeuvto the required-bin check alongsidegeckodriverexportso.envvalues propagate to subprocessesSelenium 4 migration (
scrape/radio_nat_turner.py)find_element_by_*/find_elements_by_*calls rewritten tofind_element(By.*, ...)random,Select,strip_accentsBug fix
RadioNatTurner.__init__no longer crashes on first run when the parentdata/directory doesn't exist (os.mkdir→os.makedirs(..., exist_ok=True))Docs / hygiene
READMEwithREADME.md(install / config / usage / layout / how it works / known limitations)__pycache__/,*.pyc,dist/,build/,*.egg-info/) and.worktrees/to.gitignoreTest plan
uv sync --extra devresolves cleanly on Python 3.12, locks Selenium 4.44.0scrape,RadioNatTurner,Writer,ExitStatus,ProgressBars,strip_accents,get_track_filename)uv run scrapereachesmain()and prints the banner + URL listNotes for review
main(34 acrossPipfile.lock/requirements*.txt) should drop to zero after merge — the files those alerts target are deleted here.uv.lockwill become the new alert surface going forward.README.md) — both pre-date this PR and weren't in scope for tooling modernization.