refactor: deep review fixes round 3
- client.py:
- Remove dead _extract_cursor second branch (unreachable code)
- Cache SSL context as module-level _SSL_CTX (avoid re-reading CA certs)
- Add 404 stale-fallback retry to _graphql_post (parity with GET)
- Remove dead core.get('name')/core.get('screen_name') in fetch_user
- Set Content-Type: application/json only for POST requests
- Rename _to_int → _parse_int for clarity vs config._as_int
- Add 'not thread-safe' note on module-level caches
- cli.py:
- _fetch_and_display now accepts optional config param (fix double load)
- Refactor user_posts to use _fetch_and_display
- Pass config to all _fetch_and_display callers
- pyproject.toml:
- Move xclienttransaction/requests to optional [transaction] deps
- Add beautifulsoup4 to [transaction] optional deps
- README.md:
- Add rateLimit config section with comments
- Add constants.py to project structure tree
This commit is contained in:
@@ -30,11 +30,14 @@ dependencies = [
|
||||
"click>=8.0",
|
||||
"rich>=13.0",
|
||||
"PyYAML>=6.0",
|
||||
"xclienttransaction>=1.0.1",
|
||||
"requests>=2.32.4",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
transaction = [
|
||||
"xclienttransaction>=1.0.1",
|
||||
"requests>=2.32.4",
|
||||
"beautifulsoup4>=4.12",
|
||||
]
|
||||
dev = [
|
||||
"pytest>=8.0",
|
||||
"ruff>=0.8",
|
||||
|
||||
Reference in New Issue
Block a user