matecsaj / matecsaj/ebay_rest

V2 - Make Selenium optional (only required for one function)

Open
#62 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
71
Forks
14
PR merge metrics
No merged PRs in 30d

Description

I am using ebay_rest without Selenium - I manage my own redirects as this is a web application. I would not install Selenium on our live server and it wouldn't work anyway in this configuration. All the Selenium imports in token.py are only used in a single function _get_authorization_code which I don't use (I supply the API object with all refresh token information directly).

Selenium is obviously very useful if you need it, but it is a very significant unnecessary requirement if you don't and a bit of a show-stopper for me.

The actual import is easy to deal with; either move the imports back into the relevant function or wrap in a try/except and throw an error if _get_authorization_code gets called. A user-friendly error ('Install Selenium to use the webdriver-based eBay user token authentication') could be displayed.

The trickier bit I guess is that Selenium is a pip required install; I'd prefer a recommended but not required install? ebay_rest isn't an end-user package; this is a developer package so I figure anyone working with it should be able to read the instructions and install Selenium if required (and add it to their requirements.txt/equivalent if packaging it).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in token.py, focusing on the Selenium imports and the _get_authorization_code function. Check how Selenium is declared as an installation requirement, then make it optional while preserving the webdriver-based flow and providing a clear installation error when that function is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.