Repository navigation
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
POST /shutdown-web-server ran `sudo shutdown -h now` with no authentication, and the API server is meant to bind to 0.0.0.0, so anyone on the network could power off the host. It now requires the DEPARTURE_BOARD_RSHUTDOWN_TOKEN already used for board server shutdown, compared in constant time, and refuses if the token is not configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An API failure returned None, which next_trains turned into [], so an outage was shown as "Pas de service". Other failures left the previous departures on the board indefinitely, presented as live. The SNCF API now raises on request errors and non-200 responses. A failed poll calls a new DataUpdater.update_failed() hook, which for SNCF shows "Information indisponible" and forgets the last trains so the next successful poll always replaces the message. A failure inside the hook is logged and does not stop the polling thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous test mocked api.departures to raise, which passed before the fix too. It now fails the HTTP request, so it fails if next_trains ever turns an API error back into "no trains". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fetched Same fix as SNCF: the API raises on request errors and non-200 responses instead of returning None (shown as "Pas de service"), and a failed poll shows "Information indisponible" instead of leaving stale departures on the board. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SOAP faults and HTTP errors from getMissionsNext escaped as zeep or requests exceptions, and RatpException was caught and ignored in the data updater; either way the previous departures stayed on the board. They are now raised as RatpException and a failed poll shows "Information indisponible". The CLI next command reports the error instead of a traceback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The NS API returned None on failure, which then crashed parsing the response, and NSException was caught and ignored in the data updater; either way the previous departures stayed on the board. The API now raises NSException and a failed poll shows "Data unavailable". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connection errors were caught and ignored in the data updater, and SOAP faults escaped to the generic handler; either way the previous services stayed on the board. The API now raises NationalRailException for HTTP and SOAP errors, including failure to load the WSDL, and a failed poll shows "Data unavailable". The CLI next command reports the error instead of a traceback. The old test asserting the connection error was swallowed is replaced by tests of the new behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unified API returned None on failure, which next_trains turned into no trains (a blank board), or into a partial list missing the train at the platform when only the second request failed. The API now raises TflTubeException and a failed poll shows "Data unavailable". This also stops stoppoints_by_line writing "null" to a line data file when the download fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the builtin ConnectionError was caught, which requests' errors do not subclass, so failures escaped to the generic handler and left the previous buses on the board. The Go North East scrape also had no timeout, so a hung site blocked the polling thread indefinitely. The scrape now has a timeout and raises on HTTP errors. If either operator fails the poll raises NexusBusException and the board shows "Data unavailable", rather than one operator's buses alone, which could show "No service" or the wrong next bus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Starting a client set a shared `running` flag to False, slept 1s in an async handler (blocking the web server), and started a new client. The old updater could still be mid-poll for up to 15s, so it then pushed the old station's departures and blanked the board after the new client had started; as updaters only push on change, the board could stay blank or wrong. Concurrent start requests could also run two clients. BoardClient now has start() and stop(), serialised by a lock. Each client's view model sits behind a gate that stop() closes, so a poll still in flight can no longer reach the board, and stopping does not wait for it. Updater threads are daemons so Ctrl-C exits at once. Handlers that block are plain functions, run in FastAPI's threadpool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The National Rail, SNCF and Nexus board commands logged an invalid station but started the board anyway, and the RATP board command did not validate at all. They now exit after reporting the error. The Nexus board command also passed station_id to DataUpdaterNexusBus, which takes stop_code, so it crashed on start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MANIFEST.in did not include nexus/data/stops.csv, which is loaded at import time. The CLI imports every provider, so an installed `departure` failed on any command, including --help, with FileNotFoundError. A test now checks every package data file is covered by MANIFEST.in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
requirements.txt was a 2020 environment freeze that nothing used and that contradicted setup.py: installing it would downgrade protobuf to 3.6.1 and break the regenerated protobuf code. requirements-dev.txt installs the package from setup.py plus test and build tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI only published on tags and never ran the tests. A Tests workflow now runs on pushes to master and on pull requests, on the oldest and newest supported Python, and checks the built wheel installs and `departure --help` runs. Publishing runs it first and only uploads if it passes. The publish job also moves off the deprecated actions/checkout@v2, setup-python@v2 and `setup.py sdist bdist_wheel`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Packaging and CI fixes from the code review (finding #5). 3 commits; 281 tests passing.
650fe9eInstalled CLI was broken.MANIFEST.indidn't includenexus/data/stops.csv, which is loaded at import. The CLI imports every provider, so an installeddeparturecrashed on any command, including--help. Added the file, plus a test that fails if any package data file isn't covered byMANIFEST.in. Verified by building the wheel and runningdeparture --helpfrom a clean venv.6e39ec6Removed stalerequirements.txt. A 2020 environment freeze nothing used; installing it would downgrade protobuf to 3.6.1 and break the regenerated protobuf code. Replaced byrequirements-dev.txt(package fromsetup.py+ pytest, httpx, build).78981cfCI runs tests. NewTestsworkflow on pushes tomasterand PRs, on Python 3.10 and 3.14: runs pytest, then builds the wheel, installs it and runsdeparture --help. Publishing now runs it first. Moved off deprecatedactions/*@v2andsetup.py sdist bdist_wheel.Notes
__token__as username); username/password uploads no longer work. ThedeparturePyPI project belongs to upstream.