Any color you like, as long as it’s Black

Proper code formatting is one of the essential things that help to keep an open-source project universally maintainable and understandable. We had Google’s YAPF in Saleor, but the formatting was only applied to some of the newer code, while a lot of the original core was using inconsistent styles. To address this issue, we decided to pick a modern tool that a number of open-source projects have recently adopted. Black is an opinionated code formatting tool for Python that comes with a fixed set of rules which are subject to only limited adjusts. And that’s one of the greatest powers of Black. We’ve also added support for Pre-commit which makes sure that every commit you create contains appropriately formatted code.

Any color you like

Data classes as a universal payment interface

One of our goals for the future is to extract payment gateways to separate repositories and provide a standard interface that’ll make implementing new ones easier for the community. We’re also investigating ways to have a plugin architecture where integrations can be optionally turned on and off. For that, we want to benefit from Python 3.7’s data classes which can be used as standardized objects to pass data between various parts of the system. As data classes are not supported in Python versions before 3.6 (in 3.6 they’re available through a third-party library), we decided to drop support for Python 3.5.

Data class to represent data returned by payment gateways

Bulk actions in Dashboard 2.0

A useful management Dashboard is one that allows users to perform everyday actions quickly. From now on, users can perform selected actions for multiple objects rather than repeating actions. It currently supports the most common operations, such as deleting items or publishing/unpublishing products and pages, but more will be added in the future.