Feeds

Nonprofit Drupal posts: October Drupal for Nonprofits Chat

Planet Drupal - Wed, 2024-10-16 13:41

Join us THURSDAY, October 17 at 1pm ET / 10am PT, for our regularly scheduled call to chat about all things Drupal and nonprofits. (Convert to your local time zone.)

We don't have anything specific on the agenda this month, so we'll have plenty of time to discuss anything that's on our minds at the intersection of Drupal and nonprofits.  Got something specific you want to talk about? Feel free to share ahead of time in our collaborative Google doc: https://nten.org/drupal/notes!

All nonprofit Drupal devs and users, regardless of experience level, are always welcome on this call.

This free call is sponsored by NTEN.org and open to everyone. 

  • Join the call: https://us02web.zoom.us/j/81817469653

    • Meeting ID: 818 1746 9653
      Passcode: 551681

    • One tap mobile:
      +16699006833,,81817469653# US (San Jose)
      +13462487799,,81817469653# US (Houston)

    • Dial by your location:
      +1 669 900 6833 US (San Jose)
      +1 346 248 7799 US (Houston)
      +1 253 215 8782 US (Tacoma)
      +1 929 205 6099 US (New York)
      +1 301 715 8592 US (Washington DC)
      +1 312 626 6799 US (Chicago)

    • Find your local number: https://us02web.zoom.us/u/kpV1o65N

  • Follow along on Google Docs: https://nten.org/drupal/notes

View notes of previous months' calls.

Categories: FLOSS Project Planets

Security advisories: Drupal core - Moderately critical - Improper error handling - SA-CORE-2024-002

Planet Drupal - Wed, 2024-10-16 12:27
Project: Drupal coreDate: 2024-October-16Security risk: Moderately critical 13 ∕ 25 AC:Basic/A:None/CI:None/II:All/E:Theoretical/TD:UncommonVulnerability: Improper error handlingAffected versions: >=10.0 < 10.2.10Description: 

Under certain uncommon site configurations, a bug in the CKEditor 5 module can cause some image uploads to move the entire webroot to a different location on the file system. This could be exploited by a malicious user to take down a site.

The issue is mitigated by the fact that several non-default site configurations must exist simultaneously for this to occur.

Solution: 

Install the latest version:

  • If you are using Drupal 10.2, update to Drupal 10.2.10.
  • Drupal 10.3 and above are not affected, nor is Drupal 7.

All versions of Drupal 10 prior to 10.2 are end-of-life and do not receive security coverage. (Drupal 8 and Drupal 9 have both reached end-of-life.)

This advisory is not covered by Drupal Steward.

Reported By: Fixed By: Coordinated By: 
Categories: FLOSS Project Planets

Django Weblog: Announcing weekly DSF office hours

Planet Python - Wed, 2024-10-16 10:27

For the last year, Thibaud Colas and I have had a weekly DSF co-working session — we get on a video call and spend an hour quietly working together on DSF things. It's worked well to help us carve out time to work on DSF initiatives, so we'd like to expand into an open-to-everyone weekly "office hours" format.

These will be Wednesdays at 6PM UTC (convert to other time zones). (Yes, that means the first one will be in just about 4 hours, short notice I know, so maybe mark it down for next week.)

All you need to do is bring something DSF-related to work on. This is intentionally broad, as long as it's vaguly DSF-related you're welcome to come. It's not a general-purpose Django coding session (you're welcome to be writing code but it should be related the DSF, e.g. working on djangoproject.com or something.)

This week and next, we'll probably be focusing on nominations for the DSF Board -- nominations close October 25th.

For now, we're deliberately not publishing the video call information publicly — we're a bit worried about spammers and scammers. So if you want to join, you'll need to contact the board, or someone on the board, to get the info. You can use the DSF contact form, and anyone's welcome to contact me directly: — email jacob@djangoproject.com, Signal jacobian.01, or @jacob@jacobian.org on Mastodon.

