Feeds

ComputerMinds.co.uk: Aegir 3 and Drupal 10: just about working

Planet Drupal - Mon, 2024-02-26 12:00

In my previous article I outlined that I really needed to get Drupal 10 sites running in Aegir 3. I had no time to wait around for other solutions, and I was going to try to decouple Aegir from running Drupal sites, so that it wouldn't be tied to Drupal versions.

Since writing that article and actually sitting down to do this work, I realised that it's quite an undertaking, and the approach outlined by Omega8cc in various github issues was worth a second look.

It works!

But it's wild. It comprises three main things:

  1. A custom/forked version of Drush 8.
  2. A custom/forked version of Provision 3.
  3. A custom/forked version of Drupal 10.
  4. (A sneaky fourth is that you absolutely do not want to have site-local Drush)

So...yeah...it's not going to be for the faint-hearted, but I'm going to detail out those three things a little, and how you might want to apply them to your situation.

Custom Drush 8

So the official Drush 8 doesn't support Drupal 10. But, it's actually not that much work to get this up and running, since Drush has pluggable 'engines' that load code based on the Drupal version that's detected when running commands.

Omega8cc has done a great job of doing the leg-work and providing a forked version of Drush, you can see the changes that have been made to support Drupal 10 here:
 

https://github.com/omega8cc/drush/compare/8.4.12...8-boa-micro

Although note, that there are some Aegir specific and non Drush 10 supporting changes in there too, so what I did was to make my own (private) fork of Drush and go through and apply the relevant changes to the files. If you don't know what the relevant changes are, then you probably are better off simply replacing your Drush with the Omega8cc fork, and it'll probably be fine.

Essentially this step is needed so that Drush sees the Drupal 10 codebase, and can interact with it correctly. It's likely that in Drupal 10's lifetime something will change, and Drush 8 will need some more work to be compatible with 10.3 and 10.4 etc.

If you were to run Drush 8 commands at this point, they'd start to bootstrap the site, but would fail with fatal errors. You need changes in Drupal 10 core too...

Custom Provision 3

Provision also makes use of Drush engines to load the correct code for the correct situation, so that if you ask Aegir to install a new site on a platform it'll load up the correct bit of code for the relevant Drupal version.

Again Omega8cc has done all the hard work here and provided the changes you need, but they are a bit harder to pick out of the repo. Try searching for files that contain '_10':

https://github.com/omega8cc/provision

And that should get you the files you need. I will note that unlike the Drush fork above, this really is a heavy fork. You are getting a lot more besides Drupal 10 support, if you can, I'd go for patching this into your existing Provision codebase.

I could add these to official provision 3 on Drupal.org, but without the other pieces they are useless and won't help you. Aegir 3 is essentially unmaintained, so while I've committed some PHP 8 fixes in the last few weeks, I'm not going to commit huge things like this.
I suppose we could have some code maintained in an issue fork or a patch.

This step is need so that Provision will call the correct bits of code at the right time, as far as I can see, these are largely the same as Drupal 9 versions of the engines.

Custom Drupal 10

Now for the big compromise.

The main problem here is that Drupal 10 uses Symfony 6, which has type hints on various interfaces and methods, and Drush 8 uses Symfony 2, which does not.

So, if you load one before the other, then as soon as PHP tries to load the second, it'll die because either the types are there, or they aren't.

This is a bit of a showstopper and there's no decent way to get it to work nicely. Instead, Omega8cc has discovered some band-aids you can slap on and while it'll work, it's brittle!

Omega8cc's fork of Provision automatically tries to apply some of these patches to Drupal 10 platforms, and gives you a nice way to add/remove them. But again, also has a lot of other opinionated changes (to provision), so if you want to know what to do to Drupal 10 core...keep reading:

We need to:

  1. Remove a bunch of typehints from Drupal core's logging mechanisms.
  2. Downgrade psr/log
  3. Patch symfony/console

 

Removing the typehints

Omega8cc have got a nice patch that does this:

https://raw.githubusercontent.com/omega8cc/boa/5.x-dev/aegir/patches/drupal-ten-aegir-01.patch

And you can apply that using composer patches if you want.

Note that if you have any classes that extend these patched classes, they'll need patching too, so if you have any custom or contrib loggers, you'll need to go sort those out.

Downgrading psr/log

Composer makes this one super easy:

composer require 'psr/log:1.1.4 as 3.0.0'

Will do what you want. It's the companion to the first step, those classes implement these interfaces, so they need to get downgraded too. This might need to get adjusted if Drupal 10 core requires psr/log 3.1.0 or something like that, but the principles should still work.

If your Drupal 10 codebase isn't managed by Composer...well...getta out here and get that sorted first.

Patching symfony/console

Drush 8 only uses part of this package, so we can get away with patching just a tiny bit of it. Essentially you want to remove the 'Input' directory within the package. If you have a build system you could delete the files as part of your build process. Omega8cc's approach is to make the directory essentially unreadable.

Either way the result is that when PHP tries to load some code that uses version 6 of Symfony\console\Input it'll fail to find the code in Drupal core, and instead fallback to the version that came with Drush 8. Luckily this code isn't used by Drupal core, but you'll need to check that your custom and contrib code doesn't use it either, or handles the case when it magically loads code from Symfony 2.

For me and my codebase this was fine. None of our custom or contrib code used the classes or interfaces, so all good.

That's it

For Drupal 10 support in Aegir, that should be it. You can run Aegir 3 in PHP 8.1 and Drupal 7 and Drupal 10 on the same box. Magic.

Make sure you don't have a site-local Drush in your composer require, otherwise, Drush 8 being the great tool that it is will find it, and pass execution over to it, but it's not the same Drush that Aegir has all it's claws/hooks in, so things will go badly quite quickly.

Gotchas

Probably many, we've not actually rolled this out into our production environment yet, but we're close.

The main thing I can think of is that Drupal 10 contrib modules are very much going to assume that there's a modern version of Drush running commands, and not Drush 8, so it's likely that they aren't going to provide Drush 8 commands. You might need to write your own shims that copy/paste large lumps of code, or call through the new style Drush commandfiles, but that means that Drush command hooks won't be working quite right etc.

So yeah, danger if you're doing anything interesting using Drush commands on your sites.

Oh, and I guess it's possible that this will all break hard in the Drupal 10 lifecycle. I mean, it probably won't because it'll always be a foundation of Symfony 6, but you never know, the Drop is always moving and all that.

Thanks to Omega8cc

This was all shown to be possible, and documented in code by the great team at Omega8cc, so thanks very much for the work they are doing. I have nothing against there heavy forks of Aegir, they just aren't for me, hence why I've tried to pull out just the bits you need into this post.

Future

I still think that Aegir 3 could be decoupled from hosting Drupal sites. So that it was hosting 'sites' and then one could have some well-defined way to interact with those sites via some command line tool depending on what they were. However, that's a big effort, and Aegir 3 is essentially unmaintained now, so that's not going to happen. 

A number of others in the #aegir Drupal.org Slack channel have mentioned other alternatives, such as Aegir 5, or getting Drush 12 running Provision commands and running everything with Drush 12 instead of Drush 8, or using some other tool as the outer runner.
I think they are all going to run into the same issues/have to deal with the same thing: abstracting the notion of the 'site'. Provision 3 takes a number of shortcuts to make it really easy to pass data around between itself and the site, and those shortcuts simply aren't possible in Modern Drupal.

However, in case there's someone out there with a big ol' budget, and a desire to keep Aegir 3 going, I think the 'decoupled' Aegir would look something like:

  • A provision where the places that it calls through to functions executed in the Drupal context abstracted out into some kind of site specific 'plugin'. Instead of trying to use the nice Drush functions for calling a 'inner' Drush command, instead the usual command line interface would be used and data simply encoded on stdin/stdout/stderr in a format not tightly coupled to Drush 8 or Drush 12/13 etc.
  • Provision calls into the Drupal site a lot and because it's never needed to be explicit about doing it, it's sometimes hard to spot where this is happening.
  • Some kind of shim package that can be composer required into sites hosted on Aegir that would provide some way for the Provision plugins to call into the Drupal site and get the response it needs. Maybe this would merely provide some Drush commands.

Good luck if anyone ever embarks on such a project! Or contact us if you want a shoulder to cry on to hire us for a project!

Categories: FLOSS Project Planets

Real Python: Duck Typing in Python: Writing Flexible and Decoupled Code

Planet Python - Mon, 2024-02-26 09:00

Python makes extensive use of a type system known as duck typing. The system is based on objects’ behaviors and interfaces. Many built-in classes and tools support this type system, which makes them pretty flexible and decoupled.

Duck typing is a core concept in Python. Learning about the topic will help you understand how the language works and, more importantly, how to use this approach in your own code.

In this tutorial, you’ll learn:

  • What duck typing is and what its pros and cons are
  • How Python’s classes and tools take advantage of duck typing
  • How special methods and protocols support duck typing
  • What alternatives to duck typing you’ll have in Python

To get the most out of this tutorial, you should be familiar with several Python concepts, including object-oriented programming, classes, special methods, inheritance, and interfaces.

Get Your Code: Click here to download the free sample code that shows you how to use duck typing in Python.

Getting to Know Duck Typing in Python

In object-oriented programming, classes mainly aim to encapsulate data and behaviors. Following this idea, you can replace any object with another if the replacement provides the same behaviors. This is true even if the implementation of the underlying behavior is radically different.

The code that uses the behaviors will work no matter what object provides it. This principle is the basis of a type system known as duck typing.

Duck Typing: Behaving Like a Duck

You’ll find many different definitions of duck typing out there. At its core, this coding style is based on a well-known saying:

