Ease packaging by not trying to write stuff alongside the python code
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
I am packaging botright for NixOS, which places the resulting package below the read-only /nix/store. This led to multiple issues in hcaptcha_challenger and botright by throwing permission errors.
Describe the solution you'd like
Modify the code to not depend being able to write alongside the python code. That'd ease packaging.
The offending place here is this line. Changing it to tmp_dir = Path("./hcaptcha-challenger/tmp_dir") fixes this problem.
I'm open to another path to store this data. Maybe as it is temporary, /tmp or /var/tmp are useful places? (by just using a mktempdir function). Alternatively, a configurable place for this data is also fine by me.
Describe alternatives you've considered
Continue needing to patch the source while packaging. This is unpleasant and makes updates harder.
Additional context
FYI two other patches are in place in my packaging script:
- Removing all
undetected_playwrightimports because it is not available, I was unable to package it and just use playwright anyways. Without it, python errors out because it cannot find the module. - The chrome browser is not found (code). I know this is a problem of the
browserslibrary you use.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in botright/modules/hcaptcha.py at the linked line where tmp_dir is defined, and inspect how hcaptcha-challenger uses that path. Confirm the package can run from a read-only Python installation; done means temporary data is stored in a writable location without requiring a source patch, using an approach consistent with the project’s chosen path configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100