FLOSS Project Planets
Test and Code: 210: TDD - Refactor while green
Test Driven Development. Red, Green, Refactor.
- Do we have to do the refactor part?
- Does the refactor at the end include tests?
- Or can I refactor the tests at any time?
- Why is refactor at the end?
This episode is to talk about this with a an example.
Sponsored by PyCharm Pro
- Use code PYTEST for 20% off PyCharm Professional at jetbrains.com/pycharm
- First 10 to sign up this month get a free month of AI Assistant
- See how easy it is to run pytest from PyCharm at pythontest.com/pycharm
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.
Dirk Eddelbuettel: RcppQuantuccia 0.1.1 on CRAN: Maintenance
A minor release of RcppQuantuccia arrived on CRAN today. RcppQuantuccia started from the Quantuccia header-only subset / variant of QuantLib which it brings it to R. This project validated the idea of making the calendaring functionality of QuantLib available in a more compact and standalone project – which we now do with qlcal which can be seen as a successor to this.
This releases updates the code to address warning now shown under R-devel when -Wformat -Wformat-security are enabled. This amounted to re-generating RcppExports.cpp under an updated Rcpp version. We also no longer set C++14 explicitly as a compilation standard.
The complete list changes for this release follows.
Changes in version 0.1.2 (2023-11-29)RcppExports.cpp has been regenerated under an updated Rcpp to address a format string warning under R-devel
The compilation standard is no longer set to C++14
Courtesy of CRANberries, there is also a diffstat report relative to the previous release. More information is on the RcppQuantuccia page. Issues and bugreports should go to the GitHub issue tracker.
If you like this or other open-source work I do, you can now sponsor me at GitHub.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Matt Layman: Message Parsing and Ruff - Building SaaS with Python and Django #176
Armin Ronacher: Bundleless: Not Doing Things Makes You Fast
I recently came across a tweet and one statement in it really triggered me: the claim that a bundleless dev server does not work. The idea here being that you cannot avoid bundling during development for performance reasons. This challenges the code concept and premise of vite's design. Its dev server primarily operates by serving individual files post-initial transpiling.
There's some belief that bundleless development isn't feasible, especially for projects with thousands of modules, due to potential performance issues. However, I contend that this thinking overlooks the benefits of a bundleless approach.
There is obviously some truth to it having issues. If you have thousands of modules, that can take a while to load and on contrast if most of those are bundled up into a single file, that will take less time to load.
I believe this to be the wrong way to think of this issue. Consider Python as an illustrative example: Python loads each module as needed from the file system, without bundling numerous modules into larger files. This approach has a downside: in large applications, the startup time can become impractically long due to excessive code execution during import.
The solution isn't to increase bundling but to reduce overall code execution, particularly at startup. By optimizing module structure, minimizing cross-dependencies, and adopting lazy loading, you can significantly decrease load times and enable hot reloading of components. Don't forget that in addition to all the bytes you're not loading, you're also not parsing or executing code. You become faster by not doing all of this.
The objective for developers, both end-users and framework creators, should be to make bundleless development viable and at least in principle preferred. This means structuring applications to minimize initial load requirements, thereby enhancing iteration speeds. With a focus on doing less, the elimination of the bundling step becomes an attainable and beneficial goal. This is also one of the larger lessons I took from creating Flask: the many side effects of decorators and imports are a major frustration for large scale apps.
Then once that has been accomplished, bundleless does away with the last bit of now not important part: the bundling step which has a lot of other benefits on its own.
Of course, there are nuances. For instance, rarely changing third-party libraries with hundreds of internal modules will still benefit from bundling. Tools like Vite do address this need by optimizing this case.
Therefore, when embarking on a new project or framework, prioritize lazy loading and effective import management from the outset. Avoid circular dependencies and carefully manage code isolation. This initial effort in organizing your code will pay dividends as your project expands, making future development faster and more efficient.
Future you will be happy — and bundleless as evidenced by vite, with the right project setup works.
Ned Batchelder: Say it again: values not expressions
Sometimes you can explain a simple thing for the thousandth time, and come away with a deeper understanding yourself. It happened to me the other day with Python mutable argument default values.
This is a classic Python “gotcha”: you can provide a default value for a function argument, but it will only be evaluated once:
>>> def doubled(item, the_list=[]):... the_list.append(item)
... the_list.append(item)
... return the_list
...
>>> print(doubled(10))
[10, 10]
>>> print(doubled(99))
[10, 10, 99, 99] # WHAT!?
I’ve seen people be surprised by this and ask about it countless times. And countless times I’ve said, “Yup, the value is only calculated once, and stored on the function.”
But recently I heard someone answer with, “it’s a value, not an expression,” which is a good succinct way to say it. And when a co-worker brought it up again the other day, I realized, it’s right in the name: people ask about “default values” not “default expressions.” Of course it’s calculated only once, it’s a default value, not a default expression. Somehow answering the question for the thousandth time made those words click into place and make a connection I hadn’t realized before.
Maybe this seems obvious to others who have been fielding this question, but to me it was a satisfying alignment of the terminology and the semantics. I’d been using the words for years, but hadn’t seen them as so right before.
This is one of the reasons I’m always interested to help new learners: even well-trodden paths can reveal new insights.
Drupal Core News: Coding standards proposals for final discussion on 20 December
The Technical Working Group (TWG) is announcing two coding standards changes for final discussion. Feedback will be reviewed at the meeting scheduled for Wednesday 20 December 2200 UTC.
Issues for discussion- New coding standard: Code style for declare(strict_types=1);
- Argument lists for function declarations may be split across multiple lines
The Coding Standards project page outlines the process for changing Drupal coding standards.
Join the team working on Coding StandardsJoin #coding-standards in Drupal Slack to meet and work with others on improving the Drupal coding standards. We work on improving our standards as well as implementing them in the core software.
Paolo Melchiorre: Pelican 4.9: classless Simple theme with semantic HTML
Introducing the updated version of the “Simple” theme in the new Pelican 4.9 version, with semantic and classless HTML and customizable out-of-the-box.
GNU Taler news: GNU Taler v0.9.3 released
Django Weblog: 2024 DSF Board Election Results
The 2024 DSF Board Election has closed, and the following candidates have been elected:
- Jacob Kaplan-Moss
- Sarah Abderemane
- Thibaud Colas
They will all serve two years for their term.
From the 2023 DSF board announcement, Chaim, Katie, Kátia, and Çağıl are continuing directors. They will have one year left to serve on their time.
Therefore, the combined 2024 DSF Board of Directors are:
- Chaim Kirby
- Katie McLaughlin
- Kátia Yoshime Nakamura
- Çağıl Uluşahin Sonmez
- Jacob Kaplan-Moss*
- Sarah Abderemane*
- Thibaud Colas*
* Elected to a two (2) year term
Congratulations to our winners and a huge thank you to our departing board members Aaron Bassett and Pete Baumgartner.
Thank you again to everyone who nominated themselves. Even if you were not successful, you gave the community the chance to make their voices heard in who they wanted to represent them.
kevinquillen.com: Access Apache Solr admin over HTTPS in DDEV
KDiagram 3.0.0
KDiagram is two powerful libraries (KChart, KGantt) for creating business diagrams.
Version 3.0.0 is now available for packaging.
It moves KDiagram to use Qt 6. It is co-installable with previous Qt 5 versions and distros may want to package both alongside each other for app compatibility.
URL: https://download.kde.org/stable/kdiagram/3.0.0/
SHA256: 6d5f53dfdd019018151c0193a01eed36df10111a92c7c06ed7d631535e943c21
Signed by E0A3EB202F8E57528E13E72FD7574483BB57B18D Jonathan Esk-Riddell jr@jriddell.org
https://jriddell.org/esk-riddell.gpg
KWeatherCore 0.8.0
KWeatherCore is a library to facilitate retrieval of weather information including forecasts and alerts.
0.8.0 is available for packaging now
URL: https://download.kde.org/stable/kweathercore/0.8.0/
SHA256: 9bcac13daf98705e2f0d5b06b21a1a8694962078fce1bf620dbbc364873a0efeS
Signed by E0A3EB202F8E57528E13E72FD7574483BB57B18D Jonathan Esk-Riddell <jr@jriddell.org>
https://jriddell.org/esk-riddell.gpg
This release moves the library to use Qt 6. It is not compatible with older Qt 5 versions of the library so should only be packaged when KWeather is released or in testing archives.
Real Python: Single and Double Underscores in Python Names
Python has a few important naming conventions that are based on using either a single or double underscore character (_). These conventions allow you to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more.
Following and respecting these conventions allows you to write code that looks Pythonic and consistent in the eyes of other Python developers. This skill is especially useful when you’re writing code that’s intended for other developers to work with.
In this tutorial, you’ll:
- Learn about Python naming conventions that rely on using underscores (_)
- Differentiate public and non-public names by using a single leading underscore
- Use double leading underscores to leverage name mangling in Python classes
- Explore other common uses of underscores in Python names
To get the most out of this tutorial, you should be familiar with Python variables, constants, functions, modules, and especially classes and object-oriented programming.
Get Your Code: Click here to download the free sample code that shows you how to use single and double underscores in Python names.
Public Interfaces and Naming Conventions in PythonAs a Python programmer, you’ll frequently work with public interfaces, or application programming interfaces (API). An API is a type of programming interface that offers a service to other parts of a program or other programs.
For example, the Python standard library has many modules and packages that provide certain services. To use these modules and packages, you need to access their public components, such as classes, functions, variables, constants, and modules. All these objects are part of the module or package’s public interface. They’re available for you to use directly in your code.
However, many of these packages and modules define objects that aren’t intended for direct access. These objects are for the internal use of the specific package or module only. They’re not part of its public interface.
In the context of object-oriented programming, languages like C++ and Java have the notion of public and private methods and attributes. In these languages, you can use these types of class members as follows:
- Public: You can use them in your own code or client code.
- Private: You can use them only from inside the defining class and its subclasses.
These languages have specific keywords and syntax to define public and private members in their classes. Once you declare a member as private, you can’t use it outside the class because the language restricts access. So, private members aren’t part of the class’s public interface, and there’s no way to access them.
In contrast, Python doesn’t have the notion of public and private members. It has neither dedicated keywords nor syntax for defining them. So, you can always access the members of a Python class.
If Python doesn’t have a specific syntax to define when an object is part of a public interface, then how do you tell your users that they can or can’t use a given class, method, function, variable, constant, or even module in their code?
To approach this question, the Python community has well-established naming conventions. You should observe these naming conventions to explicitly indicate whether other developers should directly use your variables, constants, functions, methods, and modules in external code.
Note that the naming conventions don’t restrict access to objects. They’re just a warning to other developers using your code. Because of this, Python doesn’t use the terms public and private. Instead, it uses the terms public and non-public.
In Python, if a name starts with a letter in uppercase or lowercase, then you should consider that name public and, therefore, part of the code’s API. In contrast, if a name starts with an underscore character (_), then you should consider that name non-public, meaning it’s not a part of the code’s API.
The Python community uses the underscore character (_) as part of other naming conventions. Here’s a summary of what PEP 8 says about using this character in names:
Convention Example Meaning Single leading underscore _variable Indicates that the name is meant for internal use only Single trailing underscore class_ Avoids naming conflicts with Python keywords and built-in names Double leading underscore __attribute Triggers name mangling in the context of Python classes Double leading and trailing underscore __name__ Indicates special attributes and methods that Python provides Single underscore _ Indicates a temporary or throwaway variableNote that only two of these conventions enforce specific Python behaviors. Using double leading underscores triggers name mangling in Python classes. You’ll learn more about this behavior in the section on name mangling.
Additionally, those names with double leading and trailing underscores that are listed in the Python data model trigger internal behaviors in specific contexts. You’ll also learn more about this topic in the section on dunder names in Python.
Note: Python gives special treatment to the single underscore (_), but only within match … case statements. You’ll learn more about this later.
In the following section, you’ll learn more about using a single leading underscore when naming your Python objects.
Single Leading Underscore in Python Names Read the full article at https://realpython.com/python-double-underscore/ »[ 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 ]
Jonathan Dowland: Useful vim plugins: AnsiEsc
Sometimes I have to pore over long debugging logs which have originally been written out to a terminal and marked up with colour or formatting via ANSI escape codes. The formatting definitely makes reading them easier, but I want to read them in Vim, rather than a terminal, and (out of the box) Vim doesn't render the formatting.
Cue AnsiEsc.vim: an OG Vim script1 that translates some ANSI escape codes — in particular some colour specifying ones — into Vim syntax highlighting.
This makes viewing and navigating around multi-MiB console log files much nicer.
- AnsiEsc is old enough to have been distributed as a script, and then as a "vimball", an invention of the same author to make installing Vim scripts easier. It pre-dates the current fashion for plugins, but someone else has updated it and repackaged it as a plugin. I haven't tried that out.↩
Gocept Weblog: The final teardown
After writing so many teardowns in tests for software projects for customers, open source projects and in house software, it is now time for the gocept folks to finally work on a last teardown of the company itself. After 23 years of existence gocept will close the doors and stop operating business at 2023-11-30. The developers found a new home at the wonderful company Minddistrict. There we will work in a product team and build software to empower people to take care of their mental well-being.
CustomersWe want to thank all our customers for their trust in us over the years and for the often multi year long collaboration. Sometimes gocept was a bit on the bleeding edge of technology and often that was shining through in the development work. But we did our best to provide the individual software applications to the needs of our customers.
Open Source SoftwareIt was in the very essence of gocept to work with open source software. The company grew with Zope and contributed to the Zope ecosystem. Out of this relationship many events were supported like DZUG-Tagung, a EuroPython Conference and in particular in the last years a round of Zope sprint to ensure compatibility and stability in the Python 3 wonderland. We are very happy, that Minddistrict also builds its core product on zope.* packages and that we can further contribute to the open source world.
Most of the gocept.* packages on https://github.com/gocept have been archived or given to the people and companies, that still use them. In case you need to work with them, please contact mail@gocept.com or the respective maintainers on PyPI. We will be able to unarchive the package and if necessary transfer the release rights.
gocept folksSome parts of gocept already left the company in 2014 and formed https://flyingcircus.io/. They are more successful than ever providing a very good and individual hosting and, more important, operation solutions for bigger applications and complex setups. They took over the dedication to software and to new technology, and they are good colleagues to work with.
The remaining 4 developers at gocept join the Minddistrict company and will work there in a bigger team to empower people to take care of their mental well-being in the Netherlands, in Germany and the DACH-region. We will still keep an office in Halle, so there might be a chance to stop by.
The last Christian of gocept (in a row of many) will continue his management work within the Saltlabs and the Koffij – with the mission to develop modern, contemporary and flexible workplaces in Halle and build communities that motivate and offer pleasant working environments.
gocept.cleanup()In case you need anything or want to reach us, please find us on GitHub (or the place to be in the future) or write an email to mail@gocept.com.
LN Webworks: Google Tag Manager With Drupal : All You Need to Know
Maximizing website engagement and interactivity is a major goal of all marketers. However, the management of multitudinous third-party integrations and tracking tools is a laborious task. Gladly, Google created Google Tag Manager to simplify the complicated lives of marketing teams worldwide. It makes managing, upgradation, and tracking of tags, snippets, and third-party integrations a piece of cake for them.
The best part is that this platform is intuitive and user-friendly which contributes a fair share in its massive appeal. If you own a Drupal website and wonder how to use Google Tag Manager with Drupal like many others, this blog is all you need. It elucidates everything in a detailed yet simplified manner.
First, let’s delve into what Google Tag Manager is and what makes it special.
KDE's 6th Megarelease - Beta 1
Every few years we port the key components of our software to a new version of Qt, taking the opportunity to remove cruft and leverage the updated features the most recent version of Qt has to offer us.
It has been nearly 10 years since the last big release of our flagship Plasma desktop environment, and the time has come again. KDE is making available today the Beta version of all the software we will include in a megarelease scheduled for the end of February 2024.
To ensure all parts of KDE's software stack are working together, we are releasing all our major bundles at the same time. Today sees the continuation of that journey with the Beta releases of Plasma 6, KDE Frameworks 6 and the KDE Gear bundle of apps.
This is a very early preview intended for developers and testers only. We hope it will be picked up by rolling unstable distros, but it is far from being ready for day-to-day use yet.
Read on to find out more about KDE's 6th Megarelease, what it covers, and how you can help make the new versions of Plasma, KDE's apps and Frameworks a success now.
PlasmaPlasma is KDE's flagship desktop environment. Plasma is like Windows or macOS, but is renowned for being flexible, powerful, lightweight and configurable. It can be used at home, at work, for schools and research.
Plasma 6 is the upcoming version of Plasma that integrates the latest version of Qt, Qt 6, the framework upon which Plasma is built.
Plasma 6 incorporates new technologies from Qt and other constantly evolving tools, providing new features, better support for the latest hardware, and supports for the hardware and software technologies to come.
You can be part of the new Plasma. Download and install a Plasma 6-powered distribution (like Neon Unstable) to a test machine and start trying all its features. Check the Contributing section below to find out how you can deliver reports of what you find to the developers.
KDE GearKDE Gear is a collection of applications produced by the KDE community. Gear includes file explorers, music and video players, text and video-editors, apps to manage social media and chats, email and calendaring applications, travel assistants, and much more.
Developers of these apps also rely on the Qt toolbox, so most of the software will also be adapted to use the new Qt6 toolset and we need you to help us test them too.
FrameworksKDE's Frameworks add tools created by the KDE community on top of those provided by the Qt toolbox. These tools give developers more and easier ways of developing interfaces and functionality that work on more platforms.
Among many other things, KDE Frameworks provide
- widgets (buttons, text boxes, etc.) that make building your apps easier and their looks more consistent across platforms, including Windows, Linux, Android and macOS
- libraries that facilitate storing and retrieving configuration settings
- icon sets, or technologies that make the integration of the translation workflow of applications easier
KDE's Frameworks also rely heavily on Qt and will also be upgraded to adapt them to the new version 6. This change will add more features and tools, enable your applications to work on more devices, and give them a longer shelf life.
- KDE Frameworks 6 Beta Source Code Info Page
- KDE Frameworks 6 Beta Full Changelog
- KDE Frameworks 6 packagers release notes
Contributing
KDE relies on volunteers to create, test and maintain its software. You can help too by...
- Reporting bugs -- When you come across a bug when testing the software included in this Alpha Megarelease, you can report it so developers can work on it and remove it. When reporting a bug
- make sure you understand when the bug is triggered so you can give developers a guide on how to check it for themselves
- check you are using the latest version of the software you are testing, just in case the bug has been solved in the meantime
- go to KDE's bug-tracker and search for your bug to make sure it does not get reported twice
- if no-one has reported the bug yet, fill in the bug report, giving all the details you think are significant.
- keep tabs on the report, just in case developers need more details.
- Solving bugs -- Many bugs are easy to solve. Some just require changing a version number or tweaking the name of a library to its new name. If you have some basic programming knowledge of C++ and Qt, you too can help carry the weight of debugging KDE's software for the grand release in February.
- Joining the development effort -- You may have a deeper knowledge development, and would like to contribute to KDE with your own solutions. This is the perfect moment to get involved in KDE and contribute with your own code.
- Donating to KDE -- Creating, debugging and maintaining the large catalogue of software KDE distributes to users requires a lot of resources, many of which cost money. Donating to KDE helps keep the day-to-day operation of KDE running smoothly and allows developers to concentrate on creating great software. KDE is currently running a drive to encourage more people to become contributing supporters, but you can also give one-time donations if you want.
Pre-release software is only suited for developers and testers. Alpha/Beta/RC software is unfinished, will be unstable and will contain bugs. It is published so volunteers can trial-run it, identify its problems, and report them so they can be solved before the publication of the final product.
The risks of running pre-release software are many. Apart from the hit to productivity produced by instability and the lack of features, the using pre-release software can lead to data loss, and, in extreme cases, damage to hardware. That said, the latter is highly unlikely in the case of KDE software.
The version of the software included in KDE's 6th Megarelease is beta software. We strongly recommend you do not use it as your daily driver.
If, despite the above, you want to try the software distributed in KDE's 6th Megarelease, you do so under your sole responsibility, and in the understanding that the main aim, as a tester, you help us by providing feedback and your know-how regarding the software. Please see the Contributing section above.
Dirk Eddelbuettel: RcppSimdJson 0.1.11 on CRAN: Maintenance
A new maintenance release 0.1.11 of the RcppSimdJson package is now on CRAN.
RcppSimdJson wraps the fantastic and genuinely impressive simdjson library by Daniel Lemire and collaborators. Via very clever algorithmic engineering to obtain largely branch-free code, coupled with modern C++ and newer compiler instructions, it results in parsing gigabytes of JSON parsed per second which is quite mindboggling. The best-case performance is ‘faster than CPU speed’ as use of parallel SIMD instructions and careful branch avoidance can lead to less than one cpu cycle per byte parsed; see the video of the talk by Daniel Lemire at QCon.
This release responds to a CRAN request to address issues now identified by -Wformat -Wformat-security. These are frequently pretty simple changes as it was here: all it took was an call to compileAttributes() from an updated Rcpp version which now injects "%s" as a format string when calling Rf_error().
The (very short) NEWS entry for this release follows.
Changes in version 0.1.11 (2023-11-28)- RcppExports.cpp has been regenerated under an update Rcpp to address a print format warning (Dirk in #88).
Courtesy of my CRANberries, there is also a diffstat report for this release. For questions, suggestions, or issues please use the issue tracker at the GitHub repo.
If you like this or other open-source work I do, you can now sponsor me at GitHub.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.