Feeds

Resolve to have a freer 2025

FSF Blogs - Wed, 2024-12-11 17:00
Categories: FLOSS Project Planets

Python Engineering at Microsoft: Python in Visual Studio Code – December 2024 Release

Planet Python - Wed, 2024-12-11 15:34

We’re excited to announce the December 2024 release of the Python, Pylance and Jupyter extensions for Visual Studio Code!

This release includes the following announcements:

  • Docstring generation features using Pylance and Copilot
  • Python Environments extension in preview
  • Pylance “full” language server mode

If you’re interested, you can check the full list of improvements in our changelogs for the Python, Jupyter and Pylance extensions.

Docstring generation using Pylance and Copilot

A docstring is a string literal that appears right after the definition of a function, method, class, or module used to document the purpose and usage of the code it describes. Docstrings are essential for understanding and maintaining code, as they provide a clear explanation of what the code does, including parameters and return values. Writing docstrings manually can be time-consuming and prone to inconsistencies, however automating this process can ensure your code is well-documented, making it easier for others, and yourself, to understand and maintain. Automated docstring generation can also help enforce documentation standards across your codebase.

How to enable docstring generation

To start, open the Command Palette (Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS)) and select Preferences: Open Settings (JSON).

Add the following Pylance setting to enable support for generating docstring templates automatically within VS Code:

"python.analysis.supportDocstringTemplate": true

Add the following settings to enable generation with AI code actions:

"python.analysis.aiCodeActions": { "generateDocstring": true } Triggering docstring templates
  1. Define Your Function or Method: def my_function(param1: int, param2: str) -> bool: pass
  2. Add an Empty Docstring:
    • Directly below the function definition, add triple quotes for a docstring. def my_function(param1: int, param2: str) -> bool: """""" pass
  3. Place the Cursor Inside the Docstring:
    • Place your cursor between the triple quotes. def my_function(param1: int, param2: str) -> bool: """| # Place cursor here """ pass

When using Pylance, there are different ways you can request that docstrings templates are added to your code.

Using IntelliSense Completion
    • Press Ctrl+Space (Windows/Linux) or Cmd+Space (macOS) to trigger IntelliSense completion suggestions.
Using Code Actions
  1. Open the Context Menu:
    • Right-click inside the docstring or press Ctrl+. (Windows/Linux) or Cmd+. (macOS).
  2. Select Generate Docstring:
    • From the context menu, select Generate Docstring.
    • Pylance will suggest a docstring template based on the function signature.
Using Code Actions to Generate Docstring with Copilot
  1. Select Generate Docstring With Copilot:
    • From the context menu, select Generate Docstring With Copilot.
  2. Accept Suggestions:
    • GitHub Copilot chat will appear. Press Accept to take the suggestions or continue to iterate with Copilot.
Python Environments extension in preview

We’re excited to introduce the new Python Environments extension, now available in preview on the Marketplace.

This extension simplifies Python environment management with an Environments view accessible via the VS Code Activity Bar. Here you can create, delete, and switch between environments, and manage packages within the selected environment. It also uniquely supports specifying environments for specific files or entire Python projects, including multi-root and mono-repo scenarios.

 

By default, the extension uses the venv environment manager and pip package manager to determine how environments and packages are handled. You can customize these defaults by setting python-envs.defaultEnvManager and python-envs.defaultPackageManager to your preferred environment and package managers. Furthermore, if you have uv installed the extension will use it for quick and efficient environment creation and package installation.

Designed to integrate seamlessly with your preferred environment managers via various APIs, it supports Global Python interpreters, venv, and Conda out of the box. Developers can build extensions to add support for their favorite Python environment managers and integrate with our extension UI, enhancing functionality and user experience.

This extension is poised to eventually replace the environment functionality in the main Python extension and will be installed alongside it by default. In the meantime, you can download the Python Environments extensions from the Marketplace and use it in VS Code – Insiders (v1.96 or greater) and with the pre-release version of the Python extension (v2024.23 or greater). We are looking forward to hearing your feedback on improvements by opening issues in the vscode-python-environments repository.

Pylance “full” language server mode

The python.analysis.languageServerMode setting now supports full mode, allowing you to take advantage of the complete range of Pylance’s functionality and the most comprehensive IntelliSense experience. It’s worth noting that this comes at the cost of lower performance, as it can cause Pylance to be resource-intensive, particularly in large codebases.

The python.analysis.languageServerMode setting now changes the default values of the following settings, depending on whether it’s set to light, default or full:

Setting light default full python.analysis.exclude [“**”] [] [] python.analysis.useLibraryCodeForTypes false true true python.analysis.enablePytestSupport false true true python.analysis.indexing false true true python.analysis.autoImportCompletions false false true python.analysis.showOnlyDirectDependenciesInAutoImport false false true python.analysis.packageIndexDepths [ { "name": "sklearn", "depth": 2 }, { "name": "matplotlib", "depth": 2 }, { "name": "scipy", "depth": 2 }, { "name": "django", "depth": 2 }, { "name": "flask", "depth": 2 }, { "name": "fastapi", "depth": 2 } ] | [ { "name": "sklearn", "depth": 2 }, { "name": "matplotlib", "depth": 2 }, { "name": "scipy", "depth": 2 }, { "name": "django", "depth": 2 }, { "name": "flask", "depth": 2 }, { "name": "fastapi", "depth": 2 } ] | { "name": "", "depth": 4, "includeAllSymbols": true } python.analysis.regenerateStdLibIndices false false true python.analysis.userFileIndexingLimit 2000 2000 -1 python.analysis.includeAliasesFromUserFiles false false true python.analysis.functionReturnTypes false false true python.analysis.pytestParameters false false true python.analysis.supportRestructuredText false false true python.analysis.supportDocstringTemplate false false true Other Changes and Enhancements

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:

  • The testing rewrite nearing default status: This release addresses the final known issue in the testing rewrite, and we plan to turn off the rewrite experiment and set it to the default in early 2025
  • Python Native REPL handles window reload in @vscode-python#24021
  • Leave focus on editor after Smart Send to Native REPL in @vscode-python#23843
  • Add error communication around dynamic adapter activation in @vscode-python#23234
  • Pytest --rootdir argument for pytest is now dynamically adjusted based on the presence of a python.testing.cwd setting in your workspace in @vscode-python#9553
  • Add support for interpreter paths with spaces in the debugger extension in @vscode-python-debugger#233
  • pytest-describe plugin is supported with test detection and execution in the UI in @vscode-python#21705
  • Test coverage support updated to handle NoSource exceptions in @vscode-python#24366
  • Restarting a test debugging session now reruns only the specified tests in @vscode-python-debugger#338
  • The testing rewrite now leverages FIFO instead of UDS for inter-process communication allowing users to harness pytest plugins like pytest_socket in their own testing design in @vscode-python#23279

We would also like to extend special thanks to this month’s contributors:

Try out these new improvements by downloading the Python extension and the Jupyter extension from the Marketplace, or install them directly from the extensions view in Visual Studio Code (Ctrl + Shift + X or ⌘ + ⇧ + X). You can learn more about Python support in Visual Studio Code in the documentation. If you run into any problems or have suggestions, please file an issue on the Python VS Code GitHub page.

The post Python in Visual Studio Code – December 2024 Release appeared first on Python.

Categories: FLOSS Project Planets

Freelock Blog: Cache-bust pages containing embedded content

Planet Drupal - Wed, 2024-12-11 10:00
Cache-bust pages containing embedded content Anonymous (not verified) Wed, 12/11/2024 - 07:00 Tags Development Automation ECA Drupal Drupal Planet

The saying goes, there are two hard problems in computer science: caching, naming things, and off-by-1 errors. While Drupal certainly has not solved the naming things, it has made a valiant attempt at a decent caching strategy. And for the most part it works great, allowing millions of lines of code to load up quickly the vast majority of the time.

This is more a tip about our favorite automation tool, the Events, Conditions, and Actions (ECA) module, and how it can get you out of a bind when Drupal caching goes too far.

Categories: FLOSS Project Planets

The Drop Times: Jay Callicot on DrupalX, Decoupled Architectures, and the Future of Drupal Development

