New patches of just deployed on this instance! Templates can now be configured, so I may end up doing more in-depth changes to this instance later. Thanks @[email protected]!

Perhaps the biggest change is not coming from the patches, but from me configuring code highlighting correctly. All my snippets are now full of color instead of using only shades of grey 😅

I've been testing out 's over the last 2 weeks. I like the idea of multiple hops for added privacy online and the dedication to open source software, but was hesitant about the performance hit I would take, as well as not being able to set it up in my router for all my network to use.

As expected, any bandwidth-intensive usage, like streaming or gaming, just won't work with : buffering and latency are crippling.

Tried a bunch of different settings, but with no luck. For the time being I've setup rules to exclude some traffic from but it's not ideal...

I so wish to be able to drop support for versions of Python <3.11. Not only for the speed, but I encounter situations where I would use typing.Self all the time. This is the latest one:

# Python 3.11 adds support for Self type, until then we have this.
SelfFromStrEnum = TypeVar("SelfFromStrEnum", bound="FromStrEnum")

class FromStrEnum(Enum):
    """Access enum variants with strings ensuring uppercase."""

    @classmethod
    def from_str(cls: Type[SelfFromStrEnum], s: str) -> SelfFromStrEnum:
        """Instantiate an Enum from a string."""
        return cls[s.replace("-", "_").upper()]
Tomás Farías Santana shared 4 days ago
Tomás Farías Santana shared 5 days ago

Is there a word for all the work around a repository besides the code? For example: maintaining CI/CD pipelines, reviewing PRs, cutting releases, etc...

My current thought is that as open source projects grow, so does the burden on maintainers to keep up with this support work. And it's a burden harder to allocate new contributors, due to, for example, security concerns. Is there a way to increase visibility for this type of work? Perhaps make it more accessible, secure, and rewarding to participate on it? 🤔

Tomás Farías Santana shared 9 days ago

I have an hook that manages a tempfile.TemporaryDirectory. While testing, I noticed it was not being deleted when I cleared the attribute (_tmp_dir) that held a reference to it.

Thanks to gc.get_referrers and sys.getrefcount, I spotted a bug in my code:

@property
def tmp_dir(self):
    """Returns a temporary directory."""
    if self._tmp_dir is None:
        self._tmp_dir = TemporaryDirectory()
        self.log.info("Initialized temporary directory: %s", self._tmp_dir)  # 🐛
    return self._tmp_dir

My hook's logger is holding a reference to the temporary directory! Logging only the name attribute of the temporary directory object fixed the issue, although I wasn't able to reproduce it in an isolated example without . Perhaps some buffering going on in the Airflow logger?

Was wondering why a unit test kept failing when running it on its own, but not when running the entire test pipeline.

Turns out the test database I am starting using a pytest.fixture was scoped to the entire test session, and previous tests would populate the db with data that made my unit test pass. But when running just the single test, this data wasn't populated!

Keep your unit tests isolated! Module scope is a better fit for my use case as each test module should pass in isolation.

Tomás Farías Santana shared 13 days ago
Tomás Farías Santana shared 16 days ago

I am feeling overwhelmed with the new code view: there's a lot of information on screen that diverts my eyes from the code. I also don't like having my ctrl+f hijacked.

Thankfully, I can easily opt out for now...

Tomás Farías Santana shared 18 days ago
Tomás Farías Santana shared 18 days ago

Finally had time to ditch Codecov and move to pure .py thanks to the great guide by @[email protected]. I got tired of getting pinged by Codecov for false negatives, and never liked the web UI.

That being said, this was a pain 🙀 I always ran pytest-cov instead of coverage directly, so I struggled to get the sources configured to combine coverage files between runners, all while working with . I kept getting 0% coverage reports even though my project is well over 98%.

Perhaps I should switch to tox as my CI is testing for 4 different and 3 different versions...

Tomás Farías Santana shared 20 days ago

Had a bit of a disaster on my microblog.pub instance. Turns out restarting a with:

docker restart microblog-app

Won't actually use the new image you have just pulled. Instead, I had to:

docker stop microblog-app && docker rm microblog-app && docker run ...

Oh well... Enjoy the new theme! More changes coming.

My notifications page is flooded to the point it's unusable. First step will be to see which repos I'm currently watching. I was automatically set to participate in a lot of my org's repos automatically and perhaps there is a setting to require a confirmation.

How do people come up with good names for their packages?

Tomás Farías Santana shared 23 days ago