indygreg / indygreg/PyOxidizer
Accessing __file__ from certifi and pytz
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 256
- PR merge metrics
- No merged PRs in 30d
Description
Hi, this tool looks very good. I'm trying to package my first app. Unfortunately, it depends on `certifi` and `pytz`.
I can't find a way to access the files bundled with the modules.
I've tried:
- `pkgutil.get_data('certifi', 'cacert.pem')` -> `None`
- `importlib.resources.read_binary('certifi', c 'cacert.pem')` -> `FileNotFoundError: Package has no location )>`
- `import pkg_resources` -> `ModuleNotFoundError: No module named 'pkg_resources'`
I haven't tried the `__loader__` method yet because it means I *have to* fork the dependencies. At least with `certifi`, I thought I could monkey-patch it.
I donl't like much the `app-relative:lib` install location because that complicates the distribution and updates of the app.
Contributor guide
No contributing guide indexed for this repository
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 by reproducing the certifi and pytz resource lookups using pkgutil.get_data and importlib.resources.read_binary, then compare them with the mentioned __loader__ method and app-relative:lib installation. Done means bundled dependency files can be accessed without forking dependencies or relying on app-relative:lib.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100