Planet Drupal - Wed, 2024-12-11 09:30
Jay Callicot, Senior Drupal Architect at Promet Source, speaks with Alka Elizabeth from The DropTimes about his journey with Drupal, the development of DrupalX, and the future of enterprise web development. From decoupled architectures to AI-driven workflows, Callicot outlines how modern tools like Next.js, Storybook, and Tailwind CSS are shaping Drupal's evolution.
Categories: FLOSS Project Planets

Divine Attah-Ohiemi: From Sisterly Wisdom to Debian Dreams: My Outreachy Journey

Planet Debian - Wed, 2024-12-11 09:25

Discovering Open Source: How I Got Introduced
Hey there! I’m Divine Attah-Ohiemi, a sophomore studying Computer Science. My journey into the world of open source was anything but grand. It all started with a simple question to my sister: “How do people get jobs without experience?” Her answer? Open source! I dove into this vibrant community, and it felt like discovering a hidden treasure chest filled with knowledge and opportunities.

Choosing Debian: Why This Community?
Why Debian, you ask? Well, I applied to Outreachy twice, and both times, I chose Debian. It’s not just my first operating system; it feels like home. The Debian community is incredibly welcoming, like a big family gathering where everyone supports each other. Whether I was updating my distro or poring over documentation, the care and consideration in this community were palpable. It reminded me of the warmth of homeschooling with relatives. Plus, knowing that Debian's name comes from its creator Ian and his wife Debra adds a personal touch that makes me feel even more honored to contribute to making the website better!

Why I Applied to Outreachy: What Inspired Me
Outreachy is my golden ticket to the open source world! As a 19-year-old, I see this internship as a unique opportunity to gain invaluable experience while contributing to something meaningful. It’s the perfect platform for me to learn, grow, and connect with like-minded individuals who share my passion for technology and community.

I’m excited for this journey and can’t wait to see where it takes me! 🌟

Categories: FLOSS Project Planets

Consensus Enterprises: make targets, Droplets, and Aegir, oh my!

Planet Drupal - Wed, 2024-12-11 09:00
<p>We&rsquo;ve done it! Over the last 6 posts, we&rsquo;ve reviewed in detail all the major components of our simplified Infrastructure-as-Code (IaC) setup, and we&rsquo;re ready to pull it all together to spin up an Aegir3 instance.</p> <p>With the pieces we have covered so far, we can run the following to get up the point of actually installing Aegir:</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">pipenv shell <span style="color:#75715e"># Activate venv</span> source d <span style="color:#75715e"># Bootstrap Drumkit</span> make tools <span style="color:#75715e"># Install Ansible and Galaxy dependencies</span> make infra <span style="color:#75715e"># Run playbooks/infra/00-up.yml</span> </code></pre></div><p>This will get us a Project, a VPC, and a Firewall at DigitalOcean, configured with the names and settings we&rsquo;ve described in our previous posts. To get from here to a working Aegir, all we need is a host Droplet, standard LEMP stack dependencies, and then Aegir itself.</p> <h3 id="aegir0-host">Aegir0 (host)</h3> <p>First of all, let&rsquo;s use our <code>consensus.infra.droplet</code> role to create our host Droplet, and wrap a <a href="https://gitlab.com/consensus.enterprises/ansible/templates/example-aegir3-infrastructure/-/blog/main/drumkit/mk.d/30_aegir.mk#L3"><code>make aegir-droplet</code> target</a> to run the playbook <a href="https://gitlab.com/consensus.enterprises/ansible/templates/example-aegir3-infrastructure/-/blog/main/playbooks/hosts/aegir0.yml">playbooks/hosts/aegir0.yml</a>:</p> <pre><code>--- - name: aegir Droplet hosts: localhost gather_facts: true vars: droplet_hostname: aegir0 droplet_domain: cloudcity.dev droplet_project: &quot;{{ do_project_name }}&quot; droplet_firewall: &quot;{{ web_droplet_firewall }}&quot; droplet_tags: [&quot;web&quot;, &quot;aegir&quot;] droplet_size: &quot;s-2vcpu-2gb&quot; droplet_vpc: &quot;{{ do_vpc_name }}&quot; outgoing_email_password: &quot;{{ vaulted_outgoing_smtp_password }}&quot; outgoing_email_default: &quot;{{ org_technical_contact_email }}&quot; oauth_token: &quot;{{ vault_do_api_token }}&quot; gandi_token: &quot;{{ vaulted_gandi_access_token }}&quot; roles: - consensus.infra.droplet </code></pre><p>As discussed previously, the Droplet-specific vars are embedded directly in the playbook here, because we don&rsquo;t have a manifest or other registry to logically place these. This playbook (and others in <code>playbooks/hosts</code>) become the de facto manifest for the project.</p> <h3 id="aegir3">Aegir3</h3> <p>Now that we have a host, we can target it with a <a href="https://gitlab.com/consensus.enterprises/ansible/templates/example-aegir3-infrastructure/-/blog/main/playbooks/apps/aegir.yml">playbooks/apps/aegir.yml</a> playbook to call our <code>consensus.aegir.aegir</code> role, and introduce our <a href="https://gitlab.com/consensus.enterprises/ansible/templates/example-aegir3-infrastructure/-/blob/main/drumkit/mk.d/30_aegir.mk#L6"><code>make aegir-app</code> target</a>.</p> <p>This playbook has some conditional checks before and after to ensure everything works correctly, but ultimately boils down to this:</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">--- - <span style="color:#66d9ef">name</span>: <span style="color:#e6db74">&#34;End-to-end Aegir 3 build from git source.&#34;</span> <span style="color:#66d9ef">hosts</span>: aegir <span style="color:#66d9ef">gather_facts</span>: <span style="color:#66d9ef">true</span> <span style="color:#66d9ef">roles</span>: - <span style="color:#66d9ef">role</span>: geerlingguy.mysql <span style="color:#66d9ef">become</span>: True - <span style="color:#66d9ef">role</span>: geerlingguy.nginx <span style="color:#66d9ef">become</span>: True - <span style="color:#66d9ef">role</span>: geerlingguy.php-versions <span style="color:#66d9ef">become</span>: True - <span style="color:#66d9ef">role</span>: geerlingguy.php <span style="color:#66d9ef">become</span>: True - <span style="color:#66d9ef">role</span>: geerlingguy.composer <span style="color:#66d9ef">become</span>: True - <span style="color:#66d9ef">role</span>: consensus.aegir.aegir <span style="color:#66d9ef">become</span>: True </code></pre></div><p>We simply run a series of roles in sequence, building up the stack of software to support Aegir, and then finally Aegir itself.</p> <h3 id="make-aegir">make aegir</h3> <p>Tying the two previous playbooks together, we can implement a <code>make aegir</code> target simply:</p> <pre><code>aegir: aegir-droplet aegir-app aegir-droplet: ansible-playbook playbooks/hosts/aegir0.yml aegir-app: ansible-playbook playbooks/apps/aegir.yml </code></pre><p>Added to the steps at the top of this post, this new target will complete the provisioning of an Aegir3 instance at DigitalOcean.</p> <p>Note that <a href="https://gitlab.com/consensus.enterprises/ansible/templates/example-aegir3-infrastructure/-/blob/main/drumkit/mk.d/30_aegir.mk">drumkit/mk.d/30_aegir.mk</a> also has &ldquo;down&rdquo; variants of these targets as well:</p> <ul> <li><code>make aegir-down</code> - deregister from Tailscale and destroy the Droplet</li> <li><code>make aegir-ts-down</code> - only deregister from Tailscale (do not destroy Droplet)</li> <li><code>make aegir-droplet-down</code> - only destroy the Droplet (in case Tailscale is already offline)</li> </ul> <p>A note about SSL: you will note that the playbooks and roles involved here <em>DO NOT</em> provision SSL certificates of any kind for the Aegir instance. I&rsquo;ve left this piece out here for two reasons:</p> <ol> <li>There are many ways to achieve this, and we don&rsquo;t need it for our purposes</li> <li>Even with SSL, your Aegir3 instance shouldn&rsquo;t be exposed to the public internet anyway, since it&rsquo;s based on Drupal 7.</li> </ol> <p><strong>NB</strong> Please take care to properly secure your Aegir3 instance, as running Drupal 7 which is EOL! This could be by adding firewall rules, or reconfiguring your Nginx virtualhost to listen on your Tailscale interface, or similar.</p> <p>Also, if you&rsquo;re not aware, <a href="https://docs.aegir.hosting">Aegir5</a> is our effort to modernize Aegir based on modern Drupal with an Ansible-driven backend. This will be a secure replacement for Aegir, but since it&rsquo;s not production-ready yet, we&rsquo;re using Aegir3 as a stopgap for the time being.</p> <h3 id="simplicity-unlocked">Simplicity unlocked</h3> <p>Over the years, we at Consensus have wrangled with a lot of <em>necessary</em> complexity. The <a href="/blog/computed-token-field-intro">nature</a> of the <a href="/blog/tuf_for_humans/">problems</a> we tend to help our clients solve often means it&rsquo;s <a href="https://github.com/consensus-enterprises/taps/blob/scalability-tap/tap21.md">unavoidable</a>. In that context it&rsquo;s especially useful to stay focused on keeping things as simple as possible, ensuring we don&rsquo;t make things worse by piling extra complexity on top of the inevitable stuff.</p> <p>The process of simplifying our internal infrastructure has been a great example of radical simplification. We&rsquo;ve already seen a reduction in costs, both financial and operational. Our infrastructure team is reinvigorated by the ease of interacting with our new suite of servers, inspired to use and extend them.</p> <p>To review:</p> <ul> <li>We dropped Terraform, which is a great tool but represented unnecessary complexity in our context.</li> <li>We replaced a custom-built Wireguard server with Tailscale.</li> <li>We split our DEV and PROD environments into distinct repositories.</li> <li>We published key components of the solution to share between DEV and PROD.</li> <li>We built up a simple codebase structure to house infrastructure, host, and application playbooks.</li> <li>We used Drumkit to provide easy target commands to accomplish key workflow tasks.</li> </ul> <p>I hope this series has illustrated our approach and how it all fits together. If you are interested in exploring further, feel free to use our <a href="take://gitlab.com/consensus.enterprises/ansible/templates/example-aegir3-infrastructure">example repository</a> as a base. We&rsquo;ve left some <a href="https://gitlab.com/consensus.enterprises/ansible/templates/example-aegir3-infrastructure#usage">detailed usage notes</a> in the README with details on how to adapt it for your own use.</p> <p>If you do try something like this yourself, or you just have questions or comments, don&rsquo;t hesitate to <a href="/#contact">get in touch</a>.</p> <h3 id="aegir5">Aegir5</h3> <p>For those in the Drupal community familiar with the Aegir project, I will say again: the use of Aegir3 here is a stopgap until we can get Aegir5 ready to replace it. In the meantime, we&rsquo;re very pleased to have worked out a path for existing Aegir3 installations to support Drupal 8 through 11. Stay tuned for upcoming details on this as well as new developments with Aegir5!</p>
Categories: FLOSS Project Planets