(Yes, this introduces some friction which is at odds with the "everyone's welcome" ethos. If/when we figure out a better way to moderate these calls, we'll change this.)

I look forward to seeing you there!

Categories: FLOSS Project Planets

Mike Driscoll: SSH Scripting with Fabric and Python

Planet Python - Wed, 2024-10-16 10:08

Reading and writing files is a basic task that most software applications need to do. You will also find that you sometimes need to read and write files to a remote machine or perhaps run commands on a remote machine as well. Python is well-suited for this type of activity using tools such as Paramiko. However, in this tutorial, you will spend some time learning how to use a different package called Fabric.

Fabric is a high-level Python package designed especially to execute shell commands remotely over SSH and then yielding useful Python objects in return. This article will focus on the latest version of Fabric, which is 3.2.2 at the time of writing.

Getting Fabric

Fabric is a third party package. That means you need to install Fabric to be able to use it. Fortunately, you can use Python’s pip tool to do so.

Open up a terminal application and run the following command:

python -m pip install fabric

If you don’t want to clutter up your main Python environment, then you should use a Python virtual environment. You can learn more about those in An Intro to Python Virtual Environments.

Once you are finished installing Fabric, you can move on to learning how to use it!

Connecting to the Server with Fabric

The Fabric documentation uses the following as a super simple example of running a command on a remote machine using SSH:

from fabric import Connection result = Connection('web1.example.com').run('uname -s', hide=True)

You only need two lines of code to start running commands on a remote machine. But what if the remote machine requires credntials?

In that case, you need to create a Config object and update your instantiation of Connection like this:

from fabric import Connection, Config config = Config(overrides={"sudo": {"password": "MyAmazingPassword123"}}) conn = Connection("mike@10.10.166.128:22", connect_kwargs={"password": "MyAmazingPassword123!"}, config=config)

If you have a machine that uses an SSH key pair, you can use this alternate connect_kwargs dictionary:

connect_kwargs={ "key_filename": "/home/myuser/.ssh/private.key", }

Then simply update the call to Connection and you’re good to go.

Running Commands with Fabric

Now that you have the knowledge needed to connect to the remote machine, you probably want to start running more complex commands. Here is an example of running a ping command:

from fabric import Connection, Config config = Config(overrides={"sudo": {"password": "MyAmazingPassword123"}})  conn = Connection("mike@10.10.166.128:22", connect_kwargs={"password": "MyAmazingPassword123!"}, config=config) conn.run("ping -c 2 www.google.com")

What if you want to be able to use the super user (i.e. root) when running a command? Fabric makes that easy by using the sudo() method:

from fabric import Connection, Config config = Config(overrides={"sudo": {"password": "MyAmazingPassword123"}})  conn = Connection("mike@10.10.166.128:22", connect_kwargs={"password": "MyAmazingPassword123!"}, config=config) conn.sudo("systemctl restart nfs-kernel-server") Transferring Files with Fabric

If you want to download a file from a remote machine, Fabric makes this rudimentary task even easier. Here’s how to do it:

from fabric import Connection, Config config = Config(overrides={"sudo": {"password": "MyAmazingPassword123"}})  conn = Connection("mike@10.10.166.128:22", connect_kwargs={"password": "MyAmazingPassword123!"}, config=config) conn.get("remote_file_path", "local_file_path")

Note that all you need to do is call get() while specifying the location of the remote file that you want for the first argument and the local path for where you want to download the file as the second argument.

Sending a file to the remote server is done using the put() method:

from fabric import Connection, Config config = Config(overrides={"sudo": {"password": "MyAmazingPassword123"}})  conn = Connection("mike@10.10.166.128:22", connect_kwargs={"password": "MyAmazingPassword123!"}, config=config) conn.put("local_file_path", "remote_file_path")

You reverse the arguments for put() versus get(). The local path is passed in first, followed by the remote location that you want to upload to.

But what if you want to upload to a restricted area of the file system on the remote machine? You know, like to the etc folder or any of the other root-owned folders?

Fabric doesn’t have a built-in way to do that. Instead you use a two-step process:

  • Upload the file to a directory that your user owns
  • Then use sudo() to move the file to the restricted location

Here’s an example:

from fabric import Connection, Config config = Config(overrides={"sudo": {"password": "MyAmazingPassword123"}})  conn = Connection("mike@10.10.166.128:22", connect_kwargs={"password": "MyAmazingPassword123!"}, config=config) # Send the file to a user directory conn.put("local_file_path", "remote_file_path") # Use sudo to move that file to a root location conn.sudo("mv remote_file_path root_location_path") Wrapping Up

Fabric is a great tool that greatly simplifies running SSH commands on remote computers. If you know how to use common Linux commands or know Python well, you can do lots of different things. For example, you could even upload a Python script to the remote server, run it, and then remove the file. At that point, you could do just about anything that you needed to.

Give Fabric a try and see what you can do!

The post SSH Scripting with Fabric and Python appeared first on Mouse Vs Python.

Categories: FLOSS Project Planets

Real Python: Structural Pattern Matching in Python

Planet Python - Wed, 2024-10-16 10:00

Structural pattern matching is a powerful control flow construct invented decades ago that’s traditionally used by compiled languages, especially within the functional programming paradigm.

Most mainstream programming languages have since adopted some form of pattern matching, which offers concise and readable syntax while promoting a declarative code style. Although Python was late to join the party, it introduced structural pattern matching in the 3.10 release.

In this tutorial, you’ll:

  • Master the syntax of the match statement and case clauses
  • Explore various types of patterns supported by Python
  • Learn about guards, unions, aliases, and name binding
  • Extract values from deeply nested hierarchical data structures
  • Customize pattern matching for user-defined classes
  • Identify and avoid common pitfalls in Python’s pattern matching

To get the most out of this tutorial, you should have a basic understanding of conditional statements, loops, functions, and classes in Python. Additionally, familiarity with Python’s built-in data structures, such as tuples, lists, and dictionaries, will be beneficial.

Get Your Free Code: Click here to download the free sample code that shows you how to use structural pattern matching in Python.

Take the Quiz: Test your knowledge with our interactive “Structural Pattern Matching” quiz. You’ll receive a score upon completion to help you track your learning progress:

Interactive Quiz

Structural Pattern Matching

In this quiz, you'll test your understanding of structural pattern matching in Python. This powerful control flow construct, introduced in Python 3.10, offers concise and readable syntax while promoting a declarative code style.

Getting to Know Structural Pattern Matching

Before taking advantage of structural pattern matching in your code, make sure that you’re running Python 3.10 or later, as you won’t be able to use it in earlier Python versions. Note that although the name structural pattern matching is often shortened to just pattern matching, the qualifier structural is crucial to understanding the use cases for this feature. In this section, you’ll get a high-level overview of structural pattern matching.

What Is Pattern Matching?

You can think of pattern matching as a form of syntactic sugar built on top of existing language constructs, including conditional statements and tuple unpacking. While you can absolutely live without pattern matching, it gives you new superpowers, making this feature more convenient than the conventional syntax in some situations.

Pattern matching often leads to more elegant, concise, and readable code written in a declarative style. To get a taste of it, take a quick look at the following example without trying to fully understand how it works just yet:

Python import json def log(event): match json.loads(event): case {"keyboard": {"key": {"code": code}}}: print(f"Key pressed: {code}") case {"mouse": {"cursor": {"screen": [x, y]}}}: print(f"Mouse cursor: {x=}, {y=}") case _: print("Unknown event type") Copied!

The match statement takes a subject, which can be any valid Python expression, such as a string literal or a function call, and compares the resulting value to one or more patterns listed in the case clauses. The first pattern that matches the given subject will trigger the corresponding case block to run. You’ll learn more about the match statement and case clauses later in this tutorial.

At first glance, the syntax of structural pattern matching in Python looks a bit like the switch statement found in the C-family programming languages if you squint your eyes:

C void log_event(enum Event event) { switch (event) { case KEYBOARD: printf("Keyboard event\n"); break; case MOUSE: printf("Mouse event\n"); break; default: printf("Unknown event\n"); } } Copied!

This resemblance is deceptive, though. The classic switch statement controls the execution flow based on the exact value stored in a variable. It effectively works as a chained sequence of mutually exclusive if..elif... equality comparisons, but with a more succinct and readable syntax.

Although you can use pattern matching this way, you’d be missing out on its true power and flexibility. Structural pattern matching was designed to go beyond value comparisons. In particular, it combines conditional statements or branching based on a logical predicate with destructuring or object deconstruction, which is the inverse of object construction. You’ll see examples of destructuring in the next section.

Note: Because pattern matching does two things at once, the Python interpreter can take advantage of this to optimize the underlying bytecode with specialized opcodes, making the code run slightly faster.

The brief code snippet above merely scratches the surface of what you can achieve with pattern matching, but it already shows you its expressiveness, especially when you compare it with the traditional if...elif... statements and isinstance() checks. Here’s one of the many ways you can implement the equivalent logic using standard Python:

Python import json def log(event): parsed_event = json.loads(event) if ( "keyboard" in parsed_event and "key" in parsed_event["keyboard"] and "code" in parsed_event["keyboard"]["key"] ): code = parsed_event["keyboard"]["key"]["code"] print(f"Key pressed: {code}") elif ( "mouse" in parsed_event and "cursor" in parsed_event["mouse"] and "screen" in parsed_event["mouse"]["cursor"] ): screen = parsed_event["mouse"]["cursor"]["screen"] if isinstance(screen, list) and len(screen) == 2: x, y = screen print(f"Mouse cursor: x={x}, y={y}") else: print("Unknown event type") else: print("Unknown event type") Copied!

This code is functionally identical to the previous version but is longer and has more indentation levels than before. Additionally, it looks more verbose and imperative in style, describing not only what to do but also how to perform the individual steps. Granted, you could try making it slightly shorter by using the Walrus operator and following the EAFP principle without explicit checks, but it’d remain somewhat convoluted.

It’s worth noting that structural pattern matching first emerged in compiled functional languages with static typing. The attempt to implement it in Python, which is a dynamic language, presented completely new and unique challenges. You can read more about them in the paper entitled Dynamic Pattern Matching with Python, which was co-authored by Guido van Rossum and published in the proceedings of the Dynamic Languages Symposium in 2020.

Now that you’ve seen the most basic form of pattern matching in Python, it’s time to unravel the meaning of a structural pattern.

What Is a Structural Pattern? Read the full article at https://realpython.com/structural-pattern-matching/ »

[ 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

LN Webworks: Top 10 Benefits Of Using Drupal For Your Website Development

Planet Drupal - Wed, 2024-10-16 08:06

If you are searching for the best content management system or CMS, then Drupal is the one that can power your website. In case you have not looked into Drupal before this, then you might not know its perks. 

Well, do not worry, in this read, you are going to learn about the benefits of using Drupal for your website development. Whether you are an individual, agency, small business, or enterprise, with Drupal you can now create powerful websites and apps.

Top 10 Benefits Of Using Drupal For Your Website Development 

There are many advantages of using Drupal for your website development. Let us delve more into it.

 

Categories: FLOSS Project Planets

ClearlyDefined’s Steering and Outreach Committees Defined

Open Source Initiative - Wed, 2024-10-16 07:28

We are excited to announce the newly elected leaders for the ClearlyDefined Steering and Outreach Committees!

What is ClearlyDefined?

ClearlyDefined is an Open Source project dedicated to improving the clarity and transparency of Open Source licensing and security data. By harvesting, curating, and sharing essential metadata, ClearlyDefined helps developers and organizations better understand their software components, ensuring responsible and compliant use of Open Source code.

Steering Committee Election Results:

Congratulations to E. Lynette Rayle (GitHub), Qing Tomlinson (SAP), and Jeff Mendoza (Kusari/GUAC) for being elected to the ClearlyDefined Steering Committee. These three community leaders will serve a one-year term starting on September 25, 2024. Following election recommendations, the Steering Committee is structured to have an odd number of members (three in this case) and a maximum of one member per company. Lynette Rayle was elected chair of the committee.

The Steering Committee is primarily responsible for setting the project’s technical direction. They oversee processes such as data harvesting, curation, and contribution, ensuring that the underlying architecture functions smoothly. Their focus is on empowering the community, supporting the contributors and maintainers, and fostering collaboration with related projects.

E. Lynette Rayle is a Senior Engineer at GitHub and has been working on ClearlyDefined as a maintainer for just over a year.  GitHub is using ClearlyDefined data in several capacities and has a strong stake in ensuring successful outcomes in data quality, performance, and sustainability.

Qing Tomlinson is a Senior Developer at SAP and has been contributing to the ClearlyDefined project since November 2021.  SAP has been actively engaged in the ClearlyDefined project since its inception, utilizing the data and actively contributing to its curation. The quality, performance, and long-term viability of the ClearlyDefined project are of utmost importance to SAP.

Jeff Mendoza is a Software Engineer at Kusari, a software supply chain security startup. He is a maintainer of the OpenSSF GUAC project, which consumes ClearlyDefined data. Formerly, Jeff was a full time developer on ClearlyDefined. Jeff brings experience from both the sides of the project, developer and consumer.

Outreach Committee Election Results:

We are also thrilled to announce the election of Jeff Luszcz (GitHub), Alyssa Wright (Bloomberg), Brian Duran (SAP), and Nick Vidal (Open Source Initiative) to lead the ClearlyDefined Outreach Committee. They began their one-year term on October 7, 2024. Unlike the Steering Committee, the Outreach Committee has four members, following a consensus reached at the Community meeting that an even number of members is acceptable since tie-breaking votes are less likely. The elected members will select their Chair soon and may also invite other community members to participate.

The Outreach Committee focuses on promoting the project and growing its community. Their responsibilities include organizing events, creating educational materials, and managing communications across various channels, including blogs, social media, and webinars. They help ensure that more users and contributors engage with ClearlyDefined and understand its mission.

Jeff Luszcz is Staff Product Manager at GitHub. Since 2004, he has helped hundreds of software companies understand how to best use open source while complying with their license obligations and keeping on top of security issues.

Alyssa Wright helps lead Bloomberg’s Open Source Program Office in the Office of the CTO, which is the center of excellence for Bloomberg’s engagements with and consumption of open source software.

Brian Duran leads the implementation strategy for adoption of ClearlyDefined within SAP’s open source compliance teams. He has a combined 12 years of experience in open-source software compliance and data quality management.

Nick Vidal is Community Manager at the Open Source Initiative and former Outreach Chair at the Confidential Computing Consortium from the Linux Foundation. Previously, he was the Director of Community and Business Development at the Open Source Initiative and Director of Americas at the Open Invention Network.

Get Involved!

We encourage everyone in the ClearlyDefined community to get involved! Whether you’re a developer, data curator, or simply passionate about Open Source software, your contributions are invaluable. Join the conversation, attend meetings, and share your ideas on how to improve and grow the project. Reach out to the newly elected committee members or participate in our upcoming community events.

Let’s work together to drive the ClearlyDefined mission forward! Stay tuned for more updates and opportunities to participate as the committees continue their important work.

Categories: FLOSS Research

Droptica: How to Build a Simple System on Drupal for Equipment List with Company Assets?

Planet Drupal - Wed, 2024-10-16 05:00

In this article, I’ll show you how to build a system to keep track of your company assets using Drupal. This system allows you to easily create and manage an equipment list with resources such as laptops, phones, monitors, or desks that are assigned to employees. It’s ideal for remote or hybrid companies, where control over issued equipment is crucial. Read the blog post or watch an episode of the “Nowoczesny Drupal” series (the video is in Polish).

Categories: FLOSS Project Planets

Metadrop: What do I need to know before enabling the State Cache in Drupal 10.3.0?

Planet Drupal - Wed, 2024-10-16 03:23

You have likely upgraded Drupal to version 10.3.0 and noticed a new message in the reports regarding the State Cache:

Image

The message reads as follows:

The State Cache flag $settings['state_cache'] is not enabled. It is recommended to enable it in settings.php unless too many keys are stored. Starting with Drupal 11, State Cache will be enabled by default.

What is the State API?

Let's begin by understanding what the State API is. The State API in Drupal is a system that allows the storage and retrieval of small data fragments that are necessary for site operation but are not part of the overall configuration. Unlike the Config API, which focuses on data that must be consistent across different environments (like production, development, etc.), the State API is intended for environment-specific data that can change more dynamically and do not need to be synchronized across different environments.

Why does it…
Categories: FLOSS Project Planets

Sahil Dhiman: 25, A Quarter of a Century Later

Planet Debian - Tue, 2024-10-15 23:07

25 the number says well into adulthood. Aviral pointed that I have already passed 33% mark in my life, which does hits different.

I had to keep reminding myself about my upcoming birthday. It didn’t felt like birthday month, week or the day itself.

My writings took a long hiatus starting this past year. The first post came out in May and quite a few people asked about the break. Hiatus had its own reasons, but restarting became harder each passing day afterward. Preparations for DebConf24 helped push DebConf23 (first post this year) out of the door, after which things were more or less back on track on the writing front.

Recently, I have picked the habit of reading monthly magazines. When I was a child, I used to fancy seeing all the magazines on stationary and bookshops and thought of getting many when I’m older. Seems like that was the connection, and now I’m heavily into monthly magazines and order many each month (including Hindi ones). They’re fun short reads and cover a wide spectrum of topics.

Travelling has become the new found love. I got the opportunity to visit a few new cities like Jaipur, Meerut, Seoul and Busan. My first international travel showed me how a society which cares about the people’s overall wellbeing turns out to be. Going in foreign land, expanded the concept of everything for me. It showed the beauty of silence in public places. Also, re-visited Bengaluru, which felt good with its good weather and food.

It has become almost become tradition to attend a few events. Jashn-e-Rekhta, DebConf, New Delhi World Book Fair, IndiaFOSS and FoECon. It’s always great talking to new and old folks, sharing and learning about ideas. It’s hard for an individual to learn, grow and understand the world in a silo. Like I keep on saying about Free Software projects, it’s all about the people, it’s always about the people. Good and interesting people keep the project going and growing. (Side Note - it’s fine if a project goes. Things are not meant to last a perpetuity. Closing and moving on is fine). Similarly, I have been trying to attend Jaipur Literature Festival since a while but failing. Hopefully, I would this time around.

Expanding my Free Software Mirror to India was a big highlight this year. The mirror project now has 3 nodes in India and 1 in Germany, serving almost 3-4 TB of mirror traffic daily. Increasing the number of Software mirrors in India was and still is one of my goals. Hit me up if you want to help or setup one yourself. It’s not that hard now actually, projects that require more mirrors and hosting setup has already been figured out.

One realization I would like to mention was to amplify/support people who’re already doing (a better job) at it, rather than reinventing the wheel. A single person might not be able to change the world, but a bunch of people experimenting and trying to make a difference certainly would.

Writing 25 was felt harder than all previous years. It was a traditional year with much internal growth due to experiencing different perspectives and travelling.

To infinity and beyond!

Categories: FLOSS Project Planets

New Craft cache 24.10 published

Planet KDE - Tue, 2024-10-15 20:00

A new Craft cache has just been published. The update is already available for KDE's CD, CI (Windows/Android) will follow in the next days.

Please note that this only applies to the Qt6 cache. The Qt5 cache is in LTS mode since April 2024 and does not recieve major updates anymore.

Changes (highlights) Craft Core
  • Drop Python2 support
  • Require at least Python 3.9
Blueprints
  • Qt 6.8.0
  • FFmpeg 7.1
  • Kirigami Addons 1.5.0
  • KDE Frameworks 6.7.0
  • KDE Plasma 6.2.0
  • Removed snoregrowl
  • Removed ctemplate
About KDE Craft

KDE Craft is an open source meta-build system and package manager. It manages dependencies and builds libraries and applications from source on Windows, macOS, Linux, FreeBSD and Android.

Learn more on https://community.kde.org/Craft or join the Matrix room #kde-craft:kde.org

Categories: FLOSS Project Planets

Dirk Eddelbuettel: qlcal 0.0.13 on CRAN: Small Calendar Update

Planet Debian - Tue, 2024-10-15 16:17

The thirteenth release of the qlcal package arrivied at CRAN today.

qlcal delivers the calendaring parts of QuantLib. It is provided (for the R package) as a set of included files, so the package is self-contained and does not depend on an external QuantLib library (which can be demanding to build). qlcal covers over sixty country / market calendars and can compute holiday lists, its complement (i.e. business day lists) and much more. Examples are in the README at the repository, the package page, and course at the CRAN package page.

This releases synchronizes qlcal with the QuantLib release 1.36 (made this week) and contains some minor updates to two calendars.

Changes in version 0.0.13 (2024-10-15)
  • Synchronized with QuantLib 1.36 released yesterday

  • Calendar updates for South Korea and Poland

Courtesy of my CRANberries, there is a diffstat report for this release. See the project page and package documentation for more details, and more examples. If you like this or other open-source work I do, you can 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.

Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, October 18, starting at 12:00 EDT (16:00 UTC)

GNU Planet! - Tue, 2024-10-15 15:51
Join the FSF and friends on Friday, October 18 from 12:00 to 15:00 EDT (16:00 to 19:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

Python Insider: Python 3.14.0 alpha 1 is now available

Planet Python - Tue, 2024-10-15 15:38

It's now time for a new alpha of a new version of Python!

https://www.python.org/downloads/release/python-3140a1/

This is an early developer preview of Python 3.14

Major new features of the 3.14 series, compared to 3.13

Python 3.14 is still in development. This release, 3.14.0a1 is the first of seven planned alpha releases.

Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process.

During the alpha phase, features may be added up until the start of the beta phase (2025-05-06) and, if necessary, may be modified or deleted up until the release candidate phase (2025-07-22). Please keep in mind that this is a preview release and its use is not recommended for production environments.

Many new features for Python 3.14 are still being planned and written. Among the new major new features and changes so far:

The next pre-release of Python 3.14 will be 3.14.0a2, currently scheduled for 2024-11-19.

More resources Enjoy the new release

Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.

Regards from a grey yet colourful Helsinki,

Your release team,
Hugo van Kemenade
Ned Deily
Steve Dower
Łukasz Langa

Categories: FLOSS Project Planets

PyCoder’s Weekly: Issue #651 (Oct. 15, 2024)

Planet Python - Tue, 2024-10-15 15:30

#651 – OCTOBER 15, 2024
View in Browser »

Exploring the New Features of Python 3.13

Python 3.13 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to discuss the new version. This year, Geir Arne coordinated a series of preview articles with members of the Real Python team and a showcase tutorial, “Python 3.13: Cool New Features for You to Try.” Christopher’s video course “What’s New in Python 3.13” covers the topics from the article and shows the new features in action.
REAL PYTHON podcast

HPy: A Better C API for Python

The HPy project is a wrapper to the Python C-API meant to make it easier to integrate with Python code. It allows for universal binaries and has a debug mode. Associated HN Discussion
HPYPROJECT.ORG

Posit Connect: Share the Work You Make With Streamlit, FastAPI, & Other FOSS Frameworks

People use Posit Connect to publish, host, & manage interactive apps, dashboards, Python models, APIs, & much more. It provides a centralized, self-service place to share the products of data science teams. Increase the impact of your work by making it easier for others to integrate with your work →
POSIT sponsor

PyCon Africa 2024: A Summary

This was Vuyisile’s first visit to PyCon Africa and so he posted a summary of the event.
VUYISILE NDLOVU

PEP 760: No More Bare Excepts (Withdrawn)

PYTHON.ORG

PEP 735: Dependency Groups in pyproject.toml (Accepted)

PYTHON.ORG

Django Bugfix Release Issued: 5.1.2

DJANGO SOFTWARE FOUNDATION

Python Developers Survey 2024

PSF

Quiz: When to Use a List Comprehension in Python

REAL PYTHON

Quiz: Modern Python String Formatting Tools

REAL PYTHON

Articles & Tutorials __init__.py Files Are Optional. You Should Still Use Them

If you’ve ever googled the question “Why do Python packages have empty __init__.py files?”, you could get the idea that Python packages wouldn’t work without them. This is a common misconception—they’ve been optional since Python 3.3! Why then, do most Python projects still have them?
BOVENBERG.NET • Shared by Arie Bovenberg

Build a Contact Book App With Python, Textual, and SQLite

In this tutorial, you’ll be guided step by step through the process of building a basic contact book application. You’ll use Python and Textual to build the application’s text-based user interface (TUI), and then use SQLite to manage the database.
REAL PYTHON

Save 100+ Engineering Hours With the Highest Performing GPU Clusters on the Market

FluidStack provides GPU clusters for LLM training & inference for the top AI labs including Poolside and CharacterAI. Clusters are built on the latest Nvidia GPUs (A100s, H100s, H200s, GB200s) and are deployed on fully managed Kubernetes/Slurm with 24/7 support, 15 min response time and 99% uptime →
FLUIDSTACK sponsor

PEP 777: How to Re-Invent the Wheel

“The current wheel 1.0 specification was written over a decade ago, and has been extremely robust to changes in the Python packaging ecosystem… this PEP prescribes compatibility requirements on future wheel revisions.”
PYTHON.ORG

PEP 758: Allow except and except* Expressions Without Parentheses

“This PEP proposes to allow unparenthesized except and except* blocks in Python’s exception handling syntax. Currently, when catching multiple exceptions, parentheses are required around the exception types.”
PYTHON.ORG

PEP 761: Deprecating PGP Signatures for CPython Artifacts

Since Python 3.11.0, CPython has provided two verifiable digital signatures for all CPython artifacts: PGP and Sigstore. This PEP proposes moving to Sigstore as the only way of signing artifacts.
PYTHON.ORG

In the Making of Python Fitter and Faster

This post details how Python’s recent performance improvements work under the hood. It covers changes to the interpreter, better memory management, and the newly experimental JIT compiler.
SUMER CIP

The Ultimate Guide to Error Handling in Python

This detailed post covers the variety of ways to deal with errors in your code, why you might choose between the approaches, and what all this theory actually means in the real world.
MIGUEL GRINBERG

TypedDicts Are Better Than You Think

TypedDict was introduced in PEP-589 which landed in Python 3.8. The primary use case was to create type annotations for dictionaries. This post explains why you should use them.
CHANGS.CO.UK

Narrow State of a Django Model Using Python TypeGuard

Bruno came across a problem with type checking for a Django project which led him to use TypeGuard for the first time. This post explains why.
BRUNO ALLA

If We Had $1,000,000…

Jacob ponders what the Django Software Foundation would look like if they had 4x their current budget.
JACOB KAPLAN-MOSS

Projects & Code srgn: Grep-Like Tool That Understands Code

GITHUB.COM/ALEXPOVEL

streamable: Stream-Like Manipulation of Iterables

GITHUB.COM/EBONNAL

httpdbg: Debug HTTP(S) Requests in a Python Program

GITHUB.COM/CLE-B

Secure.py: HTTP Security Headers Made Easy

GITHUB.COM/TYPEERROR • Shared by Caleb Kinney

django-admin-tui: Django Admin in the Terminal!

GITHUB.COM/VALBERG

Events Weekly Real Python Office Hours Q&A (Virtual)

October 16, 2024
REALPYTHON.COM

Python Brasil 2024

October 16 to October 21, 2024
PYTHONBRASIL.ORG.BR

PyCon Panamá 2024

October 16 to October 19, 2024
PYCON.PA

Swiss Python Summit 2024

October 17 to October 19, 2024
PYTHON-SUMMIT.CH

PyData Bristol Meetup

October 17, 2024
MEETUP.COM

PyLadies Dublin

October 17, 2024
PYLADIES.COM

PyCon APAC 2024

October 25 to October 27, 2024
PYCON.ID

PyCon Korea 2024

October 25 to October 28, 2024
PYCON.KR

PythonHo Conference 2024

October 26 to October 28, 2024
PYTHONHO.COM

Happy Pythoning!
This was PyCoder’s Weekly Issue #651.
View in Browser »

[ Subscribe to 🐍 PyCoder’s Weekly 💌 – Get the best Python news, articles, and tutorials delivered to your inbox once a week >> Click here to learn more ]

Categories: FLOSS Project Planets

Bounteous.com: Empower Your Marketing Team with These Exciting Drupal CMS Features

Planet Drupal - Tue, 2024-10-15 12:19
Discover how a comprehensive Measurement Strategy can optimize B2B performance by aligning metrics, improving data quality, and driving business outcomes.
Categories: FLOSS Project Planets

Ramsalt Lab: Top 10 presentations from DrupalCon Barcelona 2024

Planet Drupal - Tue, 2024-10-15 11:09
Top 10 presentations from DrupalCon Barcelona 2024 Hansa Pandit Drupal frontend developer 15.10.2024

20 employees from Ramsalt Lab had the opportunity to attend one of the most awaited Drupal events of the year, DrupalCon 2024 in the beautiful city of Barcelona.

It was a great event with inspiring sessions and hands-on workshops. Our team have made this list of the top 10 session from Barcelona:

  1. Driesnote: DrupalCon Barcelona 2024
    Our top recommendation is Driesnote, where Dries Buytaert, the founder of Drupal, presents the revolutionary Drupal CMS (being built under the Starshot Initiative). This will be a new era in Drupal with AI-enabled website building for non-developers.
  2. Drupal Recipes Initiative Update
    This session gives an update on Drupal’s Recipes initiative, and how you can contribute to it. You'll also learn about recipes that you can start using right away!
  3. Building Safer Digital Communities - The Mission of "Defend Iceland"
    In this keynote, Theódór Gislason shares his journey, ignited by a life-altering accident thirty years ago, and discusses the vision for the "Defend Iceland" hacker platform. He addresses the challenges of democratizing cybersecurity and highlights how a united community of responsible companies and ethical hackers could enhance our collective cyber resilience.
  4. Running a fleet of websites with ease via LocalGov Drupal Microsites Platform
    Learn how to create and manage a fleet of websites, all hosted within a single Drupal installation, the "LocalGov Drupal Microsites" module.
  5. Implementing AI solutions for the French government
    This session gives you an insight into how an Artificial Intelligence system can be integrated into a Drupal website and, more broadly, into any digital experience platform.
  6. Drupal LMS: A new, modern, easy-to-use Learning Management System
    Explore the structure of a Learning Management System (LMS), the ongoing work on the project, key structural differences from Opigno and ANU, and opportunities for contributing to its development.
  7. Drupal AI: Once again leading the way with the new golden era of the web - The AI Module and Starshot
    Watch this session to discover how AI is transforming Drupal site building in Starshot and how to utilize the Drupal AI module to create advanced web applications.
  8. Everything you need to know about cookies but are afraid to ask!
    This beginner-level session will help you learn about cookies, their purpose, and emerging alternatives. You will also explore how to optimize user experience, insights, and marketing strategies while maintaining privacy and compliance.
  9. Practical exploitation of Drupal security vulnerabilities
    This session aims to understand the importance of addressing web application vulnerabilities, moving beyond the typical "alert" XSS pop-up scenario. It also covers various approaches for detecting, mitigating, and preventing these vulnerabilities to ensure stronger overall security.
  10. Supply Chain Security in Drupal and Composer
    This session provides a foundational understanding of supply chain security, with a deeper focus on Composer's features and their impact on it. Learn best practices for securing Drupal sites from supply chain attacks and explore how the Drupal Association is developing solutions to safeguard the entire community.

The Ramsalt team at our favorite tapas restaurant.

We hope you enjoy these sessions as much as we did! You can find all of the sessions from DrupalCon Barcelona 2024 on the official YouTube channel of the Drupal Association.

Categories: FLOSS Project Planets

Four Kitchens: From custom to contrib: Rebuilding our Localist module to import event data into Drupal

Planet Drupal - Tue, 2024-10-15 10:38

Marc Berger

Senior Backend Engineer

Always looking for a challenge, Marc tries to add something new to his toolbox for every project and build — be it a new CSS technology, creating custom APIs, or testing out new processes for development.

January 1, 1970

For higher ed institutions and nonprofits, Localist is a powerful resource that provides a valuable means of centralizing your organization’s events into a single branded calendar. However, integrating that event data into a Drupal website in a seamless way can pose a significant challenge.

At Four Kitchens, we recently completed a custom module for a client that can regularly import events from Localist into their higher ed site. After finishing the project, it dawned on us that the Drupal community could benefit from our work. In keeping with our commitment to sharing knowledge with our community, we rebuilt it as a contrib module, so it’s available for your organization, too.

During this rebuild, there were several lessons that we thought were valuable to share to aid other developers who also build custom modules.

Setting functional goals

Before we get into the challenges and lessons we learned, let’s talk about what this module does and how it can help your organization import event data from Localist.

The Localist platform offers an API, but it requires time and development resources to create a custom Drupal module that satisfies your organization’s data requirements. This module simplifies the work needed to import event data from Localist into Drupal by using Drupal’s plugin architecture. Fundamentally, this module uses Drupal’s migration APIs to handle all of the heavy lifting. However, we needed to add custom plugins and functions to handle the Localist API specifically.

Additionally, migrations in Drupal are usually a one-time import — for example, migrating data from an older Drupal 7 site to a newer Drupal 11 site. With event data, importing needs to happen regularly, so this module is designed to import data roughly every hour.

Finally, we decided to build a UI, include optional installable examples (using Drupal’s new Recipes initiative!), and include a code generator that guides a developer to quickly get started building their own event migrations required to import the data.

The information imported from Localist is then stored in fields on a Drupal content type to display however you’d like. If your organization already uses Localist to manage events, you can now display that information in a consistent way on your own website.

Shifting a custom solution to a community contribution

Transforming a client-specific module into a contrib module for the wider Drupal community required extra work, but those efforts are true to our values of sharing knowledge and enabling others to benefit from our research.

Remember the last time you went searching for a module to perform a specific functionality, found it, and installed it? Not only did that experience save you development time, but it also showed the power of the open source community.

Shared modules provide ready-made solutions to common challenges, allowing developers to focus on innovation rather than reinventing the wheel.

Challenges and lessons in developing a community-ready module

When building a custom module, you develop with many assumptions in place because the config and code are already in place for a known environment. When building for the community, you have to consider a multitude of scenarios and edge cases. You have to factor in how the module may be used, how it may interact with other modules, and other unknowns.

Additionally, sometimes there can be some very client-specific requirements that don’t make sense for a contributed module. For the client we originally built this for, we built in special functions to handle the formatting and styling of the event dates. To translate this module into a contrib module, that functionality had to be removed, as we can’t make those same assumptions for everyone. We just want to ensure the baseline functionality is in place so your team can then build off that foundation — ultimately saving you time.

Of course, these modifications work both ways. Your organization may need this type of contrib module, but perhaps its functionality doesn’t align with your website’s requirements. Four Kitchens can work with your organization to tailor the module to your needs. Just let us know how we can help.

Localist contrib module Translating a custom module for broader use

Rebuilding this custom module to a contrib version required extra time, planning, and testing to suit the broader Drupal community’s needs. It ultimately helped us learn that in the future, we may want to flip the script and try to develop a contrib module first, and then override in our own code to customize per client. In this way, the base functionality is available to all.

If you are a developer who creates custom modules, think about the goals of your module and ask yourself if your idea would also benefit the community as a whole. Building a contrib module from the get-go may be far more efficient than taking a custom module and turning it into a contrib module later.

Below, we’ll share some examples of a few changes we made as part of the rebuild of the Localist module and the reasoning behind the change. We hope this helps other developers think outside the box and determine if a contrib module may be a better idea as a starting place.

FunctionalityClient projectContrib modulePreflight and prerequisite checksDid not exist. We assumed all of the config, fields, and taxonomies were in place.We incorporated additional functions to verify that the right connections are in place and that config was correctly set up and working. A green check displays before the user proceeds with any data imports from the Localist database. This is important to make the module future-proof.User interface changesThe settings form only had one field for the API URL and one field for the group. All of the other settings were hard-coded in the codebase, which made things simple to configure for the client, but inflexible for the community.The module now features a visual status area displaying preflight checks. Below, additional fields allow the user to supply custom migrations. The settings page also includes the ability to create an example migration.Structural changesThe location of the settings form was in a custom area, and permissions were integrated with client-specific permissions.The settings form was moved to a standard Drupal location with module-specific permissions added. Additionally, a more robust Drupal service was created to allow some methods to be used outside of this module if needed.Migration examplesNoneSince Drupal migrations can be difficult to understand, we provide an optional installable example to show how the module works to help a developer get started.DocumentationMinimal. The original custom module included just enough to learn about the custom plugins and how to extend the existing built-in migrations.Extensive. Documentation describes in detail how to override and create new migrations, usage of the custom plugins, installation, and troubleshooting.Default configurationAlready in place as part of a client project, so the module assumes the config was there.This module not only gives the default settings when it is installed for some needed processes, but also lets you add more settings for the examples. All of these settings must be different and not conflict with an existing environment.Custom client-only functionalityA lot of custom code was written to support specific use cases for the client’s website.Some of this custom code was removed for the contrib version of this module. Some details, such as formatting dates, satisfy very specific use cases, and generally it is best not to make any assumptions when developing for the community. The value of contributing to the Drupal community

Contributing to the Drupal ecosystem through contributed modules benefits the entire Drupal community. By making our work available to others, we collectively elevate the capabilities of the platform and empower developers worldwide.

While this specific rebuild required a bit of extra time, it fosters a culture of knowledge exchange and mutual support. Each contribution, no matter how small, adds to the platform’s versatility and appeal.\We hope that by sharing our experience of moving a module from custom to contrib, we empower other developers to consider building contrib first to give back to the community, collaborate with others on additional features, build more robust and better documented modules, and hopefully save a little time in the end.

The post From custom to contrib: Rebuilding our Localist module to import event data into Drupal appeared first on Four Kitchens.

Categories: FLOSS Project Planets

Real Python: Using Type Hints for Multiple Return Types in Python

Planet Python - Tue, 2024-10-15 10:00

In Python, type hinting is an optional yet useful feature for making your code easier to read, reason about, and debug. With type hints, you let other developers know the expected data types for variables, function arguments, and return values. As you write code for applications that require greater flexibility, you may need to specify multiple return types to make your code more robust and adaptable to different situations.

You’ll encounter different use cases where you may want to annotate multiple return types within a single function in Python. In other words, the data returned can vary in type. In this video course, you’ll walk through examples of how to specify multiple return types for a function that parses a string from an email address to grab the domain name.

In addition, you’ll see examples of how to specify type hints for callback functions or functions that take another function as input. With these examples, you’ll be ready to express type hints in functional programming.

[ 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

Real Python: Quiz: Getting Started With Async Features in Python

Planet Python - Tue, 2024-10-15 08:00

In this quiz, you’ll test your understanding of Asynchronous Programming in Python.

By working through this quiz, you’ll revisit the concepts of synchronous and asynchronous programs, why you might want to write an asynchronous program, and how to use Python async features.

[ 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

Pages