If it walks like a duck and it quacks like a duck, then it must be a duck.

Extrapolating this to programming, you can have objects that quack like a duck and walk like a duck rather than asking whether those objects are ducks. In this context, quack and walk represent specific behaviors, which are part of the objects’ public interface (API).

Duck typing is a type system where an object is considered compatible with a given type if it has all the methods and attributes that the type requires. This type system supports the ability to use objects of independent and decoupled classes in a specific context as long as they adhere to some common interface.

Duck typing is pretty popular in Python. The language documentation defines duck typing as shown below:

A programming style which does not look at an object’s type to determine if it has the right interface; instead, the method or attribute is simply called or used (“If it looks like a duck and quacks like a duck, it must be a duck.”) By emphasizing interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution.

Duck-typing avoids tests using type() or isinstance(). (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs hasattr() tests or EAFP programming. (Source)

Here’s a quick example that involves birds that can swim and fly:

Python birds_v1.py class Duck: def swim(self): print("The duck is swimming") def fly(self): print("The duck is flying") class Swan: def swim(self): print("The swan is swimming") def fly(self): print("The swan is flying") class Albatross: def swim(self): print("The albatross is swimming") def fly(self): print("The albatross is flying") Copied!

In this example, your three birds can swim and fly. However, they’re completely independent classes. Because they share the same interface, you can use them in a flexible manner:

Python >>> from birds_v1 import Duck, Swan, Albatross >>> birds = [Duck(), Swan(), Albatross()] >>> for bird in birds: ... bird.fly() ... bird.swim() ... The duck is flying The duck is swimming The swan is flying The swan is swimming The albatross is flying The albatross is swimming Copied!

Python doesn’t care about what object bird is holding at a given time. It just calls the expected methods. If the object provides the method, then the code works without breaking. That’s the flexibility that duck typing offers.

The duck typing system is pretty popular in Python. In most cases, you shouldn’t worry about making sure that an object is of the right type for using it in a certain piece of code. Instead, you can rely on objects that quack like ducks and walk like ducks.

Duck Typing and Polymorphism

In object-oriented programming, polymorphism allows you to treat objects of different types as the same general type. Polymorphism aims to enable code to work with objects of various types through a uniform interface (API), which helps you write more general and reusable code.

You’ll find different forms of polymorphism in object-oriented programming. Duck typing is one of them.

Read the full article at https://realpython.com/duck-typing-python/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Maui Release Briefing #5

Planet KDE - Mon, 2024-02-26 07:55

Today, we bring you a report on the brand-new release of the Maui Project.

We are excited to announce the latest release of MauiKit version 3.1.0, our comprehensive user interface toolkit specifically designed for convergent interfaces, the complying frameworks, an in-house developed set of convergent applications, and the upcoming convergent shell environment for desktop and mobile devices.

Built on the foundations of Qt Quick Controls, QML, and the power and stability of C++, MauiKit empowers developers to create adaptable and seamless user interfaces across a range of devices, and with this release, we are a step closer to finalizing the migration to a new major version – the upcoming MauiKit4 release.

Join us on this journey as we unveil the potential of MauiKit3 for building convergent interfaces, the roadmap towards MauiKit4 and its new additions, and finally discover the possibilities offered by the enhanced Maui App stack.

Community

To follow the Maui Project’s development or to just say hi, you can join us on Telegram @mauiproject

We are present on Twitter and Mastodon:

Thanks to the KDE contributors who have helped to translate the Maui Apps and Frameworks!

Downloads & Sources

You can get the stable release packages [APKs, AppImage, TARs] directly from the KDE downloads server at https://download.kde.org/stable/maui/

All of the Maui repositories have the newly released branches and tags. You can get the sources right from the Maui group: https://invent.kde.org/maui

MauiKit4 & Documentation

MauiKit Calendar, Accounts, and Image Tools have now been ported to Qt6, joining MauiMan, MauiKit, and File Browsing frameworks. Alongside with the porting efforts, the frameworks are now documented, and available on the KDE API documentation site [HERE]. The remaining frameworks to be ported to Qt6 are MauiKit Terminal, Documents, and Text Editor, which should be fully ported and documented by the upcoming release in May.

The porting also involved updating the framework CMake code to the latest ECM changes introduced for creating QML plugins.

For the upcoming porting of MauiKit Text Editor, there are plans to move to a different backend for rendering the text more efficiently, and for Documents, the comics and ebooks backends will be reviewed and refactored to address crashing issues under Android.

You can find more information about the roadmap and plans for the migration to Qt6 at: https://invent.kde.org/maui/mauikit/-/issues/35

MauiKit Frameworks & Apps

A quick overview of the issues addressed and updates are covered in the following list:

  • Updated translations and support for more languages
  • Rebase MauiKit ApplicationWindow to QQC2 ApplicationWindow to resolve focus-stealing issues in Android
  • Update all the applications’ source code syntax in QML for the upcoming Qt6 port
  • Pick up the system light/dark preference for Android in MauiKit3, and move the handling of the Android status bar color from each app to MauiKit’s ApplicationWindow control. For MauiKit4 relay in the QStyleHints new properties
  • Split the  MauiApp code from the CSDControls. Thus register CSDControls as a new attached property: Maui.CSD [link to docs]
  • Expose the MauiKit Application root element via the attached property MauiApp, as Maui.App.rootComponent [link to docs]
  • Station fixes for handling the “terminate-session” shortcut and fixes to crashing issues when closing tabs, coming from MauiKit Terminal
  • The MauiKit’s PageLayout control has been backported from MauiKit4 to MauiKit3, and its implementation has gained new features, such as moving the collapsable elements to the footer. [link to docs]
  • Index app is now using MauiKit’s PageLayout control for splitting the toolbar actions for constrained spaces, the same as Pix
  • Pix fix the tags hot-reloading on new tags created
  • Fixes to nota syncing the terminal working directory
https://mauikit.org/wp-content/uploads/2024/02/Peek-2024-02-13-11-53.mp4
  • Vvave has gained a new option to quickly start a playlist in shuffle mode and a sleep timer: to stop playback and/or close the app after a certain time or end of the playlist
  • MauiKit’s AboutDialog has been revised and organized
  • MauiKit FileBrowsing control for creating a new file now picks the icon from the name extension
  • MauiKit Terminal and Text Editor now have a custom control exposing configurations for selecting custom color schemes
  • Index now has options to tweak the embedded terminal in Linux, such as custom color schemes, and reorganized setting entries for the terminal configurations
  • Nota now reuses the new Text Editor control for picking the color scheme and new options for  tweaking the embedded terminal
  • All of the apps now use an exported definition or the copyright notice
  • Fixes for all of the apps where the names of developers and other non-translatable strings were being marked as such
  • Fixed keyboard shortcuts for Station, Vvave, and other apps
  • Added style for the ComboBox component
  • MauiKit corrects the usage of singleton instances across threads for all the frameworks, which avoids the double instantiation from the CPP and QML side
  • Fixes to MauiKit TextEditor long press actions on touch screens
  • Fixes to style hints for the scrollbar policy coming from MauiMan
  • Fixes to Nota’s recent view selection mode
  • On mobile devices do not cache image or icon previews for the thumbnail delegates
[Known Bugs]
  • Nota crashes when opening a new file from the recent view under Android.
  • MauiKit Documents fails to open large comic books on Android, causing the app to crash due to the current design of using multiple threads for different pages. This is planned to be solved at MauiKitDocuments4 porting
  • MauiKit Text Editor TextArea has a flickering issue, which makes content jumpy on Android only. This is from upstream and should be solved on MauiKitTextEditor4 porting when moving to a different backend.
  • MauiKit FileBrowsing support for browsing SD cards on Android is currently disabled due to missing bindings to the “new” Android storage API
[What’s Next?]

For the next release, we plan to work on stabilizing the Maui Shell experience, by adding  XWayland support, and a few more things:

  • Finalize the porting of the MauiKit Frameworks to Qt6
  • Finalize and review the MauiKit documentation
  • Start the porting process of the Maui Apps to MauiKit4 AKA Qt6
  • Review MauiKit4 on Android
  • Review the migration of TextEditor to a new backend
  • Fixes to bugs on the Maui Apps stack
  • Update the Maui Apps features that are still pending

 

Maui Shell

For this release, Maui Shell and its components have received minimal updates coming from:

  • MauiCore and Maui Settings new modules for Audio and Network
  • Updated Maui Settings for MauiKit4 changes
  • Review shell aka Cask elements to be up to date with the MauiKit4 changes

 

That’s it for now. Until the next blog post, that will be a bit closer to the 3.1.1 stable release.

To follow the Maui Project’s development or say hi, you can join us on Telegram: https://t.me/mauiproject.

We are present on Twitter and Mastodon:

New release schedule

The post Maui Release Briefing #5 appeared first on MauiKit — #UIFramework.

Categories: FLOSS Project Planets

LN Webworks: Drupal Integration with Enterprise Systems: All You Need To Know

Planet Drupal - Mon, 2024-02-26 04:56

Using different systems in a company is important for success. Today, in a world full of changing technologies and IT tools, Drupal is notable. It's an open-source software that's always getting better with the help of a big community. 

Drupal is flexible because it has modules written in PHP, and you can use tools like Composer with it. This makes Drupal an ideal choice for integrating different programs in an organization. It adapts well to the evolving needs of a company's IT infrastructure.

In this guide, we will have a close look at the right way to perform seamless Drupal integration with enterprise systems. 

Why is Drupal a Great Choice for Integration? 

Drupal works well for integration due to a few key reasons. First, it's highly flexible and comes with a vast collection of modules available on Drupal.org. 

These modules, which are like pre-built pieces of software, keep growing and often offer ready-to-use solutions for integration.

Categories: FLOSS Project Planets

libredwg @ Savannah: libredwg-0.13.3 released

GNU Planet! - Mon, 2024-02-26 04:46

A minor bugfix release, mostly fixes missing dwg2ps.1

See https://www.gnu.org/software/libredwg/ and https://git.savannah.gnu.org/cgit/libredwg.git/tree/NEWS?h=0.13.3

Here are the compressed sources:
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.gz (20.1MB)
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.xz (10.1MB)

Here are the GPG detached signatures[*]:
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.gz.sig
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.xz.sig

Use a mirror for higher download bandwidth:
https://www.gnu.org/order/ftp.html

Here are more binaries:
https://github.com/LibreDWG/libredwg/releases/tag/0.13.3

Here are the SHA256 checksums:


[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:

gpg --verify libredwg-0.13.3.tar.gz.sig

If that command fails because you don't have the required public key,
then run this command to import it:

gpg --recv-keys B4F63339E65D6414

and rerun the gpg --verify command.

Categories: FLOSS Project Planets

Golems GABB: Ways to Optimize Carousel Sliders in Drupal for Faster Page Loading

Planet Drupal - Mon, 2024-02-26 03:49
Ways to Optimize Carousel Sliders in Drupal for Faster Page Loading Editor Mon, 02/26/2024 - 13:28

The rule of thumb is straightforward — the faster, the better. The speed of carousel sliders in Drupal has a huge impact on how users interact with your content. If adjusted correctly, it will surely drive your platform to the top of SERPs. 
Drupal carousel slider optimization, among other design elements, helps you entice your audience to stay on your site and speeds it up. Customers quickly abandon pages if they don’t satisfy their needs. As research shows, 7% and 11% drops in conversions and pageviews, respectfully, can happen because of a one-second lag between page loads.

Categories: FLOSS Project Planets

Python GUIs: Which Python GUI library should you use? — Comparing the Python GUI libraries available in 2024

Planet Python - Mon, 2024-02-26 01:00

Python is a popular programming used for everything from scripting routine tasks to building websites and performing complex data analysis. While you can accomplish a lot with command line tools, some tasks are better suited to graphical interfaces. You may also find yourself wanting to build a desktop front-end for an existing tool to improve usability for non-technical users. Or maybe you're building some hardware or a mobile app and want an intuitive touchscreen interface.

To create graphical user interfaces with Python, you need a GUI library. Unfortunately, at this point things get pretty confusing -- there are many different GUI libraries available for Python, all with different capabilities and licensing. Which Python GUI library should you use for your project?

In this article, we will look at a selection of the most popular Python GUI frameworks currently available and why you should consider using them for your own projects. You'll learn about the relative strengths of each library, understand the licensing limitations and see a simple Hello, World! application written in each. By the end of the article you should feel confident choosing the right library for your project.

tldr If you're looking to build professional quality software, start with PySide6 or PyQt6. The Qt framework is batteries-included — whatever your project, you'll be able to get it done. We have a complete PySide6 tutorial and PyQt6 tutorial as well as a Github respository full of Python GUI examples to get you started.

Table of Contents Tkinter

Best for simple tool GUIs, small portable applications

Tkinter is the defacto GUI framework for Python. It comes bundled with Python on both Windows and macOS. (On Linux, it may require downloading an additional package from your distribution's repo.) Tkinter is a wrapper written around the Tk GUI toolkit. Its name is an amalgamation of the words Tk and Interface.

Tkinter is a simple library with support for standard layouts and widgets, as well as more complex widgets such as tabbed views & progressbars. Tkinter is a pure GUI library, not a framework. There is no built-in support for GUIs driven from data sources, databases, or for displaying or manipulating multimedia or hardware. However, if you need to make something simple that doesn't require any additional dependencies, Tkinter may be what you are looking for. Tkinter is cross-platform however the widgets can look outdated, particularly on Windows.

Installation Already installed with Python on Windows and macOS. Ubuntu/Debian Linux sudo apt install python3-tk

A simple hello world application in Tkinter is shown below.

python import tkinter as tk window = tk.Tk() window.title("Hello World") def handle_button_press(event): window.destroy() button = tk.Button(text="My simple app.") button.bind("", handle_button_press) button.pack() # Start the event loop. window.mainloop() python from tkinter import Tk, Button class Window(Tk): def __init__(self): super().__init__() self.title("Hello World") self.button = Button(text="My simple app.") self.button.bind("", self.handle_button_press) self.button.pack() def handle_button_press(self, event): self.destroy() # Start the event loop. window = Window() window.mainloop()

Hello world application built using Tkinter, running on Windows 11

Tkinter was originally developed by Steen Lumholt and Guido Van Rossum, who designed Python itself. Both the GUI framework and the language are licensed under the same Python Software Foundation (PSF) License. While the license is compatible with the GPL, it is a 'permissive' license (similar to the MIT License) that allows it to be used for proprietary applications and modifications.

PyQt or PySide

Best for commercial, multimedia, scientific or engineering desktop applications

PyQt and PySide are wrappers around the Qt framework. They allow you to easily create modern interfaces that look right at home on any platform, including Windows, macOS, Linux and even Android. They also have solid tooling with the most notable being Qt Creator, which includes a WYSIWYG editor for designing GUI interfaces quickly and easily. Being backed by a commercial project means that you will find plenty of support and online learning resources to help you develop your application.

Qt (and by extension PyQt & PySide) is not just a GUI library, but a complete application development framework. In addition to standard UI elements, such as widgets and layouts, Qt provides MVC-like data-driven views (spreadsheets, tables), database interfaces & models, graph plotting, vector graphics visualization, multimedia playback, sound effects & playlists and built-in interfaces for hardware such as printing. The Qt signals and slots models allows large applications to be built from re-usable and isolated components.

While other toolkits can work great when building small & simple tools, Qt really comes into its own for building real commercial-quality applications where you will benefit from the pre-built components. This comes at the expense of a slight learning curve. However, for smaller projects Qt is not really any more complex than other libraries. Qt Widgets-based applications use platform native widgets to ensure they look and feel at home on Windows, macOS and Qt-based Linux desktops.

Installation pip install pyqt6 or pip install pyside6

A simple hello world application in PyQt6, using the Qt Widgets API is shown below.

python from PyQt6.QtWidgets import QMainWindow, QApplication, QPushButton import sys class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Hello World") button = QPushButton("My simple app.") button.pressed.connect(self.close) self.setCentralWidget(button) self.show() app = QApplication(sys.argv) w = MainWindow() app.exec() python from PySide6.QtWidgets import QMainWindow, QApplication, QPushButton import sys class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Hello World") button = QPushButton("My simple app.") button.pressed.connect(self.close) self.setCentralWidget(button) self.show() app = QApplication(sys.argv) w = MainWindow() app.exec()

As you can see, the code is almost identical between PyQt & PySide, so it's not something to be concerned about when you start developing with either: you can always migrate easily if you need to.

Hello world application built using PyQt6, running on Windows 11

Before the Qt Company (under Nokia) released the officially supported PySide library in 2009, Riverbank Computing had released PyQt in 1998. The main difference between these two libraries is in licensing. The free-to-use version of PyQt is licensed under GNU General Public License (GPL) v3 but PySide is licensed under GNU Lesser General Public License (LGPL). This means that PyQt is limited GPL-licensed applications unless you purchase its commercial version, while PySide may be used in non-GPL applications without any additional fee. However, note that both these libraries are separate from Qt itself which also has a free-to-use, open source version and a paid, commercial version.

For a more information see our article on PyQt vs PySide licensing.

PyQt/PySide with QML

Best for Raspberry Pi, microcontrollers, industrial and consumer electronics

When using PyQt and PySide you actually have two options for building your GUIs. We've already introduced the Qt Widgets API which is well-suited for building desktop applications. But Qt also provides a declarative API in the form of Qt Quick/QML.

Using Qt Quick/QML you have access to the entire Qt framework for building your applications. Your UI consists of two parts: the Python code which handles the business logic and the QML which defines the structure and behavior of the UI itself. You can control the UI from Python, or use embedded Javascript code to handle events and animations.

Qt Quick/QML is ideally suited for building modern touchscreen interfaces for microcontrollers or device interfaces -- for example, building interfaces for microcontrollers like the Raspberry Pi. However you can also use it on desktop to build completely customized application experiences, like those you find in media player applications like Spotify, or to desktop games.

Installation pip install pyqt6 or pip install pyside6

A simple Hello World app in PyQt6 with QML. Save the QML file in the same folder as the Python file, and run as normally.

python import sys from PyQt6.QtGui import QGuiApplication from PyQt6.QtQml import QQmlApplicationEngine app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.quit.connect(app.quit) engine.load('main.qml') sys.exit(app.exec()) qml import QtQuick 2.15 import QtQuick.Controls 2.15 ApplicationWindow { visible: true width: 600 height: 500 title: "HelloApp" Text { anchors.centerIn: parent text: "Hello World" font.pixelSize: 24 } }

Licensing for Qt Quick/QML applications is the same as for other PyQt/PySide apps.

Hello world application built using PyQt6 & QML, running on Windows 11

Kivy

Best for Python mobile app development

While most other GUI frameworks are bindings to toolkits written in other programming languages, Kivy is perhaps the only framework which is primarily written in pure Python. If you want to create touchscreen-oriented interfaces with a focus on mobile platforms such as Android and iOS, this is the way to go. This does run on desktop platforms (Windows, macOS, Linux) as well but note that your application may not look and behave like a native application. However, there is a pretty large community around this framework and you can easily find resources to help you learn it online.

The look and feel of Kivy is extremely customizable, allowing it to be used as an alternative to libraries like Pygame (for making games with Python). The developers have also released a number of separate libraries for Kivy. Some provide Kivy with better integration and access to certain platform-specific features, or help package your application for distribution on platforms like Android and iOS. Kivy has it's own design language called Kv, which is similar to QML for Qt. It allows you to easily separate the interface design from your application's logic.

There is a 3rd party add-on for Kivy named KivyMD that replaces Kivy's widgets with ones that are compliant with Google's Material Design.

A simple hello world application in Kivy is shown below.

Installation pip install kivy

A simple hello world application in Kivy is shown below.

python from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.core.window import Window Window.size = (300, 200) class MainWindow(BoxLayout): def __init__(self): super().__init__() self.button = Button(text="Hello, World?") self.button.bind(on_press=self.handle_button_clicked) self.add_widget(button) def handle_button_clicked(self, event): self.button.text = "Hello, World!" class MyApp(App): def build(self): self.title = "Hello, World!" return MainWindow() app = MyApp() app.run()

Hello world application built using Kivy, running on Windows 11

An equivalent application built using the Kv declarative language is shown below.

python import kivy kivy.require('1.0.5') from kivy.uix.floatlayout import FloatLayout from kivy.app import App from kivy.properties import ObjectProperty, StringProperty class Controller(FloatLayout): '''Create a controller that receives a custom widget from the kv lang file. Add an action to be called from the kv lang file. ''' def button_pressed(self): self.button_wid.text = 'Hello, World!' class ControllerApp(App): def build(self): return Controller() if __name__ == '__main__': ControllerApp().run() python #:kivy 1.0 : button_wid: custom_button BoxLayout: orientation: 'vertical' padding: 20 Button: id: custom_button text: 'Hello, World?' on_press: root.button_pressed()

The name of the Kv file must match the name of the class from the main application -- here Controller and controller.kv.

Hello world application built using Kivy + Kv, running on Windows 11

In February 2011, Kivy was released as the spiritual successor to a similar framework called PyMT. While they shared similar goals and was also led by the current core developers of Kivy, where Kivy differs is in its underlying design and a professional organization which actively develops and maintains it. Kivy is licensed under the MIT license, which is a 'permissive' license that allows you to use it freely in both open source and proprietary applications. As such, you are even allowed to make proprietary modifications to the framework itself.

PySimpleGUI

Best for quickly building UIs for simple tools, very portable

PySimpleGUI 5 uses a paid subscription model for commercial software. Non-commercial distribution requires both developers and recipients to have an active PySimpleGUI subscription.

PySimpleGUI aims to simplify GUI application development for Python. It doesn't reinvent the wheel but provides a wrapper around other existing frameworks such as Tkinter, Qt (PySide 2), WxPython and Remi. By doing so, it lowers the barrier to creating a GUI but also allows you to easily migrate from one GUI framework to another by simply changing the import statement.

While there is a separate port of PySimpleGUI for each of these frameworks, the Tkinter version is considered the most feature complete. Wrapping other libraries comes at a cost however — your applications will not be able to exploit the full capabilities or performance of the underlying libraries. The pure-Python event loop can also hinder performance by bottlenecking events with the GIL. However, this is only really a concern when working with live data visualization, streaming or multimedia applications.

There is a fair amount of good resources to help you learn to use PySimpleGUI, including an official Cookbook and a Udemy course offered by the developers themselves. According to their project website, PySimpleGUI was initially made (and later released in 2018) because the lead developer wanted a 'simplified' GUI framework to use in his upcoming project and wasn't able to find any that met his needs.

Installation pip install pysimplegui

python import PySimpleGUI as sg layout = [ [sg.Button("My simple app.")] ] window = sg.Window("Hello World", layout) while True: event, values = window.read() print(event, values) if event == sg.WIN_CLOSED or event == "My simple app.": break window.close()

Hello world application built using PySimpleGUI, running on Windows 11

PySimpleGUI is licensed under the same LGPL v3 license as PySide, which allows its use in proprietary applications but modifications to the framework itself must be released as open source.

WxPython

Best for simple portable desktop applications

WxPython is a wrapper for the popular, cross-platform GUI toolkit called WxWidgets. It is implemented as a set of Python extension modules that wrap the GUI components of the popular wxWidgets cross platform library, which is written in C++.

WxPython uses native widgets on most platforms, ensure that your application looks and feels at home. However, WxPython is known to have certain platform-specific quirks and it also doesn't provide the same level of abstraction between platforms as Qt for example. This may affect how easy it is to maintain cross-platform compatibility for your application.

WxPython is under active development and is also currently being reimplemented from scratch under the name 'WxPython Phoenix'. The team behind WxWidgets is also responsible for WxPython, which was initially released in 1998.

Installation pip install wxpython

python import wx class MainWindow(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, size=(200, -1)) self.button = wx.Button(self, label="My simple app.") self.Bind( wx.EVT_BUTTON, self.handle_button_click, self.button ) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.button) self.SetSizer(self.sizer) self.SetAutoLayout(True) self.Show() def handle_button_click(self, event): self.Close() app = wx.App(False) w = MainWindow(None, "Hello World") app.MainLoop()

Hello world application built using WxPython, running on Windows 11

Both WxWidgets and WxPython are licensed under a WxWindows Library License, which is a 'free software' license similar to LGPL (with a special exception). It allows both proprietary and open source applications to use and modify WxPython.

PyGObject (GTK+)

Best for developing applications for GNOME desktop

If you intend to create an application that integrates well with GNOME and other GTK-based desktop environments for Linux, PyGObject is the right choice. PyGObject itself is a language-binding to the GTK+ widget toolkit. It allows you to create modern, adaptive user interfaces that conform to GNOME's Human Interface Guidelines (HIG).

It also enables the development of 'convergent' applications that can run on both Linux desktop and mobile platforms. There are a few first-party and community-made, third-party tools available for it as well. This includes the likes of GNOME Builder and Glade, which is yet another WYSIWYG editor for building graphical interfaces quickly and easily.

Unfortunately, there aren't a whole lot of online resources to help you learn PyGObject application development, apart from this one rather well-documented tutorial. While cross-platform support does exist (e.g. Inkscape, GIMP), the resulting applications won't feel completely native on other desktops. Setting up a development environment for this, especially on Windows and macOS, also requires more steps than for most other frameworks in this article, which just need a working Python installation.

Installation Ubuntu/Debian sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0, macOS Homebrew brew install pygobject4 gtk+4

python import gi gi.require_version("Gtk", "4.0") from gi.repository import Gtk def on_activate(app): win = Gtk.ApplicationWindow(application=app) btn = Gtk.Button(label="Hello, World!") btn.connect('clicked', lambda x: win.close()) win.set_child(btn) win.present() app = Gtk.Application(application_id='org.gtk.Example') app.connect('activate', on_activate) app.run(None)

Hello world application built using PyGObject, running on Ubuntu Linux 21.10

PyGObject is developed and maintained under the GNOME Foundation, who is also responsible for the GNOME desktop environment. PyGObject replaces several separate Python modules, including PyGTK, GIO and python-gnome, which were previously required to create a full GNOME/GTK application. Its initial release was in 2006 and it is licensed under an older version of LGPL (v2.1). While there are some differences with the current version of LGPL (v3), the license still allows its use in proprietary applications but requires any modification to the library itself to be released as open source.

Remi

Best for web based UIs for Python applications

Remi, which stands for REMote Interface, is the ideal solution for applications that are intended to be run on servers and other headless setups. (For example, on a Raspberry Pi.) Unlike most other GUI frameworks/libraries, Remi is rendered completely in the browser using a built-in web server. Hence, it is completely platform-independent and runs equally well on all platforms.

That also makes the application's interface accessible to any computer or device with a web browser that is connected to the same network. Although access can be restricted with a username and password, it doesn't implement any security strategies by default. Note that Remi is meant to be used as a desktop GUI framework and not for serving up web pages. If more than one user connects to the application at the same time, they will see and interact with the exact same things as if a single user was using it.

Remi requires no prior knowledge of HTML or other similar web technologies. You only need to have a working understanding of Python to use it, which is then automatically translated to HTML. It also comes included with a drag n drop GUI editor that is akin to Qt Designer for PyQt and PySide.

python import remi.gui as gui from remi import start, App class MyApp(App): def main(self): container = gui.VBox(width=120, height=100) # Create a button, with the label "Hello, World!" self.bt = gui.Button('Hello, World?') self.bt.onclick.do(self.on_button_pressed) # Add the button to the container, and return it. container.append(self.bt) return container def on_button_pressed(self, widget): self.bt.set_text('Hello, World!') start(MyApp)

Remi is licensed under the Apache License v2.0, which is another 'permissive' license similar to the MIT License. The license allows using it in both open source and proprietary applications, while also allowing proprietary modifications to be made to the framework itself. Its main conditions revolve around the preservation of copyright and license notices.

Hello world application built using Remi, running on Chrome on Windows 11

Conclusion

If you're looking to build GUI applications with Python, there is probably a GUI framework/library listed here that fits the bill for your project. Try and weigh up the capabilities & licensing of the different libraries with the scale of your project, both now and in the future.

Don't be afraid to experiment a bit with different libraries, to see which feel the best fit. While the APIs of GUI libraries are very different, they share many underlying concepts in common and things you learn in one library will often apply in another.

You are only limited by your own imagination. So go out there and make something!

Categories: FLOSS Project Planets

ListenData: How to Scrape Google News with Python

Planet Python - Mon, 2024-02-26 00:43

This tutorial explains how to scrape Google News for articles related to the topic of your choice using Python.

We are interested to see the following information for each news article.

  • Title : Article Headline
  • Source : Original News Source or Blogger Name
  • Time : Publication Date/Time
  • Author : Article Author
  • Link : Article Link
To read this article in full, please click hereThis post appeared first on ListenData
Categories: FLOSS Project Planets

Sergio Durigan Junior: Planning to orphan Pagure on Debian

Planet Debian - Sun, 2024-02-25 22:23

I have been thinking more and more about orphaning the Pagure Debian package. I don’t have the time to maintain it properly anymore, and I have also lost interest in doing so.

What’s Pagure

Pagure is a git forge written entirely in Python using pygit2. It was almost entirely developed by one person, Pierre-Yves Chibon. He is (was?) a Red Hat employee and started working on this new git forge almost 10 years ago because the company wanted to develop something in-house for Fedora. The software is amazing and I admire Pierre-Yves quite a lot for what he was able to achieve basically alone. Unfortunately, a few years ago Fedora decided to move to Gitlab and the Pagure development pretty much stalled.

Pagure in Debian

Packaging Pagure for Debian was hard, but it was also very fun. I learned quite a bit about many things (packaging and non-packaging related), interacted with the upstream community, decided to dogfood my own work and run my Pagure instance for a while, and tried to get newcomers to help me with the package (without much success, unfortunately).

I remember that when I had started to package Pagure, Debian was also moving away from Alioth and discussing options. For a brief moment Pagure was a contender, but in the end the community decided to self-host Gitlab, and that’s why we have Salsa now. I feel like I could have tipped the scales in favour of Pagure had I finished packaging it for Debian before the decision was made, but then again, to the best of my knowledge Salsa doesn’t use our Gitlab package anyway…

Are you interested in maintaining it?

If you’re interested in maintaining the package, please get in touch with me. I will happily pass the torch to someone else who is still using the software and wants to keep it healthy in Debian. If there is nobody interested, then I will just orphan it.

Categories: FLOSS Project Planets

PreviousNext: Join us for the DrupalSouth 2024 Code Sprint in Sydney

Planet Drupal - Sun, 2024-02-25 21:31

As regular sponsors, we have tried and tested tips for getting involved and getting the most out of the DrupalSouth Code Sprint. It's a fantastic day of collaboration and contribution you won't want to miss!

by kim.pepper / 26 February 2024

We’re excited to be running and sponsoring the Code Sprint again, this time at DrupalSouth 2024. 

We’re hoping to see you there too - either in-person or virtually!

It’s a chance for as many of us as possible to get together, work, and learn–all while contributing to the Drupal open-source project and community. 

There are many compelling reasons for individuals and businesses to contribute

An event of this nature adds an extra layer of possibility to what can be achieved–and it’s a lot of fun too!

When will the Code Sprint take place?

This year’s Sprint will take place on Friday, 22nd March 2024, from 9 am to 3 pm (AEDT). 

More details are available on the DrupalSouth registration form.

How do I register?

When you book your DrupalSouth ticket, you can also register for the Code Sprint

Attendance is free and open to all levels of experience.

The Sprint is always highly popular and regularly oversubscribed (last year in Brisbane was no exception), so please register early to avoid disappointment! 

Remote participants

Are you unable to attend in person? Join us remotely from wherever you are! 

Let us know if you'll be taking part, via the Slack channel (details below under Communication). Information for connecting via Zoom on the day will also be shared on Slack prior to the event. 

What is a Sprint, and why is it important?

Drupal is open-source, meaning it relies on organisations and individuals contributing to keep it moving forward and improving. A sprint is a focused effort, in this case, a day, where we can progress things and see tangible results.

Drupal contribution demonstrates your individual or organisational expertise, ensuring you gain recognition for your work. Participating in the Sprint is a great way to build your contribution levels for the Certified Partner Program. It’s also an opportunity to be mentored by other developers.

New to Drupal Sprints? Below are recorded sessions from the 2021 sprint that will help you prepare for the day.

Sprints are an excellent opportunity to put a face to a name and discuss common interests. Groups are loosely arranged by topic. e.g. Bug Smash, Media, Drupal 10 porting. Find a group working on an area you’re interested in and introduce yourself! 

Chatting directly with fellow contributors is a great opportunity to have discussions and put forward ideas. Don't feel like you need to come away from the day having completed lines and lines of code.

Communication 

We'll use #drupalsouth-code-sprint in Drupal Slack as the primary communication channel for the Sprint. 

For most of the day, we’ll use Slack threads to keep track of sprint topics and reduce the noise in the main channel.

If you haven’t already done so, now is a great time to sign up and join the Australian / New Zealand Drupal community in Slack. Follow the instructions for how to join

Who can contribute and how?

Sprint day is for everyone, not just developers! Contribution comes in many forms. See the list of contributor tasks if you’re looking for different ways to contribute to this fantastic project. 

Find issues to work on

Looking for an interesting issue to work on? Head to the Drupal.org Issue Queue and look for issues tagged with 'DrupalSouth'. These are issues that others have tagged.

You can also tag an issue to add to the list.

Set up a development environment

There’s more than one way to shear a sheep and many ways to set up a local development environment for working on Drupal!

If you still need to get a local development environment setup, we recommend using Docker Compose for local development. Follow the instructions for installing Docker Compose on OSX, Windows and Linux.

If you don't already have a local development environment for Drupal contribution, a handy starter project can be set up using the following:

composer create-project mstrelan/drupal-contrib

See the README.md for more details. 

If you are more familiar with DDEV then we recommend you having a look at DDEV Drupal Contrib.

If you have any issues, join us on Drupal Slack in the #drupalsouth-code-sprint channel beforehand, and we'll be happy to answer any questions you might have.

Code of conduct

The sprint day will abide by the DrupalSouth Code of Conduct to provide a safe and inclusive environment for everyone. 

Recap

Now you know everything you need for Sprint Day, it’s time to follow these steps:

We can’t wait to see you there!

Tagged DrupalSouth, Code Sprint
Categories: FLOSS Project Planets

Armin Ronacher: Austria: A Fearful Country In Need Of A Vision

Planet Python - Sun, 2024-02-25 19:00

This will be a slightly different post. It has to do with the country I am living in with my family: Austria. More importantly it has to do with some some observations and of mine about how this country functions.

There is a rather famous quote about Vienna: “If the world once ends, I'll move to Vienna, because that's where everything happens fifty years later”. It has been attributed to Gustav Mahler who lived at the tail end of the 19th century. It might also have been said by anyone else or about a different city. Yet as a description of Vienna is highly accurate — even today — and it in many ways describes the culture here. While Austrians might argue that Vienna really does not represent the country, the fundamentals of that mentality are inherent to Austria's culture. Austria is a very conservative country that chooses to disregard progress for as long as it can get away with. It's not always stuck in the past. There are definitely exceptions to the rule but in many ways this conservatism is the backdrop to every day decision making. The way I like to portray what is happening here is that there is a strong desire for “stability” and fear of the unknown. Austrians prefer to miss out on a fad over adopting something too early.

While a country is defined by its borders, the culture is defined by it's population. So we need to define what an “Austrian” is. That turns out to be rather complex and this complexity matters a lot. Austria is a country of 9.1 Million people. Let's take a news article from a few days ago: “4,9 Million Austrians travelled for vacation in 2023” according to Statistics Austria. When you read a statistic like that, you can extrapolate that this refers to residents in Austria. Austria has almost 20% foreigners; in Vienna that number is 35%. Those foreigners are divided into EU citizens, refugees (and those applying and waiting to be processed) and other third country nationals. They have vastly different permissions and rights. It's comparatively easy to get a visa or work permit on paper (called “Aufenthaltstitel”) but it can involves a lot of bureaucracy to actually get one. Even as a dependent of a EU citizen it can take months to get your permit processed, particularly in Vienna despite the fact that EU law requires this to take effect immediately. The MA35 authority in Vienna responsible for permits is well known for lack of service quality.

Citizenship on the other hand is shockingly restrictive even ignoring bureaucracy. You need to earn well above the national mean to be entitled to it, the minimum waiting time is 10 years (can be shortened to 6 years in many cases) and you need to have certificates that demonstrate that you can speak German on B1 level or higher. Simplifications for children are almost non existing. You also cannot be abroad for more than 20% of the time which sometimes is an issue for business travellers. It also requires you to renounce other citizenships when you want to become Austrian. This leads to the other definition of “Austrian”: someone with Austrian citizenship. Austria has some of the lowest naturalization rates in the EU. Except it also has a citizenship through the backdoor. If you are a descendent of a holocaust victim, you are entitled citizenship through a special process which does not require renouncing nor does it require residence. Unsurprisingly this has lead to the number of people applying for citizenship this way being around half of the granted citizenships since this law has been introduced.

Austria is a country that needs permits for everything and in some cases these permits are bizarre. Case in point: to operate a monetized YouTube channel you need to register with KommAustria. To register with KommAustria you need to be an Austrian, EU citizen or registered refugee. As a third country national (Russian, US citizen, Canadian etc.) there is only a way to operate an illegal YouTube channel and just assume nobody will mind (as many do). There are a lot of these weird rules, and many have to do with residence status. Austria accepts a lot of refugees every single year. While they are waiting for their status to be processed, they cannot be employed but are given money by the government. Due to how the law is structured, even if you want to sponsor such an applicant for a visa, you cannot. There is literally no process. Because the refugee system takes years and years at times, it means there are people who go to school, learn the language and have no legal status. Ultimately Austria ends up deporting a lot of asylum seekers who did not get their status granted. Yet many of them companies would be happy to have as employees.

It's not just YouTube channels that need permits. Did I mention that there are permits everywhere? If you want to sell SaaS software, you need to apply for a permit and that's a rather simple one anyone can get. But don't you dare to try to become a tailor or confectioner. For the privilege of operating your own tailor business or pâtisserie you need to be a master in tailoring or confectioneries. I'm not a tailor, so no clue how long that takes, but the regular path to becoming a master is a three year apprenticeship that ends in an exam. So if you are an Ukrainian refugee who can tailor, even if you have the right to work, good luck becoming a tailor. You can already guess where all of this is going: it's the breeding ground of small scale corruption and problematic work situations. It's not too infrequent that you see people being registered as a business manager for the purposes of providing permits that itself is not really working for that business. Once you have a business, the rules in which you can operate it are also limited. Mandatory time keeping for employees, maximum opening times for stores, all kinds of limits for what endeavours are possible with the business license. Even if you are entirely alone in your store, you cannot open it whenever you want. Even if the store is exclusively operated by robots, it would not be allowed to open on a Sunday and not for more than 72 hours a week. Some things are completely unavailable to foreigners unless they are EU citizens or refugees. Can't be a policemen, can't operate a restaurant (you need a middleman), can't have a chimney sweep business (someone please explain this one to me).

What else do you need permits for? Well one of new things that has been thrown in recently has been the packaging directive of the European Union. A sender of a package has to “license” the packaging to send it to an end user. The license fee then goes to local waste management. So far, so good. Unfortunately in the case of Austria you need to go to a notary to register your “Representatives for packaging and single-use plastic products”. You can take an educated guess how many foreign companies want to jump through these hoops. Some sellers refuse to sell to Austria (it's a small country after all), others pay for excessive fees from third parties that can provide such services. Established local sellers are happy and supportive, after all less competition from other countries.

Taxation is very much the same story. High income taxes, income dependent social security contributions, value added tax etc. All these things drive up the cost of doing business and encourages a healthy shadow economy.

Alongside all of this sits a political system in which politicians see themselves as kings that give out gifts to the population. Rather than lowering taxes, they rather give out all kinds of subsidies.

You might be able to see a pattern here. This conservatism is in a way really just protectionism. Which is a valid way of live, but all of this really prevents innovation, and it also as a lot of unintended side effects. Quality of life in Austria might be great, but I am pretty sure that the country as a whole greatly eats into it's existing capital to retain that. While Austria might want to pretend like the world is not changing, the reality is that it has no control of what happens elsewhere. There are lots of countries in need of entrepreneurs, that are more welcoming to people. It's also aging and businesses know that immigration is absolutely vital to the functioning of the country.

All in all it really feels like Austria is a country containing a population that is afraid. Afraid of new things, afraid of the unknown. As the collective organism that it represents it's deeply suspicious. This is not just politics, it's the natural culture. Even foreigners who move to the country over time assimilate to this line of thinking. Those who made it through the layers and layers of bureaucracy will start to defend it. After all, once you invested that time and money it also helps you against competition.

Austria today takes part in a much more connected world. It's embedded in a free trade union, it's depending on international products and immigration. I find it ironic that Austria has a ton of human capital, it's still a very attractive destination for immigrants, yet it throws away so much potential. It got dealt an amazing hand but it's just to afraid of playing it.

Clearly Austria will not become a libertarian wonderland and it should not be. There is no appetite for large scale deregulation and that is absolutely okay. But there is a version of this country that stays true to its actual values and can achieve better outcomes. Maybe one day we will see a political landscape that is just a bit more courageous.

Categories: FLOSS Project Planets

Freexian Collaborators: Long term support for Samba 4.17

Planet Debian - Sun, 2024-02-25 19:00

Freexian is pleased to announce a partnership with Catalyst to extend the security support of Samba 4.17, which is the version packaged in Debian 12 Bookworm. Samba 4.17 will reach upstream’s end-of-support this upcoming March (2024), and the goal of this partnership is to extend it until June 2028 (i.e. the end of Debian 12’s regular security support).

One of the main aspects of this project is that it will also include support for Samba as Active Directory Domain Controller (AD-DC). Unfortunately, support for Samba as AD-DC in Debian 11 Bullseye, Debian 10 Buster and older releases has been discontinued before the end of the life cycle of those Debian releases. So we really expect to improve the situation of Samba in Debian 12 Bookworm, ensuring full support during the 5 years of regular security support.

We would like to mention that this is an experiment, and we will do our best to make it a success, and to try to continue it for Samba versions included in future Debian releases.

Our long term goal is to bring confidence to Samba’s upstream development community that they can mark some releases as being supported for 5 years (or more) and that the corresponding work will be funded by companies that benefit from this work (because we would have already built that community).

If your company relies on Samba and wants to help sustain LTS versions of Samba, please reach out to us. For companies using Debian, the simplest way is to subscribe to our Debian LTS offer at a gold level (or above) and let us know that you want to contribute to Samba LTS when you send your subscription form. For others, please reach out to us at sales@freexian.com and we will figure out a way to contribute.

In the mean time, this project has been possible thanks to the current LTS sponsors and ELTS customers. We hope the whole community of Debian and Samba users will benefit from it.

For any question, don’t hesitate to contact us.

Categories: FLOSS Project Planets

Ben Hutchings: Converted from Pyblosxom to Jekyll

Planet Debian - Sun, 2024-02-25 15:55

I’ve been using Pyblosxom here for nearly 17 years, but have become increasingly dissatisfied with having to write HTML instead of Markdown.

Today I looked at upgrading my web server and discovered that Pyblosxom was removed from Debian after Debian 10, presumably because it wasn’t updated for Python 3.

I keep hearing about Jekyll as a static site generator for blogs, so I finally investigated how to use that and how to convert my existing entries. Fortunately it supports both HTML and Markdown (and probably other) input formats, so this was mostly a matter of converting metadata.

I have my own crappy script for drafting, publishing, and listing blog entries, which also needed a bit of work to update, but that is now done.

If all has gone to plan, you should be seeing just one new entry in the feed but all permalinks to older entries still working.

Categories: FLOSS Project Planets

Test and Code: 215: Staying Technical as a Manager

Planet Python - Sun, 2024-02-25 11:38

Software engineers that move into leadership roles have a struggle between learning leadership skills, maintaining technical skills, and learning new leadership and technical skills. 
Matt Makai went from individual contributor to developer relations to leadership in devrel. 
We discuss how to stay technical, as well as dive into some results of his studies in how companies use developer relationship channels.


Sponsored by PyCharm Pro

The Complete pytest Course

  • For the fastest way to learn pytest, go to courses.pythontest.com
  • Whether your new to testing or pytest, or just want to maximize your efficiency and effectiveness when testing.
<p>Software engineers that move into leadership roles have a struggle between learning leadership skills, maintaining technical skills, and learning new leadership and technical skills. <br>Matt Makai went from individual contributor to developer relations to leadership in devrel. <br>We discuss how to stay technical, as well as dive into some results of his studies in how companies use developer relationship channels.</p> <br><p><strong>Sponsored by PyCharm Pro</strong></p><ul><li>Use code PYTEST for 20% off PyCharm Professional at <a href="https://www.jetbrains.com/pycharm/">jetbrains.com/pycharm</a></li><li>First 10 to sign up this month get a free month of AI Assistant</li><li>See how easy it is to run pytest from PyCharm at <a href="https://pythontest.com/pycharm/">pythontest.com/pycharm</a></li></ul><p><strong>The Complete pytest Course</strong></p><ul><li>For the fastest way to learn pytest, go to <a href="https://courses.pythontest.com/p/complete-pytest-course">courses.pythontest.com</a></li><li>Whether your new to testing or pytest, or just want to maximize your efficiency and effectiveness when testing.</li></ul>
Categories: FLOSS Project Planets

Call for feeds: Make your region available in our open transit router

Planet KDE - Sun, 2024-02-25 10:33

You may have already read about it on Volkers blog: we together with people from other public transport related projects are building a public transport routing service called Transitous. While of course our main motivation is to use it in KDE Itinerary, KDE’s travel planning app, it will be open for use in other apps.

We also have a little web interface running at transitous.org.

We are building this service based on great existing software, in particularly MOTIS.

Now, to make this really useful, we need data on more regions. Luckily, for most regions and countries that is fairly easy. Most transport agencies and countries make GTFS feeds available, that we can just use.

Adding an additional feed doesn’t take long and doesn’t need programming experience. It’s pretty much just creating a small text file that explains how and where to download the data from.

Those links don’t necessarily stay the same forever, so we would be happy if lots of people take care of their region, and update the link every few years. It is really little work if split up, but can’t all be handled by a small team.

To make it even easier, we can already use the Transitland Atlas feed collection, for which you just need to choose the feed to use. The url will then automatically be looked up.

You can find out how to add a feed here. Please let us know if the documentation is unclear anywhere.

If you are interested in using this service in your own application, it is probably a bit too early for production, but it makes sense to already implement support for the MOTIS API that we use. You can find an early version of our API documentation here.

If there is anything else you are interested in helping with, for example improving our ansible playbook, creating a website, improving MOTIS or working on integrating OpenStreetMap routing, you can find our open tasks here. We appreciate any help on those issues, and it of course speeds up the development of the project.

Categories: FLOSS Project Planets

Plasma Pass 1.2.2

Planet KDE - Sun, 2024-02-25 06:57

Plasma Pass is a Plasma applet for the Pass password manager

This release includes build fixes for Plasma 6, due to be released later this week.

URL: https://download.kde.org/stable/plasma-pass/
Sha256: 2a726455084d7806fe78bc8aa6222a44f328b6063479f8b7afc3692e18c397ce
Signed by E0A3EB202F8E57528E13E72FD7574483BB57B18D Jonathan Esk-Riddell <jr@jriddell.org>
https://jriddell.org/esk-riddell.gpg

Categories: FLOSS Project Planets

Kushal Das: django-ca, HSM and PoC

Planet Python - Sun, 2024-02-25 04:25

django-ca is a feature rich certificate authority written in Python, using the django framework. The project exists for long, have great documentation and code comments all around. As I was looking around for possible CAs which can be used in multiple projects at work, django-ca seems to be a good base fit. Though it has still a few missing parts (which are important for us), for example HSM support and Certificate Management over CMS.

I started looking into the codebase of django-ca more and meanwhile also started cleaning up (along with Magnus Svensson) another library written at work for HSM support. I also started having conversion with Mathias (who is the author of django-ca) about this feature.

Thanks to the amazing design of the Python Cryptography team, I could just add several Private key implementations in our library, which in turn can be used as a normal private key.

I worked on a proof of concept branch (PoC), while getting a lot of tests also working.

===== 107 failed, 1654 passed, 32 skipped, 274 errors in 286.03s (0:04:46) =====

Meanwhile Mathias also started writing a separate feature branch where he is moving the key operations encapsulated inside of backends, and different backends can be implemented to deal with HSM or normal file based storage. He then chatted with me on Signal over 2 hours explaining the code and design of the branch he is working on. He also taught me many other django/typing things which I never knew before in the same call. His backend based approach makes my original intention of adding HSM support very easy. But, it also means at first he has to modify the codebase (and the thousands of test cases) first.

I am writing this blog post also to remind folks that not every piece of code needs to go to production (or even merged). I worked on a PoC, that validates the idea. And then we have a better and completely different design. It is perfectly okay to work hard for a PoC and later use a different approach.

As some friends asked on Mastodon, I will do a separate post about the cleanup of the other library.

Categories: FLOSS Project Planets

Russ Allbery: Review: The Fund

Planet Debian - Sat, 2024-02-24 22:46

Review: The Fund, by Rob Copeland

Publisher: St. Martin's Press Copyright: 2023 ISBN: 1-250-27694-2 Format: Kindle Pages: 310

I first became aware of Ray Dalio when either he or his publisher plastered advertisements for The Principles all over the San Francisco 4th and King Caltrain station. If I recall correctly, there were also constant radio commercials; it was a whole thing in 2017. My brain is very good at tuning out advertisements, so my only thought at the time was "some business guy wrote a self-help book." I think I vaguely assumed he was a CEO of some traditional business, since that's usually who writes heavily marketed books like this. I did not connect him with hedge funds or Bridgewater, which I have a bad habit of confusing with Blackwater.

The Principles turns out to be more of a laundered cult manual than a self-help book. And therein lies a story.

Rob Copeland is currently with The New York Times, but for many years he was the hedge fund reporter for The Wall Street Journal. He covered, among other things, Bridgewater Associates, the enormous hedge fund founded by Ray Dalio. The Fund is a biography of Ray Dalio and a history of Bridgewater from its founding as a vehicle for Dalio's advising business until 2022 when Dalio, after multiple false starts and title shuffles, finally retired from running the company. (Maybe. Based on the history recounted here, it wouldn't surprise me if he was back at the helm by the time you read this.)

It is one of the wildest, creepiest, and most abusive business histories that I have ever read.

It's probably worth mentioning, as Copeland does explicitly, that Ray Dalio and Bridgewater hate this book and claim it's a pack of lies. Copeland includes some of their denials (and many non-denials that sound as good as confirmations to me) in footnotes that I found increasingly amusing.

A lawyer for Dalio said he "treated all employees equally, giving people at all levels the same respect and extending them the same perks."

Uh-huh.

Anyway, I personally know nothing about Bridgewater other than what I learned here and the occasional mention in Matt Levine's newsletter (which is where I got the recommendation for this book). I have no independent information whether anything Copeland describes here is true, but Copeland provides the typical extensive list of notes and sourcing one expects in a book like this, and Levine's comments indicated it's generally consistent with Bridgewater's industry reputation. I think this book is true, but since the clear implication is that the world's largest hedge fund was primarily a deranged cult whose employees mostly spied on and rated each other rather than doing any real investment work, I also have questions, not all of which Copeland answers to my satisfaction. But more on that later.

The center of this book are the Principles. These were an ever-changing list of rules and maxims for how people should conduct themselves within Bridgewater. Per Copeland, although Dalio later published a book by that name, the version of the Principles that made it into the book was sanitized and significantly edited down from the version used inside the company. Dalio was constantly adding new ones and sometimes changing them, but the common theme was radical, confrontational "honesty": never being silent about problems, confronting people directly about anything that they did wrong, and telling people all of their faults so that they could "know themselves better."

If this sounds like textbook abusive behavior, you have the right idea. This part Dalio admits to openly, describing Bridgewater as a firm that isn't for everyone but that achieves great results because of this culture. But the uncomfortably confrontational vibes are only the tip of the iceberg of dysfunction. Here are just a few of the ways this played out according to Copeland:

  • Dalio decided that everyone's opinions should be weighted by the accuracy of their previous decisions, to create a "meritocracy," and therefore hired people to build a social credit system in which people could use an app to constantly rate all of their co-workers. This almost immediately devolved into out-group bullying worthy of a high school, with employees hurriedly down-rating and ostracizing any co-worker that Dalio down-rated.

  • When an early version of the system uncovered two employees at Bridgewater with more credibility than Dalio, Dalio had the system rigged to ensure that he always had the highest ratings and was not affected by other people's ratings.

  • Dalio became so obsessed with the principle of confronting problems that he created a centralized log of problems at Bridgewater and required employees find and report a quota of ten or twenty new issues every week or have their bonus docked. He would then regularly pick some issue out of the issue log, no matter how petty, and treat it like a referendum on the worth of the person responsible for the issue.

  • Dalio's favorite way of dealing with a problem was to put someone on trial. This involved extensive investigations followed by a meeting where Dalio would berate the person and harshly catalog their flaws, often reducing them to tears or panic attacks, while smugly insisting that having an emotional reaction to criticism was a personality flaw. These meetings were then filmed and added to a library available to all Bridgewater employees, often edited to remove Dalio's personal abuse and to make the emotional reaction of the target look disproportionate. The ones Dalio liked the best were shown to all new employees as part of their training in the Principles.

  • One of the best ways to gain institutional power in Bridgewater was to become sycophantically obsessed with the Principles and to be an eager participant in Dalio's trials. The highest levels of Bridgewater featured constant jockeying for power, often by trying to catch rivals in violations of the Principles so that they would be put on trial.

In one of the common and all-too-disturbing connections between Wall Street finance and the United States' dysfunctional government, James Comey (yes, that James Comey) ran internal security for Bridgewater for three years, meaning that he was the one who pulled evidence from surveillance cameras for Dalio to use to confront employees during his trials.

In case the cult vibes weren't strong enough already, Bridgewater developed its own idiosyncratic language worthy of Scientology. The trials were called "probings," firing someone was called "sorting" them, and rating them was called "dotting," among many other Bridgewater-specific terms. Needless to say, no one ever probed Dalio himself. You will also be completely unsurprised to learn that Copeland documents instances of sexual harassment and discrimination at Bridgewater, including some by Dalio himself, although that seems to be a relatively small part of the overall dysfunction. Dalio was happy to publicly humiliate anyone regardless of gender.

If you're like me, at this point you're probably wondering how Bridgewater continued operating for so long in this environment. (Per Copeland, since Dalio's retirement in 2022, Bridgewater has drastically reduced the cult-like behaviors, deleted its archive of probings, and de-emphasized the Principles.) It was not actually a religious cult; it was a hedge fund that has to provide investment services to huge, sophisticated clients, and by all accounts it's a very successful one. Why did this bizarre nightmare of a workplace not interfere with Bridgewater's business?

This, I think, is the weakest part of this book. Copeland makes a few gestures at answering this question, but none of them are very satisfying.

First, it's clear from Copeland's account that almost none of the employees of Bridgewater had any control over Bridgewater's investments. Nearly everyone was working on other parts of the business (sales, investor relations) or on cult-related obsessions. Investment decisions (largely incorporated into algorithms) were made by a tiny core of people and often by Dalio himself. Bridgewater also appears to not trade frequently, unlike some other hedge funds, meaning that they probably stay clear of the more labor-intensive high-frequency parts of the business.

Second, Bridgewater took off as a hedge fund just before the hedge fund boom in the 1990s. It transformed from Dalio's personal consulting business and investment newsletter to a hedge fund in 1990 (with an earlier investment from the World Bank in 1987), and the 1990s were a very good decade for hedge funds. Bridgewater, in part due to Dalio's connections and effective marketing via his newsletter, became one of the largest hedge funds in the world, which gave it a sort of institutional momentum. No one was questioned for putting money into Bridgewater even in years when it did poorly compared to its rivals.

Third, Dalio used the tried and true method of getting free publicity from the financial press: constantly predict an upcoming downturn, and aggressively take credit whenever you were right. From nearly the start of his career, Dalio predicted economic downturns year after year. Bridgewater did very well in the 2000 to 2003 downturn, and again during the 2008 financial crisis. Dalio aggressively takes credit for predicting both of those downturns and positioning Bridgewater correctly going into them. This is correct; what he avoids mentioning is that he also predicted downturns in every other year, the majority of which never happened.

These points together create a bit of an answer, but they don't feel like the whole picture and Copeland doesn't connect the pieces. It seems possible that Dalio may simply be good at investing; he reads obsessively and clearly enjoys thinking about markets, and being an abusive cult leader doesn't take up all of his time. It's also true that to some extent hedge funds are semi-free money machines, in that once you have a sufficient quantity of money and political connections you gain access to investment opportunities and mechanisms that are very likely to make money and that the typical investor simply cannot access. Dalio is clearly good at making personal connections, and invested a lot of effort into forming close ties with tricky clients such as pools of Chinese money.

Perhaps the most compelling explanation isn't mentioned directly in this book but instead comes from Matt Levine. Bridgewater touts its algorithmic trading over humans making individual trades, and there is some reason to believe that consistently applying an algorithm without regard to human emotion is a solid trading strategy in at least some investment areas. Levine has asked in his newsletter, tongue firmly in cheek, whether the bizarre cult-like behavior and constant infighting is a strategy to distract all the humans and keep them from messing with the algorithm and thus making bad decisions.

Copeland leaves this question unsettled. Instead, one comes away from this book with a clear vision of the most dysfunctional workplace I have ever heard of, and an endless litany of bizarre events each more astonishing than the last. If you like watching train wrecks, this is the book for you. The only drawback is that, unlike other entries in this genre such as Bad Blood or Billion Dollar Loser, Bridgewater is a wildly successful company, so you don't get the schadenfreude of seeing a house of cards collapse. You do, however, get a helpful mental model to apply to the next person who tries to talk to you about "radical honesty" and "idea meritocracy."

The flaw in this book is that the existence of an organization like Bridgewater is pointing to systematic flaws in how our society works, which Copeland is largely uninterested in interrogating. "How could this have happened?" is a rather large question to leave unanswered. The sheer outrageousness of Dalio's behavior also gets a bit tiring by the end of the book, when you've seen the patterns and are hearing about the fourth variation. But this is still an astonishing book, and a worthy entry in the genre of capitalism disasters.

Rating: 7 out of 10

Categories: FLOSS Project Planets

unifont @ Savannah: Unifont 15.1.05 Released

GNU Planet! - Sat, 2024-02-24 20:56

24 February 2024 Unifont 15.1.05 is now available.  This release adds the 222 CJK Unified Ideographs Extension D glyphs (U+2B740..U+2B81D) and 335 Plane 2 and Plane 3 common Cantonese ideographs, as well as other additions amounting to almost 600 ideograph additions, from Boris Zhang, Yzy32767, and others.

This release also replaces the Hangul blocks outside the Hangul Syllables range with new glyphs from Ho-seok Ee that are now consistent with the style of the Hangul Syllables glyphs.

Other minor changes are also included.  Details are in the ChangeLog file.

This release no longer builds TrueType fonts by default, as announced over the past year.  They have been replaced with their OpenType equivalents.  TrueType fonts can still be built manually by typing "make truetype" in the font directory.

Download this release from GNU server mirrors at:

     https://ftpmirror.gnu.org/unifont/unifont-15.1.05/

or if that fails,

     https://ftp.gnu.org/gnu/unifont/unifont-15.1.05/

or, as a last resort,

     ftp://ftp.gnu.org/gnu/unifont/unifont-15.1.05/

These files are also available on the unifoundry.com website:

     https://unifoundry.com/pub/unifont/unifont-15.1.05/

Font files are in the subdirectory

     https://unifoundry.com/pub/unifont/unifont-15.1.05/font-builds/

A more detailed description of font changes is available at

      https://unifoundry.com/unifont/index.html

and of utility program changes at

      https://unifoundry.com/unifont/unifont-utilities.html

Information about Hangul modifications is at

      https://unifoundry.com/hangul/index.html

and

      http://unifoundry.com/hangul/hangul-generation.html

Categories: FLOSS Project Planets

Jacob Adams: AAC and Debian

Planet Debian - Sat, 2024-02-24 19:00

Currently, in a default installation of Debian with the GNOME desktop, Bluetooth headphones that require the AAC codec1 cannot be used. As the Debian wiki outlines, using the AAC codec over Bluetooth, while technically supported by PipeWire, is explicitly disabled in Debian at this time. This is because the fdk-aac library needed to enable this support is currently in the non-free component of the repository, meaning that PipeWire, which is in the main component, cannot depend on it.

How to Fix it Yourself

If what you, like me, need is simply for Bluetooth Audio to work with AAC in Debian’s default desktop environment2, then you’ll need to rebuild the pipewire package to include the AAC codec. While the current version in Debian main has been built with AAC deliberately disabled, it is trivial to enable if you can install a version of the fdk-aac library.

I preface this with the usual caveats when it comes to patent and licensing controversies. I am not a lawyer, building this package and/or using it could get you into legal trouble.

These instructions have only been tested on an up-to-date copy of Debian 12.

  1. Install pipewire’s build dependencies sudo apt install build-essential devscripts sudo apt build-dep pipewire
  2. Install libfdk-aac-dev sudo apt install libfdk-aac-dev

    If the above doesn’t work you’ll likely need to enable non-free and try again

    sudo sed -i 's/main/main non-free/g' /etc/apt/sources.list sudo apt update

    Alternatively, if you wish to ensure you are maximally license-compliant and patent un-infringing3, you can instead build fdk-aac-free which includes only those components of AAC that are known to be patent-free3. This is what should eventually end up in Debian to resolve this problem (see below).

    sudo apt install git-buildpackage mkdir fdk-aac-source cd fdk-aac-source git clone https://salsa.debian.org/multimedia-team/fdk-aac cd fdk-aac gbp buildpackage sudo dpkg -i ../libfdk-aac2_*deb ../libfdk-aac-dev_*deb
  3. Get the pipewire source code mkdir pipewire-source cd pipewire-source apt source pipewire

    This will create a bunch of files within the pipewire-source directory, but you’ll only need the pipewire-<version> folder, this contains all the files you’ll need to build the package, with all the debian-specific patches already applied. Note that you don’t want to run the apt source command as root, as it will then create files that your regular user cannot edit.

  4. Fix the dependencies and build options To fix up the build scripts to use the fdk-aac library, you need to save the following as pipewire-source/aac.patch --- debian/control.orig +++ debian/control @@ -40,8 +40,8 @@ modemmanager-dev, pkg-config, python3-docutils, - systemd [linux-any] -Build-Conflicts: libfdk-aac-dev + systemd [linux-any], + libfdk-aac-dev Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/utopia-team/pipewire Vcs-Git: https://salsa.debian.org/utopia-team/pipewire.git --- debian/rules.orig +++ debian/rules @@ -37,7 +37,7 @@ -Dauto_features=enabled \ -Davahi=enabled \ -Dbluez5-backend-native-mm=enabled \ - -Dbluez5-codec-aac=disabled \ + -Dbluez5-codec-aac=enabled \ -Dbluez5-codec-aptx=enabled \ -Dbluez5-codec-lc3=enabled \ -Dbluez5-codec-lc3plus=disabled \

    Then you’ll need to run patch from within the pipewire-<version> folder created by apt source:

    patch -p0 < ../aac.patch
  5. Build pipewire cd pipewire-* debuild

    Note that you will likely see an error from debsign at the end of this process, this is harmless, you simply don’t have a GPG key set up to sign your newly-built package4. Packages don’t need to be signed to be installed, and debsign uses a somewhat non-standard signing process that dpkg does not check anyway.

  1. Install libspa-0.2-bluetooth sudo dpkg -i libspa-0.2-bluetooth_*.deb
  2. Restart PipeWire and/or Reboot sudo reboot

    Theoretically there’s a set of services to restart here that would get pipewire to pick up the new library, probably just pipewire itself. But it’s just as easy to restart and ensure everything is using the correct library.

Why

This is a slightly unusual situation, as the fdk-aac library is licensed under what even the GNU project acknowledges is a free software license. However, this license explicitly does not grant any patent rights, and, to quote the GNU project:

Because of this, and because the license author is a known patent aggressor, we encourage you to be careful about using or redistributing software under this license: you should first consider whether the licensor might aim to lure you into patent infringement.

AAC is covered by a number of patents, which expire at some point in the 2030s5. As such the current version of the library is potentially legally dubious to ship with any other software, as it could be considered patent-infringing3.

Fedora’s solution

Since 2017, Fedora has included a modified version of the library as fdk-aac-free, see the announcement and the bugzilla bug requesting review.

This version of the library includes only the AAC LC profile, which is believed to be entirely patent-free3.

Based on this, there is an open bug report in Debian requesting that the fdk-aac package be moved to the main component and that the pipwire package be updated to build against it.

The Debian NEW queue

To resolve these bugs, a version of fdk-aac-free has been uploaded to Debian by Jeremy Bicha. However, to make it into Debian proper, it must first pass through the ftpmaster’s NEW queue. The current version of fdk-aac-free has been in the NEW queue since July 2023.

Based on conversations in some of the bugs above, it’s been there since at least 20226.

I hope this helps anyone stuck with AAC to get their hardware working for them while we wait for the package to eventually make it through the NEW queue.

  1. Such as, for example, any Apple AirPods, which only support AAC AFAICT. 

  2. Which, as of Debian 12 is GNOME 3 under Wayland with PipeWire. 

  3. I’m not a lawyer, I don’t know what kinds of infringement might or might not be possible here, do your own research, etc.  ↩2 ↩3 ↩4

  4. And if you DO have a key setup with debsign you almost certainly don’t need these instructions. 

  5. Wikipedia claims the “base” patents expire in 2031, with the extensions expiring in 2038, but its source for these claims is some guy’s spreadsheet in a forum. The same discussion also brings up Wikipedia’s claim and casts some doubt on it, so I’m not entirely sure what’s correct here, but I didn’t feel like doing a patent deep-dive today. If someone can provide a clear answer that would be much appreciated. 

  6. According to Jeremy Bícha: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021370#17 

Categories: FLOSS Project Planets

Pages