Posts

Incus - Linux Containers

Alternative to Distrobox

The desire for isolated and on-demand development environments can be met with Distrobox, however it isn't well suited for development in terms of flexibility.

One shortcoming with that Distrobox is that it doesn't offer the option to specify the location drive for containers. This option is handled by the container software that is used with Distrobox. While Docker does offer a way to specify a way to use containers in another drive, Distrobox didn't quite work well with Docker when the storage location of containers was changed in the Docker from my experience.

Since Distrobox is wrapping the functionality of either Docker or Podman, which means that it lives with the limitations of Docker or Podman. There is also the great likelihood that some features can't be mapped perfectly.

To address this issue, one would want to use a more full-fledge solution such as Incus. With Incus, you no longer have to install a container application such as Podman or Docker with Distrobox for environment isolation.

Categories: #containers
Pyside - Draggable Collapsible Panels

Reorder Containers that can Expand and Collapse

To further expand upon prior discussion of collapsible panels from previous posts

Superqt - Distributing QCollapsible Containers

PyQT - Collapsible Sections

In the previous article, the panels were referred to as containers, but in this article they will be referred to as panels instead. The term container might be confused with the element that houses all the panels.

We will want to improve our panels beyond being only collapsible by adding draggable/sortable capabilities.

Demo of Behavior

Categories: #python
Tags: #pyside
Mise - Package Manager

Choices and Versatility

Asdf is a tools and program installer that has been around for some time, but there is a newer tool that grants you the powers of asdf with even more capabilities such as automatic dependency management, larger choice of programs with support from different source registries and temporary dependency switching which comes from mise.

These aren't the only functionality of mise, but they are a few that can make an impact on improving your dependency management workflow.

Automatic Dependency Change Upon Project Folder Navigation

Mise simplifies the way you manage your runtime or programming language versions when you need to switch to different project folders that require a certain version.

Supposedly that you are interested in install different versions of nodejs, one LTS and the other more newer non-LTS version.

mise install node@22.12.0
mise install node@23.11.0

Set the version of nodejs that is to be the global default. This should generally be a LTS version of nodejs.

mise use --global node@22.12.0
Categories: #installer
Vitest - Optional Pass in Timeout

Custom Timeout

In the situation where your tests might actually run slower on another person's machine, you should give them an option to increase the timeout to prevent timeout failures.

At first glance, you might do something like this to run the command to accept a timeout value.

npm run test -- --testTimeout=50000
Categories: #JavaScript #testing
Vitest - Testing Observables

Read Observables Values Correctly

As the JavaScript world have adopted promises to handle asynchronous events, it would be no surprise that Vitest would also support promises.

Stepping away for Vitest for a moment, the general method of testing RxJS observables was through marble diagram testing such as using TestScheduler, but the TestScheduler is more suited for testing the order of emitted values from observables.

If your observable only emits one final value, it is more suitable to convert the observable to a promise and check the return value in Vitest as shown below

import { lastValueFrom } from 'rxjs';

// Depending on your application, you might need to switch
// out lastValueFrom with firstValueFrom for the conversion to work.
const promiseResults = await lastValueFrom(returnsObservable());
expect(result).toBe(valueExpected);
Categories: #JavaScript #testing