Access files as setuptools pkg_resource#2309
Open
ajw-aws wants to merge 5 commits into
Open
Conversation
|
This looks great! Adding |
Author
|
PR updated
|
nrbgt
reviewed
Jun 12, 2020
| packages=['safety_db'], | ||
| license='Attribution-NonCommercial-ShareAlike 4.0 International', | ||
| install_requires=[], | ||
| install_requires=['install_requires'], |
|
Hello! Is there something I can help with to get this PR merged? |
pawamoy
referenced
this pull request
Nov 18, 2020
Not doing so causes nothing in the data directory to be included in the distribution.
|
Any reason why this has not merged yet? |
|
If I understand correctly stdlib's importlib.resources would be preferred over setuptools' pkg_resources, wouldn't they? |
Yep, wait a few more weeks on this until 3.6 is EOL and yeah, stdlib ftw! |
efokschaner
added a commit
to efokschaner/safety-db
that referenced
this pull request
Feb 4, 2022
This is a updated fix for pyupio#2308 and supersedes pyupio#2309 It uses importlib.resources which means dropping support for python 3.6 and below
|
I've made a version of this PR which uses Let's get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
from
data/__init__.py:That open is relative to your working directory, the reason it works for testing is that folder data is in the root of your package. The proper way to access this file is with
pkg_resourcesfrom setuptools as aresource_filename.