chore: update Python dependencies and add test suite#21
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40cfba266b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if "requests" not in sys.modules: | ||
| fake_requests = types.ModuleType("requests") | ||
| fake_requests.get = lambda **kwargs: None | ||
| sys.modules["requests"] = fake_requests |
There was a problem hiding this comment.
Stop shadowing real deps from test module import
The fallback bootstrap checks sys.modules instead of import availability, so this file injects fake requests/bs4 modules whenever they have not been imported yet (the common case), even if those packages are actually installed. Once this test module is imported, the stubs remain in sys.modules, so later tests or helpers that rely on real APIs (for example requests.Session or bs4.element) can fail or silently avoid exercising real integration paths; this makes the new suite order-dependent and can mask dependency regressions.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 094bce41e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| install_requires=[ | ||
| "requests>=2.22.0", | ||
| "bs4>=0.0.1", | ||
| "requests>=2.32.3", |
There was a problem hiding this comment.
Keep install_requires compatible with declared Python floor
setup.py now requires requests>=2.32.3, but the package still declares support for python_requires>=3.7; requests 2.32.x dropped Python 3.7 support, so installs on 3.7 will fail dependency resolution even though this package advertises compatibility. Please align the declared Python minimum with the new dependency floor (or relax the requests constraint).
Useful? React with 👍 / 👎.
Motivation
pytestpour rendre les tests disponibles localement.Description
requirements.txtvers des versions modernes (par ex.requests==2.32.3,beautifulsoup4==4.13.4) et ajout depytest==8.3.4.setup.pysur les nouvelles dépendances (requests>=2.32.3,beautifulsoup4>=4.13.4) et ajout deextras_require={"test": ["pytest>=8.3.4"]}.tests/test_larousse.py, une suite de tests couvrant l'extraction des définitions/synonymes/citations, la gestion d'erreur HTTP et la vérification que l'URL utilise la forme en minuscules, avec des fallbacks légers pour fonctionner dans des environnements sans accès réseau.python -m compileall larousse_api tests.Testing
python -m pip install -r requirements.txta échoué en raison d'une restriction réseau/proxy dans l'environnement (échec externe, pas d'erreur de code).python -m pytest -qa réussi, résultat :5 passed.python -m compileall larousse_api testsa réussi.Codex Task