-
Notifications
You must be signed in to change notification settings - Fork 277
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
fix(pathy): don't force input paths to Path when de/serializing objects #465
Merged
adrianeboyd
merged 13 commits into
explosion:master
from
justindujardin:fix/pathy-serialize-config
Feb 9, 2021
Merged
fix(pathy): don't force input paths to Path when de/serializing objects #465
adrianeboyd
merged 13 commits into
explosion:master
from
justindujardin:fix/pathy-serialize-config
Feb 9, 2021
+90
−18
Conversation
This file contains 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
- With the spacy 3 release, I noticed Pathy can't save models because thinc is forcing them to be PosixPath even if they're Pathy on the way in. - To fix, only force to Path() if the input is a string
justindujardin
changed the title
fix(pathy): don't force input paths to PosixPath
fix(pathy): don't force input paths to Path when de/serializing objects
Feb 1, 2021
Codecov Report
@@ Coverage Diff @@
## master #465 +/- ##
==========================================
- Coverage 59.66% 59.37% -0.30%
==========================================
Files 100 101 +1
Lines 7079 7148 +69
==========================================
+ Hits 4224 4244 +20
- Misses 2855 2904 +49
Continue to review full report at Codecov.
|
justindujardin
force-pushed
the
fix/pathy-serialize-config
branch
from
February 2, 2021 00:23
9b904e8
to
1be4a17
Compare
This reverts commit d68ada0.
Because tensorflow requires `numpy~=1.19.2`, the isolated sdist build ends up incompatible with the venv after tensorflow is installed, so instead, install tensorflow and requirements separately and then build without build isolation.
Note: `pip install -c constraints.txt` doesn't pass the constraints into the nested `pip install` command used to set up the isolated build env, but setting the supposedly equivalent environment variable `PIP_CONSTRAINT` does work because it's still set when the nested pip command runs.
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.
With spaCy 3, saving models to Pathy paths has stopped working.
It turns out that thinc is forcing the input paths to be a Path class by wrapping them "just to be sure". It's friendly and concise, but it messes with inputs that are already path-like objects.
I added tests to demonstrate the failure, and as a fix, I only coerce the type to Path if it is a string.
Related to: justindujardin/pathy#44