Real Python: Python Set Comprehensions: How and When to Use Them

Planet Python - Wed, 2024-12-11 09:00

Python set comprehensions provide a concise way to create and manipulate sets in your code. They generate sets with a clean syntax, making your code more readable and Pythonic. With set comprehensions, you can create, transform, and filter sets, which are great skills to add to your Python programming toolkit.

In this tutorial, you’ll learn the syntax and use cases of set comprehensions, ensuring you can decide when and how to use them in your code. Understanding set comprehensions will help you write cleaner, more efficient Python code.

By the end of this tutorial, you’ll understand that:

  • Python has set comprehensions, which allow you to create sets with a concise syntax.
  • Python has four types of comprehensions: list, set, dictionary, and generator expressions.
  • A set comprehension can be written as {expression for item in iterable [if condition]}.
  • Sets can’t contain duplicates, as they ensure that all their elements are unique.

To get the most out of this tutorial, you should be familiar with basic Python concepts such as for loops, iterables, list comprehensions, and dictionary comprehensions.

Get Your Code: Click here to download the free sample code that you’ll use to learn about Python set comprehensions.

Take the Quiz: Test your knowledge with our interactive “Python Set Comprehensions: How and When to Use Them” quiz. You’ll receive a score upon completion to help you track your learning progress:

Interactive Quiz

Python Set Comprehensions: How and When to Use Them

In this quiz, you'll test your understanding of Python set comprehensions. Set comprehensions are a concise and quick way to create, transform, and filter sets in Python. They can significantly enhance your code's conciseness and readability compared to using regular for loops to process your sets.

Creating and Transforming Sets in Python

In Python programming, you may need to create, populate, and transform sets. To do this, you can use set literals, the set() constructor, and for loops. In the following sections, you’ll take a quick look at how to use these tools. You’ll also learn about set comprehensions, which are a powerful way to manipulate sets in Python.

Creating Sets With Literals and set()

To create new sets, you can use literals. A set literal is a series of elements enclosed in curly braces. The syntax of a set literal is shown below:

Python Syntax {element_1, element_2,..., element_N} Copied!

The elements must be hashable objects. The objects in the literal might be duplicated, but only one instance will be stored in the resulting set. Sets don’t allow duplicate elements. Here’s a quick example of a set:

Python >>> colors = {"blue", "red", "green", "orange", "green"} >>> colors {'red', 'green', 'orange', 'blue'} >>> colors.add("purple") >>> colors {'red', 'green', 'orange', 'purple', 'blue'} Copied!

In this example, you create a set containing color names. The elements in your resulting set are unique string objects. You can add new elements using the .add() method. Remember that sets are unordered collections, so the order of elements in the resulting set won’t match the insertion order in most cases.

Note: To learn more about sets, check out the Sets in Python tutorial.

You can also create a new set using the set() constructor and an iterable of objects:

Python >>> numbers = [2, 2, 1, 4, 2, 3] >>> set(numbers) {1, 2, 3, 4} Copied!

In this example, you create a new set using set() with a list of numeric values. Note how the resulting set doesn’t contain duplicate elements. In practice, the set() constructor is a great tool for eliminating duplicate values in iterables.

To create an empty set, you use the set() constructor without arguments:

Python >>> set() set() Copied!

You can’t create an empty set with a literal because a pair of curly braces {} represents an empty dictionary, not a set. To create an empty set, you must use the set() constructor.

Using for Loops to Populate Sets

Sometimes, you need to start with an empty set and populate it with elements dynamically. To do this, you can use a for loop. For example, say that you want to create a set of unique words from a text. Here’s how to do this with a loop:

Python >>> unique_words = set() >>> text = """ ... Beautiful is better than ugly ... Explicit is better than implicit ... Simple is better than complex ... Complex is better than complicated ... """.lower() >>> for word in text.split(): ... unique_words.add(word) ... >>> unique_words { 'beautiful', 'ugly', 'better', 'implicit', 'complicated', 'than', 'explicit', 'is', 'complex', 'simple' } Copied! Read the full article at https://realpython.com/python-set-comprehension/ »

