-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Python 3 Upgrade (minimal) #577
Conversation
- removed the compat_logging, since logging is in the stdlib - removed sanitize in favor of markupsafe
- starting to add typing - fixed boolean flags in many places - switch from hand-parsed args to argparse - switch from htmltmpl to jinja2 TODO: - core templates need to be converted to jinja2 - cache keys are still failing
The 2to3 conversion changed the `has_key` to `in` but in this instance, the class overrides `__contains__` in a way that changes the semantics of it.
- use markupsafe instead of the stripHtml mini-class - fix sorting of news items - handle out of bound dates (terribly)
Hi @offbyone! Thanks for picking up the torch here! Is this in a state that generates usable output, or does it still have some ways to go before being (manually) testable? |
It generates useful input on first run, I'm still having some issues with caching. I expect to have time to dig into that this week. |
Thank you @offbyone for the great work. I'm also wishing we could automate the check for valid rss using GH actions or as part of CI. Would that be possible to add? Should I open an issue about it? |
Opening the issue can't hurt; worst-case, it won't happen, but if it makes sense to do, we can. |
- switch to argparse - fix a couple of minor 2-3 bugs - slightly nicer logging of a couple of exceptions
Okay, I'd call this ready to review. I don't know much about how it's currently running or deployed, although I can make some inferences based on the current code. I'm happy to sysadmin that shit if the owners of the host want me to. |
Mitigates the impact of python/cpython#91228
temporary measure while python/planet#577 is in progress
temporary measure while python/planet#577 is in progress
planet: deploy planet from a py2 specific branch temporary measure while python/planet#577 is in progress
Merging this into a new |
https://planetpython.org/3/ is now running and updating along side the main instance. The initial result is a little confusing, I guess we'll see how it behaves over time? |
No, I think I see what's happening there. There are two things that I'll want to address, one is full text feeds and the other is something that's possibly stateful. The DB has a field - |
Oh, man... yeah, there are some bugs in that output now that I can see it beside the current planet. I'll put together some fixes by the weekend (evenings are a bit slammed for me this week) |
Archives of current state: https://planetpython.org/cache-1728569965.tgz |
Can you tell me which version of python (and, possibly, OS version and dbm library version) are involved in generating that? I hope it won't matter, but I might need to spin up a replica of the original to use those caches. |
@offbyone |
|
That's the preview deploy, the state is from the original. |
Ah, @offbyone do you want the cache/output for the new version or the original? |
Honestly, "both is good" is even better. That way I can apples-to-apples it. |
for the new thing: https://planetpython.org/cache3-1728570557.tgz
|
Okay, so I have some good news and some bad news. The good news is that I can definitely get the ordering issues sorted. The bad news is that as far as I can tell, I can't use the cache from the v2 version with v3, to retain the "hidden" state from the old feed cache. I'm looking into seeing how I can get that status, because it would radically change the feed if we lose it. |
I'm going to see if I can figure that one out somehow. I suspect I'm missing something with the weird ways dbm loads files. |
Note: This PR is built on the work started by @JacobCoffee in #569
A minimal Python 2 to 3 upgrade for planet. This is not a complete rewrite, it is the code changes necessary to allow the existing sequential feed updater to run using Python 3.12 rather than 2.... well, probably 2. Looking at this code I suspect it was Python 1, mostly.1
Notable Changes
Notable Unchanges
Work left to do