Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pkg_resources dependency #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RealOrangeOne
Copy link
Member

This improves support for Python 3.12.

(CI is very broken, it's not my fault. See #49)


def get_db():
"""Get the parts DB that is embedded with this library."""
file = pkg_resources.resource_stream('sr.tools.bom', 'component_lib.csv')
return Db(six.StringIO(file.read().decode('UTF-8')))
file = module_dir / 'component_lib.csv'
Copy link
Member

@PeterJCLaw PeterJCLaw Sep 29, 2024

Choose a reason for hiding this comment

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

This creates a dependency on the package being on the filesystem in the same layout as the source, which the previous spelling (I think) did not. Is there no equivalent package resource lookup mechanism in the new world?

(also elsewhere)

Copy link
Member

Choose a reason for hiding this comment

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

Looks like importlib.resources might be what we want here? Not sure though.

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

Successfully merging this pull request may close these issues.

2 participants