[ 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

ClearlyDefined: 2024 in review – milestones, growth and community impact

Open Source Initiative - Wed, 2024-12-11 08:25

As 2024 draws to a close, it’s time to reflect on a transformative year for the ClearlyDefined project. From technical advancements to community growth, this year has been nothing short of extraordinary. Here’s a recap of our key milestones and how we’ve continued to bring clarity to the Open Source ecosystem.

ClearlyDefined 2.0: expanding license coverage

This year, we launched ClearlyDefined v2.0, a major milestone in improving license data quality. By integrating support for LicenseRefs, we expanded beyond the SPDX License List, enabling organizations to navigate complex licensing scenarios with ease. Thanks to contributions from the community and leadership from GitHub and SAP, this release brought over 2,000 new licenses into scope. Dive into the details here.

New harvester for Conda packages

In response to the growing needs of the data science and machine learning communities, we introduced a new harvester for Conda packages. This implementation ensures comprehensive metadata coverage for one of the most popular package managers. Kudos to Basit Ayantunde and our collaborators for making this a reality. Learn more about this update here.

Integration with GUAC for supply chain transparency

Our partnership with GUAC (Graph for Understanding Artifact Composition) from OpenSSF took supply chain observability to new heights. By integrating ClearlyDefined’s license metadata, GUAC users now have access to enriched data for compliance and security. This collaboration underscores the importance of a unified Open Source supply chain. Read about the integration here.

Community growth and governance

In 2024, we took significant steps toward a more open governance model by electing leaders to the Steering and Outreach Committees. These committees are pivotal in driving technical direction and expanding community engagement. Meet our new leaders here.

Showcasing ClearlyDefined globally

We showcased ClearlyDefined’s mission and impact across three continents:

  • At FOSS Backstage and ORT Community Days in Berlin, we connected with industry leaders to discuss best practices for software compliance.
  • At SOSS Fusion 2024 in Atlanta, we presented our collaborative approach to license compliance alongside GitHub and SAP.
  • At Open Compliance Summit in Tokyo, we showcased how Bloomberg leverages ClearlyDefined in order to detect and manage Open Source licenses.

Each event reinforced the global importance of a transparent Open Source ecosystem. Explore our conference highlights here and here.

A Revamped Online Presence

To welcome new contributors and support existing ones, we unveiled a new website featuring comprehensive documentation and resources. Whether you’re exploring our guides, engaging in forums, or diving into the project roadmap, the platform is designed to foster collaboration. Take a tour here.

Looking ahead to 2025

As we celebrate these achievements, we’re already planning for an even more impactful 2025. From enhancing our tools to expanding our community, the future of ClearlyDefined looks brighter than ever.

Thank you to everyone who contributed to our success this year. A special thank you to Microsoft for hosting and curating ClearlyDefined, GitHub and SAP for their technical leadership, and Bloomberg and Cisco for their sponsorship. Your dedication ensures that Open Source continues to thrive with clarity and confidence.

Categories: FLOSS Research

Tag1 Consulting: Migrating Your Data from D7 to D10: User and taxonomy term migrations

Planet Drupal - Wed, 2024-12-11 08:20

In this follow-up to migrating files, we focus on migrating users and taxonomy terms. Key topics include preventing entity ID conflicts, handling watermarks, and decoupling content migrations from configuration migrations. We’ll also create migration scripts for both entities and explore stylistic tips for cleaner, more compact migration files.

mauricio Wed, 12/11/2024 - 05:20
Categories: FLOSS Project Planets

LostCarPark Drupal Blog: Drupal Advent Calendar day 11 - Event Track

Planet Drupal - Wed, 2024-12-11 04:00
Drupal Advent Calendar day 11 - Event Track james Wed, 12/11/2024 - 09:00

It’s time to open another door of the Drupal Advent Calendar! Behind today’s door we find the Events track of Drupal CMS, and we hand over to track lead Martin Anderson-Clutz to tell us some more about it.

Managing dates and times is a common need for Drupal sites, and the Drupal CMS Events recipe aims to make this easier than ever. To be clear, the intended use case is a site that posts multiple, short events. Events like Drupalcamps that comprise sessions, a schedule, and more should look at the Drupal Event Platform instead.

A Drupal CMS site showing DrupalCon Singapore as an event listing

A Smart Date field provides an intuitive way to enter dates and…

Tags
Categories: FLOSS Project Planets

Django Weblog: Django 6.x Steering Council Candidates

Planet Python - Tue, 2024-12-10 21:00

Thank you to the 12 individuals who have chosen to stand for election. This page contains their candidate statements submitted as part of the Django 6.x Steering Council elections.

To our departing Steering Council members, Adam Johnson, Andrew Godwin, James Bennett, Simon Charette – thank you for your contributions to Django and its governance ❤️.

Those eligible to vote in this election will receive information on how to vote shortly. Please check for an email with the subject line “Django 6.x Steering Council Voting”. Voting will be open until 23:59 on December 17, 2024 Anywhere on Earth.

Any questions? Reach out via email to foundation@djangoproject.com.

All candidate statements

To make it simpler to review all statements, here they are as a list of links. Voters: please take a moment to read all statements before voting!

  1. Andrew Miller (he/him) — Cambridge, UK
  2. Carlton Gibson (he/him) — Spain
  3. Emma Delescolle (she/her) — Belgium
  4. Frank Wiles (he/him) — Lawrence, Kansas, USA
  5. Jake Howard (he/him) — UK
  6. Lily Foote (she/her) — United Kingdom
  7. Mark Walker — Chester, UK
  8. Ryan Cheley (he/him) — California, US
  9. Ryan Hiebert
  10. Sage Abdullah (he/him) — Jakarta, Indonesia / Bristol, UK
  11. Tim Graham — Philadelphia, PA USA
  12. Tim Schilling (he/him) — United States
Andrew Miller (he/him) Cambridge, UK View personal statement

Hi there, for those that haven’t come across me yet, I’m very active on the Discord, joining a couple of years ago, I serve as a moderator and generally helping out. I have also authored a Working Group proposal that is almost ready to go live, pending Board approval. Finally I organise the monthly Django Social in Cambridge.

However perhaps what is most relevant to my nomination for the Steering Council are the blog posts I have written this year. They have been short & snappy where I have prodded and explained different aspects of using Django, the contributing process and other aspects of the community.

I am nominating myself for the Steering Council to ensure that Django has a secure future. Personally I have used Django for the last 12 years and it has been integral to my software engineering career. The last two and half years have been the best in terms of getting involved in the community and has increased my passion for improving Django itself and seeing it have a future beyond my personal usage.

While there is energy in the community, the technical vision has stagnated and needs a reboot. As Django is about to celebrate it’s 20th birthday, I want to see Django celebrate it’s 30th & 40th birthday’s and still be relevant to the world of web development. But what does that mean for us now as a community and how to do we ensure that future? In short I believe the next Steering Council needs to experiment with a range of ideas and gauge the community reaction to them. These ideas will form the first iteration of processes that future Steering Council’s can progress and mature.

To me these ideas need to focus on the following high level goals:

  • Transparency & Consistency of communication
  • Clearer, simpler Governance
  • Vision of where Django could be in 10 or 20 years from now.
  • Strengthening the community through teams that provides growth for each and every member

Each of these goals have plenty of actionable items… for example:

  • Communication: Coordinate with the Board to recognise the work of the wider ecosystem of packages on the website and in other resources.
  • Governance: Deeply examine the DEP process, simplify it where needed so we can normalise the process of writing a DEP to be closer to Forum post.
  • Vision: Identify potential landmark features for the 6.X release cycle and beyond. Even propose what features might be in the Django 11.X cycle (10 years time).
  • Teams: Start to create career tracks within the community, this would include Djangonaut space, Google Summer of Code, existing teams and new teams yet to be formed.

Do I expect this next Steering Council to achieve all of these goals above in one go? While these goals are idealistic, I expect this next Council to lay the foundations for futures Council’s to thrive and creating the on-ramps for a larger vibrant community of Djangonauts, ensuring the Django’s future is bright and secure.

Feel free to reach out to me if you have further questions about anything above.

Carlton Gibson (he/him) Spain View personal statement

I'm running for the Steering Council to help push Django forward over the 6.x release cycle.

We’re at an exciting time for the framework. There’s a whole fresh wave of new contributors keen to experiment. I think we should lean into that. My particular interest here is in helping to support, promote, and leverage the third party ecosystem better that we have done. I wrote at some length on that in my recent Thoughts on Django’s Core, if you’d like the details.

Beyond that, I want to help our mentoring effort. There’s a big gap between starting to contribute and staying to maintain. We’ve got all the resources we need to turn the new generation of Django’s contributors into its next generation of maintainers. That’s where I increasingly see my time and focus being spent over the coming years.

I was unsure whether to run for election or not. Whilst I was never part of the old Django Core, as a former Fellow, and maintainer of packages such DRF, django-filter, and crispy forms, I’m certainly towards the older-guard side of things, that we’ve heard much about in recent posts. We’re at a delicate time. With the governance updates needed, I feel that I still have lots to offer, and can be helpful in advancing those. As I say, I think we’re at an exciting time for the framework. I’d be honoured to serve if chosen.

Emma Delescolle (she/her) Belgium View personal statement

For a longer version of this statement you can read this post on my blog

For a video on similar topics, you can watch my recent Djangonaut Space session on YouTube

As a member of the Django community for the past 10 years, I've had the privilege of witnessing firsthand the project's growth and evolution.

Over the decade, I've seen many exciting changes and improvements that have shaped Django into the powerful tool it is today. However, I've also noticed a gradual slowing down of this evolution in recent years.

I have also benefited from said growth and Django's reliability and stability as I have been running a business who's main activity revolves around Django for that same amount of years. Whether it be creating, reviewing, maintaining or updating software. My application to the steering council is one of the ways in which I can give back to the community.

With my candidacy as a member of the Django Steering Council, I want to highlight my focus on ensuring Django remains relevant and sustainable for the next 20 years.

Lowering the barrier to contribution and involving a more diverse set of contributors

Most code contributions merged into Django are bug fixes or cleanups. I believe this trend is not due to an unusual abundance of bugs within the project but rather due to an unsustainable barrier to contributing new features or code improvements. Contributing to Django requires a significant amount of time, mental energy and effort, which can be discouraging to most. And often, those who have bit the bullet and gone through it once do not go through it a second or third time.

Myself and others have noted, more or less recently, that the process of contributing code to Django, including but not limited to DEPs, is daunting. The words "brutal" and "bureaucratic" have been used by myself and others to describe the process.

If elected, I aim to identify areas that hinder effective code contributions to Django and work towards simplifying the process of contributing code to the project; while keeping the right balance to also protect the time, energy and sanity of the Fellows and the review team.

Dealing with the realities of an aging code-base

As Django approaches its 20th anniversary, it's essential to acknowledge the aging code-base and technical debt accumulated over time. My goal is to initiate a review process of the existing code-base, carefully evaluating technical debt and identifying areas where improvements can be made without disrupting existing functionality.

Missing batteries and deadlines

One of the core principles of Django has always been its commitment to being a "batteries included" framework. However, in recent years, I've noticed that many of these essential features and tools have remained stagnant, without new additions or replacements emerging to support the evolving needs of our community.

Furthermore, the third-party application ecosystem that was once thriving and a jewel of the community, has become harder and harder to navigate and discover. It has also become more time-consuming for developers to have to evaluate a large set of third-party applications to solve a specific need.

As a member of the steering council I would like to work on bringing better visibility and discoverability of those 3rd-party packages and evaluate whether any such package should be brought into Django, either Django core or a spiritual successor to contrib or some other way. Some packages that come to mind are django-csp, django-cors and django-upgrade but this is in no way an exhaustive list.

Feature requests and Roadmap

I plan to use my position to champion "feature requests" – a critical aspect of the council's role that has never been utilized to this date. Feature requests being also a key part in being able to set a roadmap for Django and provide guidance to potential contributors on where to get started on their journey.

Code ownership and groups

My belief is that, as an unexpected side-effect of the dissolution of the core team and the high barrier to contribution, expertise in specific areas of Django has begun to erode. However, it can be regained through targeted efforts. People involved in the aforementioned code review process would be perfect candidates for these roles, as they'd already have taken a deep dive in thoroughly understanding specific areas of the framework.

Moreover, frequent contributors to an area of the framework are often well-positioned to take on a leading role in "owning" that part of the project. However, this implies recurring contributions to said area. I believe that we need to find ways to incentivize people to become area specialists. Which brings us back to need for lowering the barrier to contribution.

More generally, I think that the project can benefit from those specialized groups, starting with an ORM group.

Closing thoughts

I believe that everything listed here can technically be achieved during the 6.x cycle if I'm elected but... things take time in the Django world. So, I don't want to over-promise either.

Frank Wiles (he/him) Lawrence, Kansas, USA View personal statement

The community does a really great job of reaching consensus post-BDFLs but occasionally decisions do need to be made and a direction chosen.

I would like to think my long history with Django and my wide and varied use of it as a consultant gives me a unique perspective not just as a consumer of Django but as a manager/executive helping others to make decisions around how and when to use Django. The decisions that are made impact many people and organizations in sometimes subtle and non-obviously ways. I have a ton of skin in this particular game personally.

Django has been a huge part of what has driven my career and I would be honored to help steer for a bit.

Jake Howard (he/him) UK View personal statement

For those who don't know me, I've been using Django professionally for almost a decade, spending over half of that focusing on performance and security. I'm also on the Core team for Wagtail CMS.

Django has a great reputation for being "batteries included" and for "perfectionists", however that reputation is starting to age. Now, people think of Django and clunky, slow, and only useful for building big monoliths. Many developers choose leaner frameworks, and end up having to re-implement Django's batteries themselves, instead of starting with Django and focusing on building their application.

For Django to progress, it needs to recharge its batteries. The ticket backlog, as well as many developer's dreams are filled with great feature ideas just looking for a little push in the right direction. Not just the big features like 2FA, Background Tasks or even type hints, but also quality of life improvements to templates, views or even the user model. To achieve this, it requires more than just code - it takes people.

From personal experience, I've seen the friction from trying to add even small features to Django, and the mountains to climb to contribute large features. To encourage new contributors, that needs to change - just because it's the way it's always been, doesn't mean it has to continue. Django is a big, complex, highly depended on project, but that doesn't mean it needs to move at a snail's pace for everything, nor does every contribution need to be 100% perfect first time. Open source projects are built on passion, which is built up over time but destroyed in seconds. By fostering and enabling that passion, the Django contributor community can flourish.

By the time Django hits 7.0, I'd love to see it more modern, more sustainable, and living up to the ideas we all have for it.

Lily Foote (she/her) United Kingdom View personal statement

Hi! I'm Lily and I've been a contributor to Django for about a decade, mainly working on the ORM. My biggest contributions were adding check constraints and db_default. I've also contributed as a mentor within the Django Community. I was a navigator for the pilot of Djangonaut Space (and a backup navigator in following sessions) and a Google Summer of Code mentor for the Composite Primary Keys project. I also joined the triage and review team in 2023.

As a member of the Steering Council I want to enable more people to contribute to the Django codebase and surrounding projects. I think in recent years there has been too much friction in getting a change to Django agreed. I have seen several forum threads fail to gain consensus and I've experienced this frustration myself too. I also think the DEP process needs an overhaul to make creating a DEP much easier and significantly less intimidating, making it easier to move from a forum discussion to a decision when otherwise the status quo of doing nothing would win.

I believe a more proactive Steering Council will enable more proposals to move forward and I look forward to being a part of this. I will bring my years of experience of the Django codebase and processes to the Steering Council to provide the technical leadership we need.

Mark Walker Chester, UK View personal statement

I'm running for the Steering Council so that I might be able to help others. I wouldn’t be in the position I am today without someone very helpful on StackOverflow many years ago who took the time to help me with my first endeavour with python.

Over the years I’ve strived to help others in their journey with python & django, an aim aided by becoming a navigator for djangonaut space and the technical lead of the Django CMS Association. Through all of this I’ve acted as a facilitator to help people both professionally and in open source, something which ties in with discussions going on about the SC being the facilitator for the continued growth of the Django community and framework itself.

Ryan Cheley (he/him) California, US View personal statement

Hello, I’m Ryan Cheley and I’ve decided to stand for the Django 6.x Steering Council.

My journey with the Django community began in March 2022 when I started contributing pull requests to DjangoPackages. My initial contributions quickly led to deeper involvement, and I was grateful and honored to be asked to be a maintainer following DjangoCon US 2022.

At the DjangoCon US 2022 Sprints, I worked on a SQLite-related bug in Django's ORM. This proved so valuable that I was was able to give a talk about my experience at DjangoCon US 2023, where I delivered my talk “Contributing to Django or How I learned to stop worrying and just try to fix a bug in the ORM”.

Building on this experience, I returned to DCUS 2024 to present on “Error Culture” where I took a deep dive into the widespread but often overlooked issue of how organizations manage error alerts in technology and programming domains.

My commitment to the Django ecosystem extends beyond code contributions. I've served as a Navigator for two sessions of Djangonaut Space, helping guide newcomers through their first contributions to Django. This role has allowed me to give back to the community while developing my mentorship skills.

As one of the admins for Django Commons I work with some amazing folks to help provide an organization that works to improve the maintainer experience.

Additionally, I've made various contributions to Django Core, including both code improvements and documentation enhancements.

Throughout my involvement with Django, I've consistently shown a commitment to both technical excellence and community building. My experience spans coding, documentation, mentorship, and public speaking, reflecting my holistic approach to contributing to the Django ecosystem.

My focus will be in creating sustainable and inclusive leadership structures. This would, in turn, not only provide help and support for current Django leadership, but also develop and empower future leaders.

The avenues to meet these goals include gathering diverse candidates, providing mentorship opportunities, clearly communicating expectations, and removing financial barriers to participation.

As a member of the Django Steering Council (SC) for the 6.x series, I hope to be able to accomplish the following with my fellow SC Members:

  • Establish a governance structure that allows the SC to be successful going forward by:
    • Providing Mentorship for future potential SC members from the Community
    • Reviewing the 18-month requirements for eligibility for SC
    • Communicating the expectations for SC role in Community
    • Working to increase the diversity of those that are willing and able to stand for the SC in the 7.x series and going forward
  • Collaborate with Working Groups to
    • ease burden of fellows in a meaningful way via the Fellowship Working Group
    • work with Social Media Working Group to promote new or upcoming features
  • Write up weekly / monthly reports, similar to the fellows reports
  • Work with the Django Software Foundation(DSF) Board to establish a stipend for 7.x SC members going forward to support their work and allow more diverse participation
  • Implement a road map for Django drawing input and inspiration from the Community, specifically from these sources
  • Adam G Hill post
  • Thibaud Colas Forum post
  • Paolo Melichiore post
  • Timo Zimmerman post
  • Roadmap work from early 2024
  • Work on and complete a DEPs to
    • Remove Dead Batteries, similar to Python PEP 594
    • Determine the long term viability of Trac, research alternatives, and come up with triggers that would lead to a migration if/when necessary.
  • Review and approve or reject all current draft DEPs

The Django community has done so much for me. I’m hoping that with my involvement on the Steering Council I’m able to work to do my part to ensure the long term success and viability of the Django community and leave it in a better place than I found it.

Ryan Hiebert View personal statement

I've worked professionally with Django and Python for the past 13 years. I've mostly lurked on the mailing lists and forums, but I have been around maintaining some smaller projects, most notably among them being django-safemigrate, aldjemy, hirefire, tox-travis, and backports.csv. I had the privilege of giving a talk at DjangoCon 2024 about Passkeys and Django.

Django has excelled in three areas. We take a batteries-included approach that empowers new developers, we have strong community governance, and we are conservative about the changes we make to maintain stability. These have been critical to Django's success, but the combination has made it challenging for Django to keep up with the changing technology landscape.

To allow Django meet the changing needs of our users both now and for the future, we need to think carefully about the important parts of each of those priorities, and tune the tension between them to allow the Django community to thrive.

Django should transition away from including batteries directly, and toward enabling add-on batteries. We should favor proposals that empower interoperability between a variety of third party batteries (e.g. the Background Workers DEP), and disfavor proposals that wish to bless a particular solution in core, no matter how wonderful the solution is (e.g. HTMX).

Django should be encouraging work that aims to expose third-party packages in our official documentation and communication channels, especially those that implement core interoperability interfaces. This will make room for new ideas and more approaches.

Django should seek to make a clear boundary around a smaller core where our preference for stability is the more important factor in empowering our diverse community.

Django should favor changes that bring it into alignment with Python community standards. It should favor this even over the "one way to do it" principle. By encouraging using Python standards, Django will better meet its responsibility as an entryway for new Python developers to be better equipped to grow in Python generally. For example, Django could encourage using appropriate standards in the pyproject.toml over extending Django-centric idioms like adding to the settings.py.

Django should encourage proposals that seek to lower the footprint of a new project. Projects like Nanodjango should inspire us to make starting with Django trivial and minimal, and make each step a newcomer might take to grow be as small as possible, so they only need to meet only the challenges required by the work they are needing to do.

Django should favor proposals to begin to include correct types, even to the point of carefully making any necessary breaking changes to help make the types correct and usable.

The DSF should, when financially feasible, fund non-core batteries that can empower the community. It may be appropriate for the DSF to make some requirements about the necessary governance required of these projects in order to qualify for funding.

The Steering Council should strongly consider recommending changes to its decision making process to make it more feasible to make and reverse decisions as it faces new challenges. Stability is maintained by active, careful, and persistent effort, not indecision.

By making decisions with these principles in mind, we can help our community maintain the root of our goals: A stable community-governed base, empowering a diverse community that excels in the fast-paced world of web development, and being a gateway for new developers.

Sage Abdullah (he/him) Jakarta, Indonesia / Bristol, UK View personal statement

Django's best strength is that it's built by its community – but that's also a weakness. The reality of a project of Django's scale that's been around for so long, and has so many contributors, is that making substantial changes becomes increasingly difficult. You may have heard talks about how daunting it can be to get a PR merged into Django, or how hard it is to get a feature accepted.

It doesn't have to be that way.

In 2019, I added the cross-database JSONField as part of Google Summer of Code (GSoC). Many of Django's big features have come from GSoC, and some of the contributors stay involved in the community – this year, I became a GSoC mentor for Django. As a core team member of Wagtail (a Django-based CMS), I have seen the same pattern with our participations in such outreach programs. Django can do a lot more in making community contributions more accessible and sustainable, and I think I can help.

Here's what I think the steering council should do:

  1. Organize a living roadmap for Django. Rather than waiting for a DEP to be proposed and acted on, the steering council should actively help the community in highlighting issues and feature requests that are high priority or most wanted.
  2. Maximize the potential of mentorship programs. With a roadmap in place, the steering council could help find mentors and contributors who can take on the work. Programs like GSoC, Djangonaut Space, or other initiatives can flourish if we connect the ideas with the right people.
  3. Communicate and document progress. To allow continuous feedback and improvement, the steering council should engage with the community and document the progress of their activities, as well as the current state of Django.

Django is at a turning point. It's time for the steering council to take a more active role with the community in shaping the future of Django, and I believe I can help make that happen.

Tim Graham Philadelphia, PA USA View personal statement

My deep knowledge of Django comes as a user and documentation contributor since 2009, and from working on Django as a Django Fellow from 2014-2019.

Since 2019, I've been contracted to develop and maintain several third-party database backends for Django, including CockroachDB, Google Cloud Spanner, Snowflake, and MongoDB.

I remain active on the Django Internals section of the forum and the Django ticket tracker, as well as writing and reviewing patches for Django.

Tim Schilling (he/him) United States View personal statement

If elected to the Steering Council, I would strive to grow our contributor base and improve the support structures in the community. I'd like to do the work to make everyone else's lives easier.

I expect this to move slowly, but I do expect this to move. The three most important goals to me are the following:

  1. Meet as the Steering Council regularly and post a record of the discussion and actions.

  2. To check in on our various teams and individuals. For example, the Translations team isn't a formal team yet, but it should be.

  3. To encourage and support feature development based on community recommendations.

I will need help with this role in understanding the context and history of technical decisions in Django. The community can support me and others like me by continuing to engage in those technical discussions on the forum. Having folks provide context and clarity will be invaluable.

If elected, I would step down from the DEFNA board and step away as a DjangoCon US organizer. That would leave me being involved with the Steering Council, Djangonaut Space, and Django Commons, all of which overlap in my goal to foster community growth.

I expect there to be technical change in the next term of the Steering Council. However, my particular focus will be on the people. By engaging the community more and encouraging new people, we can strengthen the foundation of our community to support our ambitious goals of the future.

More detailed opinions can be found at: Steering Council 6.x Thoughts · Better Simple.
A list of my involvements can be found at: Tim Schilling · Better Simple

Your move now

That’s it, you’ve read it all 🌈! Be sure to vote if you’re eligible, by using the link shared over email. To support the future of Django, donate to the Django Software Foundation on our website or via GitHub Sponsors.

Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, December 13, starting at 12:00 EST (17:00 UTC)

GNU Planet! - Tue, 2024-12-10 14:55
Join the FSF and friends on Friday, December 13 from 12:00 to 15:00 EST (17:00 to 20:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

PyCoder’s Weekly: Issue #659 (Dec. 10, 2024)

Planet Python - Tue, 2024-12-10 14:30

#659 – DECEMBER 10, 2024
View in Browser »

Handling or Preventing Errors in Python: LBYL vs EAFP

In this video course, you’ll learn about two popular coding styles in Python: look before you leap (LBYL) and easier to ask forgiveness than permission (EAFP). You can use these styles to deal with errors & exceptional situations in your code. You’ll dive into the LBYL vs EAFP discussion in Python.
REAL PYTHON course

Assessing PyPy Performance With π and Prime Numbers

An exploration of PyPy, an alternative Python implementation written in Python, is performed through two computational tasks: estimating π using the Monte Carlo method and calculating prime numbers with the Sieve of Eratosthenes.
CRISTIANOPIZZAMIGLIO.COM • Shared by Cristiano Pizzamglio

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

Posit Connect Cloud allows users to publish, host, and manage interactive apps, dashboards, Python models, APIs, and more. It offers a centralized, self-service platform for sharing Python-based data science. Amplify your impact by streamlining deployment and fostering sharing and collaboration →
POSIT sponsor

Building a Chat Backend for Wikipedia Articles in Django

This step-by-step article covers how to build a scalable chat backend using Django, Wikipedia data, OpenAI embeddings, and FAISS.
YANN MALET

PyCon US 2025 (Pittsburgh, PA) Registration Open

PYCON.BLOGSPOT.COM

Django Security Releases Issued: 5.1.4, 5.0.10, and 4.2.17

DJANGO SOFTWARE FOUNDATION

Python 3.13.1, 3.12.8, 3.11.11, 3.10.16 and 3.9.21 Released

CPYTHON DEV BLOG

PyCon Austria 2025 (Eisenstadt) Call for Papers

PAPERCALL.IO

Quiz: Expression vs Statement in Python

REAL PYTHON

Articles & Tutorials Expression vs Statement in Python: What’s the Difference?

In this tutorial, you’ll explore the differences between an expression and a statement in Python. You’ll learn how expressions evaluate to values, while statements can cause side effects. You’ll also explore the gray areas between them, which will enhance your Python programming skills.
REAL PYTHON

Transferring Python Build Standalone Stewardship to Astral

Gregory is the maintainer of the Python Standalone Builds project but due to changes in his life doesn’t have as much time to contribute. The folks at Astral have offered to take the project on. This note explains why.
GREGORY SZORC

Python Developers: Scrape Any Website Without Getting Blocked

ZenRows handles all anti-bot bypass for you, from rotating proxies and headless browsers to CAPTCHAs and AI. Get a complete web scraping toolkit to extract all the data you need with a single API call. Try ZenRows now for free →
ZENROWS sponsor

New Era of Slop Security Reports for Open Source

Seth is the go-to security guy at Python and other open source projects. He, and others, have noticed an increase in automatically generated security reports which are often wrong. This post talks about what is going on and what you can do it if you maintain your own repository.
SETH LARSON

PEP 767: Annotating Read-Only Attributes

PEP 705 introduced the typing.ReadOnly type qualifier to allow defining read-only typing.TypedDict items. This PEP proposes using ReadOnly in annotations of class and protocol attributes, as a single concise way to mark them read-only.
PYTHON.ORG

PyData NYC 2024 Talks Available

This is a list of the talks from PyData NYC 2024. Topics include “Explaining Machine Learning Models with LLMS”, ” Using NASA EarthData Cloud & Python to Model Climate Risks”, “Unlocking the Power of Hybrid Search”, and more.
YOUTUBE.COM video

PEP 766: Explicit Priority Choices Among Multiple Indexes

“Package resolution is a key part of the Python user experience as the means of extending Python’s core functionality.” This PEP covers how package indexes should be merged as a spec for package management tools.
PYTHON.ORG

Testing Some Tidbits

Ned needed a way to check if a string consisted entirely of zeros and ones. He posted some possible answers and got a bunch more back in return. This post shows all the answers and how he validated them.
NED BATCHELDER

PyCon Australia 2024 Videos Released

This is a collection of the talks from PyCon Australia 2024. Topics include “How Smart is AI?”, “Three Django Apps in a Trenchcoat”, “Rethinking Data Catalogs”, and more.
YOUTUBE.COM video

Staff Engineer vs Engineering Manager

When do you need a Staff Engineers? What’s the difference between Staff Engineer and Engineering Manager? This article covers these questions and more.
ALEX EWERLÖF

Disposable Environments for Ad-Hoc Analyses

This article talks about juv, a tool that builds on top of uv and brings better environment management to Jupyter notebooks.
ERIC J. MA

Projects & Code Python Implementation of MCP

PYPI.ORG

pandera: Statistical Data Testing Library

GITHUB.COM/UNIONAI-OSS

Potnia: Convert Ancient Texts Into Unicode

GITHUB.COM/ANCIENTNLP • Shared by Anonymous

Use Pyton 3.13 REPL With Django Shell

GITHUB.COM/SELECTNULL • Shared by Sasha Matijasic

leopards: Query Your Python Lists

GITHUB.COM/MKALIOBY

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

December 11, 2024
REALPYTHON.COM

Python Atlanta

December 13, 2024
MEETUP.COM

PyDelhi User Group Meetup

December 14, 2024
MEETUP.COM

DFW Pythoneers 2nd Saturday Teaching Meeting

December 14, 2024
MEETUP.COM

Inland Empire Python Users Group Monthly Meeting

December 18, 2024
MEETUP.COM

Happy Pythoning!
This was PyCoder’s Weekly Issue #659.
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

Freelock Blog: Use AI to write alt text for your images

Planet Drupal - Tue, 2024-12-10 10:00
Use AI to write alt text for your images Anonymous (not verified) Tue, 12/10/2024 - 07:00 Tags Content Management UX Drupal Artificial Intelligence AI Accessibility Drupal Planet

Hot off the presses! A brand new module, AI Image Alt Text, uses your configured AI engine to write Alt text for your images, based on AI vision models. When you turn this on, you get a "Generate with AI" button next to image fields, where you can easily get AI to analyze your image and come up with alternative text.

With some quick tests, I'm finding it's describing the image better than I typically do.

Categories: FLOSS Project Planets

Stephan Lachnit: Creating a bootable USB stick that can still be used as normal storage

Planet Debian - Tue, 2024-12-10 09:53

As someone who daily drives rolling release operating systems, having a bootable USB stick with a live install of Debian is essential. It has saved reverting broken packages and making my device bootable again at least a couple of times. However, creating a bootable USB stick usually uses the entire storage of the USB stick, which seems unnecessary given that USB sticks easily have 64GiB or more these days while live ISOs still don’t use more than 8GiB.

In this how-to, I will explain how to create a bootable USB stick, that also holds a FAT32 partition, which allows the USB stick used as usual.

Creating the partition partble

The first step is to create the partition table on the new drive. There are several tools to do this, I recommend the ArchWiki page on this topic for details. For best compatibility, MBR should be used instead of the more modern GPT. For simplicity I just went with the GParted since it has an easy GUI, but feel free to use any other tool. The layout should look like this:

Type │ Partition │ Suggested size ──────┼───────────┼─────────────── EFI │ /dev/sda1 │ 8GiB FAT32 │ /dev/sda2 │ remainder

Notes:

  • The disk names are just an example and have to be adjusted for your system.
  • Don’t set disk labels, they don’t appear on the new install anyway and some UEFIs might not like it on your boot partition.
  • If you used GParted, create the EFI partition as FAT32 and set the esp flag.
Mounting the ISO and USB stick

The next step is to download your ISO and mount it. I personally use a Debian Live ISO for this. To mount the ISO, use the loop mounting option:

mkdir -p /tmp/mnt/iso sudo mount -o loop /path/to/image.iso /tmp/mnt/iso

Similarily, mount your USB stick:

mkdir -p /tmp/mnt/usb sudo mount /dev/sda1 /tmp/mnt/usb Copy the ISO contents

To copy the contents from the ISO to the USB stick, use this command:

sudo cp -r -L /tmp/mnt/iso/. /tmp/mnt/usb

The -L option is required to deference the symbolic links present in the ISO, since FAT32 does not support symbolic links. Note that you might get warning about cyclic symbolic links. Nothing can be done to fix those, except hoping that they won’t cause a problem. For me this never was a problem though.

Finishing touches

Umnount the ISO and USB stick:

sudo umount /tmp/mnt/usb sudo umount /tmp/mnt/iso

Now the USB stick should be bootable and have a usable data partition that can be used on essentially every operating system. I recommend testing that the stick is bootable to make sure it actually works in case of an emergency.

Categories: FLOSS Project Planets

Real Python: Documenting Python Projects With Sphinx and Read the Docs

Planet Python - Tue, 2024-12-10 09:00

Sphinx is a document generation tool that’s become the de facto standard for Python projects. It uses the reStructuredText (RST) markup language to define document structure and styling, and it can output in a wide variety of formats, including HTML, ePub, man pages, and much more. Sphinx is extendable and has plugins for incorporating pydoc comments from your code into your docs and for using MyST Markdown instead of RST.

Read the Docs is a free document hosting site where many Python projects host their documentation. It integrates with GitHub, GitLab, and Bitbucket to automatically pull new documentation sources from your repositories and build their Sphinx sources.

In this video course, you’ll learn how to:

  • Write your documentation with Sphinx
  • Structure and style your document with RST syntax
  • Incorporate your pydoc comments into your documentation
  • Host your documentation on Read the Docs

With these skills, you’ll be able to write clear, reliable documentation that’ll help your users get the most out of your project.

[ 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

Mike Driscoll: Checking Python Code with GitHub Actions

Planet Python - Tue, 2024-12-10 08:25

When you are working on your personal or work projects in Python, you usually want to have a way to enforce code standards. You can use tools like Flake8, PyLint or Ruff to lint your code. You might use Mypy to verify type checking. There are lots of other tools at your disposal. But it can be hard to remember to do that every time you want to create a pull request (PR) in GitHub or GitLab.

That is where continuous integration (CI) tools come in. GitHub has something called GitHub Actions that allow you to run tools or entire workflows on certain types of events.

In this article, you will learn how to create a GitHub Action that runs Ruff on a PR. You can learn more about Ruff in my introductory article.

Creating a Workflow

In the root folder of your code, you will need to create a folder called .github/workflows. Note the period at the beginning and the fact that you need a subfolder named workflows too. Inside of that, you will create a YAML file.

Since you are going to run Ruff to lint and format your Python files, you can call this YAML file ruff.yml. Put the following in your new file:

name: Ruff on: [workflow_dispatch, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Python uses: actions/setup-python@v4 with: python-version: "3.13" - name: Install dependencies run: | python -m pip install --upgrade pip pip install ruff # Include `--format=github` to enable automatic inline annotations. - name: Run Ruff run: ruff check --output-format=github . continue-on-error: false - name: Run Ruff format run: ruff format --check . continue-on-error: false

Note: This example comes from my textual-cogs repo

Let’s talk about what this does. This line is pretty important:

on: [workflow_dispatch, pull_request]

It tells GitHub to run this workflow when there’s a pull request and also with “workflow_dispatch”. That second option lets you go to the Actions tab in your GitHub repo, select the workflow and run it manually. If you do not include that, you cannot run it manually at all. This is useful for testing purposes, but you can remove it if you do not need it.

The next part tells GitHub to run the build on ubuntu-linux:

jobs: build: runs-on: ubuntu-latest

If you have a GitHub subscription, you can also get Windows as a runner, which means that you can also run these actions on Windows in addition to Linux.

The steps section is the meat of this particular workflow:

steps: - uses: actions/checkout@v4 - name: Install Python uses: actions/setup-python@v4 with: python-version: "3.13" - name: Install dependencies run: | python -m pip install --upgrade pip pip install ruff # Include `--format=github` to enable automatic inline annotations. - name: Run Ruff run: ruff check --output-format=github . continue-on-error: false - name: Run Ruff format run: ruff format --check . continue-on-error: false

Here is uses a built-in checkout@v4 workflow, which is something that comes with GitHub. There are many others you can use to enhance your workflows and add new functionality. Next, you get setup with Python 3.13 and then you install your dependencies.

Once your dependencies are installed, you can run your tools. In this case, you are installing and running Ruff. For every PR, you run ruff check --output-format=github ., which will do all sorts of linting on your Python code. If any errors are found, it will add inline comments with the error, which is what that --output-format flag is for.

You also have a separate section to run Ruff format, which will format your code to follow the Black formatter (for the most part).

Wrapping Up

You can add lots of other tools to your workflows too. For example, you might add a Mypy workflow, or some test workflows to run on PR or perhaps before merging to your main branch. You might even want to check your code complexity before allowing a merge too!

With a little work, you will soon be able to use GitHub Actions to keep your code cleaner and make it more uniform too. Adding automated testing is even better! Give it a try and let me know what you think.

The post Checking Python Code with GitHub Actions appeared first on Mouse Vs Python.

Categories: FLOSS Project Planets

Specbee: Why every Drupal developer needs to know about Services and Dependency Injection

Planet Drupal - Tue, 2024-12-10 08:14
Every Drupal developer should understand Services and Dependency Injection. Learn how these concepts simplify coding, improve efficiency, and help create cleaner, more scalable Drupal websites.
Categories: FLOSS Project Planets

Standards and the presumption of conformity

Open Source Initiative - Tue, 2024-12-10 07:44

If you have been following the progress of the Cyber Resilience Act (CRA), you may have been intrigued to hear that the next step following publication of the Act as law in the Official Journal is the issue of a European Standards Request (ESR) to the three official European Standards Bodies (ESBs). What is that about? Well, a law like the CRA is extremely long and complex and conforming to it will involve a detailed analysis and a lot of legal advice.

Rather than forcing everyone individually to do that, the ESBs are instead sent a list of subjects that need proving and are asked to recommend a set of standards that, if observed, will demonstrate conformity with the law. This greatly simplifies things for everyone and leads to what the lawmakers call a “presumption of conformity.” You could go comply with the law based on your own research, but realistically that’s impossible for almost everyone so you will instead choose to observe the harmonized standards supplied by the ESBs.

This change of purpose for standards is very significant. They have evolved from merely being a vehicle to promote interoperability in a uniform market – an optional tool for private companies that improves their product for their consumers – to being a vehicle to prove legal compliance – a mandatory responsibility for all citizens and thus a public responsibility. This new role creates new challenges as the standards system was not originally designed with legal conformance in mind. Indeed, we are frequently reminded that standardization is a matter for the private sector.

So for example, the three ESBs (ETSI, CENELEC and CEN) all have “IPR rules” that permit the private parties who work within them to embed in the standards steps that are patented by those private companies. This arrangement is permitted by the European law that created the mechanism, Regulation 1025/2012 (in Annex II §4c). All three ESB’s expressly tolerate this behaviour as long as the patents are then licensed to implementers of the standards on “Fair, Reasonable and Non Discriminatory” (FRAND) terms. None of those words is particularly well defined, and the consequence is that to implement the standards that emerge from the ESBs you may well need to retain counsel to understand your patent obligations and enable you to enter into a relationship with Europe’s largest commercial entities to negotiate a license to those patents.

Setting aside the obvious problems this creates for Open Source software (where the need for such relationships broadly inhibits implementation), it is also a highly questionable challenge to our democracy. At the foundation of our fundamental rights is the absolute requirement that first, every citizen may know the law that governs them and secondly every citizen is freely able to comply if they choose. The Public.Resource.Org case shows us this principle also extends to standards that are expressly or effectively necessary for compliance with a given law.

But when these standards are allowed to have patents intentionally embodied within them by private actors for their own profit, citizens find themselves unable to practically conform to the law without specialist support and a necessary private relationship with the patent holders. While some may have considered this to be a tolerable compromise when the goal of standards was merely interoperability, it is clearly an abridgment of fundamental rights to condition compliance with the law on identifying and negotiating a private licensing arrangement for patents, especially those embedded intentionally in standards.

Just as Regulation 1025/2012 will need updating to reflect the court ruling on availability of standards, so too should it be updated to require that harmonized standards will only be accepted from the ESBs if they are supplied on FRAND terms where all restrictions on use are waived by the contributors. Without this change, standards will serve only the benefit of dominant actors and not the public.

Categories: FLOSS Research

Pages