python-scraperlib icon indicating copy to clipboard operation
python-scraperlib copied to clipboard

Contribution instructions in README.md need work

Open richterdavid opened this issue 1 year ago • 5 comments

https://github.com/openzim/python-scraperlib/blob/7d498319baadba715316c15cf9857ff2f6974a00/README.md?plain=1#L60

  1. My Debian install uses the "externally managed" python3 install option, so it seems that I need pipx rather than pip. Neither was installed and I had to find installation instructions for both. It would be nice to link to them.
  2. pip install ".[dev]" must be run from the local clone of python-scraperlib/.
  3. IIUC pre-commit also requires a pip/pipx install, after which the current line is redundant
  4. invoke is unknown after all that.
$ invoke coverage
-bash: invoke: command not found

richterdavid avatar Apr 18 '24 22:04 richterdavid

Thank you. I realize we also do not mention that a local venv is recommended.

@rgaudin do you remember if there is a reason why we did not mentioned it? I would even recommend to use hatch shell to create the venv and install the Python dependencies at once, like we have on ted scraper for instance: https://github.com/openzim/ted?tab=readme-ov-file#getting-started-rocket

My Debian install uses the "externally managed" python3 install option, so it seems that I need pipx rather than pip. Neither was installed and I had to find installation instructions for both. It would be nice to link to them.

We won't be able to delve into the specifics of all OS distributions, but I agree we need to mention that you must have a working python + pip version (and maybe hatch)

pip install ".[dev]" must be run from the local clone of python-scraperlib/.

Of course, all instructions must be ran from the local clone ; I will mention it in the README to make it more obvious

IIUC pre-commit also requires a pip/pipx install, after which the current line is redundant

Nope, pre-commit is installed (i.e. "downloaded" to your machine) by pip install ".[dev]" but the Git hook still has to be configured with pre-commit install

invoke is unknown after all that.

Are you running it from the local clone after pip install ".[dev]" ?

benoit74 avatar Apr 19 '24 06:04 benoit74

@rgaudin do you remember if there is a reason why we did not mentioned it?

No. It all makes perfect sense to me… but I'm not the target audience for this block 😉

Given we're using the bootstrap, I think this should be in the template README (maybe start by copying ted?). We could have a single doc and reference it everywhere but I think directly-readable instructions on the README are a lot better than a link

rgaudin avatar Apr 19 '24 07:04 rgaudin

Given my externally managed python3 install, I used pipx to install hatch and .[dev]. With the result that pre-commit was not installed in any visible way. I could certainly start over with venv if that's recommended.

richterdavid avatar Apr 19 '24 15:04 richterdavid

Are you running it from the local clone after pip install ".[dev]" ?

yes

~/github/python-scraperlib$ invoke coverage
-bash: invoke: command not found

richterdavid avatar Apr 19 '24 15:04 richterdavid

Given my externally managed python3 install, I used pipx to install hatch and .[dev]. With the result that pre-commit was not installed in any visible way. I could certainly start over with venv if that's recommended.

Up to you, you just need to have stuff installed available, otherwise it will obviously fail.

benoit74 avatar Apr 30 '24 10:04 benoit74