indygreg / indygreg/PyOxidizer

Accessing __file__ from certifi and pytz

Open
#91 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

compatibility
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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.