Configure tox to package your project as a wheel during testing; this avoids pip repackaging a .tar.gz file to a wheel for each test environment.
Configure tox to package your project as a wheel during testing; this avoids pip repackaging a .tar.gz file to a wheel for each test environment.
pelican-precompress now supports Python 3.11 and 3.12.
pelican-granular-signals now supports Python 3.11 and 3.12.
When I switched to Windows Terminal and Powershell, Python's REPL stopped tracking my command history. Hacking the registry fixed the problem.
pelican-granular-signals now officially supports Python 3.10.
pelican-precompress now officially supports Python 3.10.
pelican-granular-signals will send signals to your plugins at the right time, every time.
pelican-precompress 2.1.0 guarantees that it'll run after your other plugins have generated content. Beat the rush and upgrade now!
Now that I've covered the basics of monkeypatching, it's time to dig deeper.
When you monkeypatch a function, you're limited to accessing the function's parameters and other data in its global scope. This article is an introduction to one way that you could access data in the calling function's local scope.
Monkeypatching is a common word among Python programmers. But what is it?
This post is an introduction to monkeypatching.
pelican_precompress 1.1.1 is now released and features faster compression times.
Remember that one time when your software requirements changed and you realized that you would have to make dramatic changes to your code? Remember how that's only happened to you once?
I've been working on the same codebase for eight years. During that time I've learned that requirements change, and I've slowly learned some design patterns that can help make code flexible enough to accommodate changing requirements.
I'd like to share some of those experiences and lessons with you.
Hynek Schlawack posted an article titled "Why you should document your tests". I think that you should document your individual assertions, too.
I've created a Pelican plugin that pre-compresses my static files using gzip, zopfli, and brotli.
I have to maintain code and narrative documentation for compliance reasons at work, but I don't want to separately update the documentation each time I update the code! Luckily, because I'm using Python and Sphinx, it's easy to the automatically update the docs.
I misread a recent feedparser bug report and thought that the author had mistyped a bbcode- or wiki-formatted link. Consequently, I wasted time debugging the code.
Turns out, I wasted a lot of time, because I spent more than zero time debugging the code. Yes, zero time. I was using …
After going through many, many feedparser bugs (over 100 closed since I started working on the project, with more waiting to be reviewed!) I've seen a lot of reports asking for additional support for various namespaces. Off the top of my head the list includes GeoRSS, the iTunes Music Store …
One week ago I announced that I was going to port feedparser to Python 3. Two days ago, I wrote that I had one big question to answer: str
or bytes
?
Today I can say that str
was the correct answer: feedparser passes all 4055 unit tests in Python 3 …
I spent some time this weekend working on porting feedparser to Python 3, and found that it will be difficult because there are two separate parsers included (a strict parser and a loose parser), and while each works differently, both use the same core machinery in feedparser.
With the strict …
Today I'm announcing I'm throwing my hat in the ring to port feedparser to Python 3. There's a ticket open regarding this at the feedparser bug tracker, but the person who's working on porting it appears to be writing Python 3 code instead of writing Python 2 code that the …
I've really been working hard to make sure that every piece of code that I commit to listparser is backed by unit tests to ensure that the code does what I expect it to do. But a while back I had the idea that it would be great to have …
I recently found a need to subclass the builtin type unicode
and add some additional properties. To instantiate I wanted to pass in a big, ugly object and get a unicode object back. After trying fruitlessly to override __init__
, I finally read up on the Python data model. Turns out …
A few days ago I added support for tracking Wordpress.com comments, but its implementation leaves a lot to be desired, as I'm merely using comment feeds for the purpose.
The first problem is that Wordpress.com limits the number of comments in feeds to 10. Thus, it is very …
Earlier this month I wrote about scraping LiveJournal comments. What was I thinking?
While I was able to account for a number of variables in the page by tweaking my XPath statements, it became obvious early on that screen scraping for comments should be a last resort. So I decided …
As a first attempt at expanding my comment tracking software, I did a little testing in regards to scraping LiveJournal comments. Having written some uncomfortably convoluted XSL transformations in the past, I've become familiar with XPath. While BeautifulSoup has served me well in the past for quick excursions into the …
So I've been working like a fiend to import all of my comments from around the internet. It has been a herculean effort because almost everything has to be done manually. One comment here, another there, and no uniform way to extract those comments.
Two sites, however, made comment retrieval …
Django has made my web development life easier.