10000 Allow pkg_resources' resource APIs to be used inside .par files. by duggelz · Pull Request #52 · google/subpar · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Allow pkg_resources' resource APIs to be used inside .par files. #52

Merged
merged 3 commits into from
Nov 13, 2017

Conversation

duggelz
Copy link
Contributor
@duggelz duggelz commented Nov 10, 2017

Several limitations apply.

Fixes #38

Partially addresses #43

duggelz pushed a commit to bazel-contrib/rules_python that referenced this pull request Nov 10, 2017
@duggelz
Copy link
Contributor Author
duggelz commented Nov 10, 2017

CC @Yhg1s @gpshead @yilei FYI. We could do something similar for internal .par files if we wanted to migrate from the internal resources.py API to a pkg_resources/setuptools API.

@duggelz
Copy link
Contributor Author
duggelz commented Nov 10, 2017

Once I have the functionality in a good place, I'll make a separate PR to make this easier for users. E.g. something like

par_binary(
    ...
    extract_at_startup_and_add_to_import_path = ['wheel']
    ...
)

But I'll have to think about the various use cases of data files, importable python, shared libraries for C extension modules, etc.

dirname = pkg_resources.resource_filename(req, '')
expected = [
# The __init__.py file shouldn't be here, but is, as an
# unfortunately side effect of Bazel runfiles behavior.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you opened a GitHub issue, do you want to link to it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0