This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Replace pkg_resources file ref with pathlib#758
Open
timmysilv wants to merge 2 commits intoXanaduAI:masterfrom
Open
Replace pkg_resources file ref with pathlib#758timmysilv wants to merge 2 commits intoXanaduAI:masterfrom
timmysilv wants to merge 2 commits intoXanaduAI:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #758 +/- ##
===========================================
- Coverage 98.33% 60.67% -37.66%
===========================================
Files 78 78
Lines 9603 9539 -64
===========================================
- Hits 9443 5788 -3655
- Misses 160 3751 +3591
... and 74 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
timmysilv
commented
Jul 21, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Context:
FlamingPy started to depend on strawberryfields and importing
pkg_resources(by importing this) raises a deprecation warning. Even more concerning, this repo does not express its direct dependency on setuptools despite requiring it (likely because it was shipped with python by default for the longest time).Description of the Change:
Replace
pkg_resources.resource_filenamewithpathlib.Path(__file__). The data neighbours the source files so pathlib has no problem getting the job done.Benefits:
Possible Drawbacks:
While I'm quite certain that
package_datainsetup.pydoesn't relocate data files, I don't know if there's something in a PEP that says it isn't necessary and some build tools don't respect it.strawberryfields/setup.py
Lines 45 to 46 in cc0a0e4
Anyway, installing strawberryfields today does what one would expect:
apps/data/ tree
Related GitHub Issues:
N/A