-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
rename validate_zimfile_creatable to validate_file_creatable #210
rename validate_zimfile_creatable to validate_file_creatable #210
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 38 38
Lines 2221 2223 +2
Branches 426 426
=========================================
+ Hits 2221 2223 +2 ☔ View full report in Codecov by Sentry. |
632d506
to
2b30a89
Compare
2b30a89
to
ddbf524
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I like the fact that we expose the method on folder, this is what I needed in another scraper indeed.
I think this is the typical example of something for which we do not want to maintain backward compatibility (we discussed about it with the team yesterday). Keeping old exception names is just weird / confusing.
I propose that we consider this as a real breaking change and:
- rename all exceptions to remove any "ZIM" reference in their name (and clearly document these renaming in the changelog so that it is easier for scraperlib users to know about it)
- completely drop the
validate_zimfile_creatable
method - bump version in
__about__.py
to5.0.0-dev0
to indicate this will need a major (we already had doubts about whether other changes of the scraperlib deserved a major or not, this is somehow providing a good answer ^^)
@rgaudin OK for you?
Yes, fine with me. I'd suggest we use a dedicated subsection in the changelog ( |
Agreed. Let's add it to the bootstrap: openzim/_python-bootstrap#50 |
@benoit74 , should I implement these on top of this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Rationale
This PR renames the
validate_zimfile_creatable
method tovalidate_file_creatable
to reflect its general applicability to check file creation beyond ZIM files. This resolves #200Changes
validate_folder_creatable
function to check if a folder can be written to.validate_file_creatable
function to check if a file with a given filename can be created in a given foldervalidate_zimfile_creatable
to usevalidate_file_creatable
method with deprecation warning.