-
Notifications
You must be signed in to change notification settings - Fork 100
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
__init__.py: rework imports #334
__init__.py: rework imports #334
Conversation
1706a86
to
3b017ad
Compare
I've cherry-picked @avdempsey's two commits from #335, with |
45556ca
to
a0a06b5
Compare
1f89a91
to
91322ab
Compare
Although doublethink is an optional dependency to allow brozzler to be used as a library without it, in practice we had some mandatory import statements that prevented brozzler from being imported without it. This fixes that by gating off some of the imports and exports. If doublethink is available, brozzler works as it is now. But if it isn't, we make a few changes: * brozzler.worker, brozzler.cli and brozzler.model reexports are disabled * One brozzler.cli function, which is used outside brozzler's own cli, has been moved into brozzler's __init__.py. For compatibility, it's reexported from brozzler.cli.
91322ab
to
c5aa461
Compare
@@ -260,6 +269,38 @@ def thumb_jpeg(self, full_jpeg): | |||
img.save(out, "jpeg", quality=95) | |||
return out.getbuffer() | |||
|
|||
def should_ytdlp(self, logger, site, page, page_status, skip_av_seeds): |
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.
More a note to self than anything, but I have changes to this method in #288 (per-seed video exclusion) that will need to be moved over.
4879e00
to
907eace
Compare
In local testing, I realized that the |
I've been doing some local testing, and I've found that Before with
This is under Python 3.12. I'm using
Virtual env packages installed:
Upgrading
|
Looks good to me. |
I've been asked about the impact of this on users more broadly, so I wanted to summarize exactly what users should expect. Broadly: there are no impacts, except in very specific circumstances. We haven't broken compatibility with anything, and users will only see any kinds of changes if they don't have optional modules installed that were formerly mandatory. For users who use brozzler's commandline tools ( The biggest impact is for users who use brozzler as a library, rather than run the worker or the CLI tool. Although we intended to make doublethink and yt-dlp optional to support this case, it wasn't actually possible to |
Although doublethink is an optional dependency to allow brozzler to be used as a library without it, in practice we had some mandatory import statements that prevented brozzler from being imported without it. This fixes that by gating off some of the imports and exports.
If doublethink is available, brozzler works as it is now. But if it isn't, we make a few changes:
brozzler.worker
,brozzler.cli
andbrozzler.model
reexports are disabledbrozzler.cli
function, which is used outside brozzler's own cli, has been moved into brozzler's__init__.py
. For compatibility, it's reexported frombrozzler.cli
.