Feeds
PyCoder’s Weekly: Issue #632 (June 4, 2024)
#632 – JUNE 4, 2024
View in Browser »
You can ignore reading about hashable objects for quite a bit. But eventually, it’s worth having an idea of what they are. This post follows Winston on his first day at work to understand hashable objects
THEPYTHONCODINGSTACK.COM • Shared by Stephen Gruppetta
Part travelogue, part conference diary, Katherine writes about her experience at PyCon US 2024 held in Pittsburgh, PA.
KATHERINE MICHEL
In this on-demand webinar, we give an overview of Sagas, including challenges and benefits. Then, we introduce Temporal and demonstrate how easy it is to build, test, and run Sagas using our platform and coding in your preferred language. No prior knowledge of Temporal is needed to follow along →
TEMPORAL sponsor
Python circular imports can be confusing. Simply using a different form of import can sometimes fix the problem.
NED BATCHELDER
Associated HN Discussion
GITHUB.COM/PYTHON
Mahesh states that most software engineers (particularly those working on infrastructural systems) are destined to wallow in unnecessary complexity due to three fundamental laws. Associated HN Discussion.
MAHESH BALAKRISHNAN
In this video course, you’ll learn what iterators and iterables are in Python. You’ll learn how they differ and when to use them in your code. You’ll also learn how to create your own iterators and iterables to make data processing more efficient.
REAL PYTHON course
“With PropelAuth, I think I’ve spent about a day – total – on auth over the past year.” PropelAuth is easy to integrate and provides all the tools your team needs to manage your users - dashboards, user insights, impersonation, SSO and more →
PROPELAUTH sponsor
Daniel is the Benevolent Dictator For Life of the curl library, and in this post he considers how the “dictator” part may not be the best way to run an open source project. He covers 10 principles he tries to embody when guiding the curl project.
DANIEL STENBERG
NumPy 2.0 is coming shortly and has loads of big changes and new features. This article talks about NumPy’s universal functions which can be applied to the elements of a NumPy array, and how to write good ones when dealing with strings.
LYSANDROS NIKOLAOU
Floating point isn’t a precise representation, this can mean that when you compare a float with an int, something that looks like it should be the same, might not be. This article deep dives on how that works in Python.
ABHINAV UPADHYAY
The Python Software Foundation runs office hours and this year they’ve set aside two times for asking questions of current board members. If you’re thinking of running, this is a perfect place to get more information.
PYTHON SOFTWARE FOUNDATION
This post from the folks at EuroPython walks you through how their conference selection process works. Although EuroPython specific, it contains lots of good general advice for getting accepted at any conference.
CRISTIÁN MAUREIRA-FREDES & SANGARSHANAN
A DEP is like a PEP, but for Django. There are many libraries out there for dealing with background tasks when writing Django code, DEP 14 proposes an interface for such systems as well as a default backend.
DJANGO SOFTWARE FOUNDATION
In this tutorial, you’ll learn how to create pivot tables using pandas. You’ll explore the key features of DataFrame’s pivot_table() method and practice using them to aggregate your data in different ways.
REAL PYTHON
A collection of essays on software from a variety of sources. Content includes how to choose your tech stack, products, abstractions, and more.
BEN KUHN
GITHUB.COM/POMPONCHIK • Shared by Evgeniy Blinov (pomponchik)
UXsim: Vehicular Traffic Flow Simulator in Road Network Python Finite State Machines Made EasyGITHUB.COM/FGMACEDO • Shared by Fernando Macedo
Events Weekly Real Python Office Hours Q&A (Virtual) June 5, 2024
REALPYTHON.COM
June 5 to June 10, 2024
DJANGOCON.EU
June 6, 2024
MEETUP.COM
June 7 to June 10, 2024
PYCON.CO
June 11, 2024
MEETUP.COM • Shared by Laura Stephens
June 12 to June 15, 2024
WAGTAIL.SPACE
Happy Pythoning!
This was PyCoder’s Weekly Issue #632.
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 ]
Brian Perry: Matching Drupal’s GitLab CI ESLint Configuration in a Contrib Module
The Drupal Association now maintains a GitLab CI Template that can be used for all Drupal contrib projects. It's an excellent way to quickly take advantage of Drupal.org's CI system and ensure your project is following code standards and best practices. And using it has the bonus of giving you a sweet green checkmark on your project page!
We recently added this template to the Same Page Preview module. After doing so, our JavaScript linting was failing. This wasn't surprising since we hadn't yet committed a standard ESLint or Prettier configuration to the codebase. I took a shot at trying to resolve these linting issues, initially turning to the ESLint Drupal Contrib plugin. This allowed me to get ESLint up and running quickly and run linting with only within the context of this module. I resolved all of the linting issues, pushed my work up to GitLab, and started thinking about how I'd reward myself for a job well done.
Disaster StrikesAnd as you might expect, the CI build still failed. 🤦♂️
At this point I took a step back. First off, I needed to determine what differed between my ESLint process and the one that was being executed by the Drupal Gitlab CI Template. Secondly, beyond just getting the CI job to pass, I wanted to define the linting use cases I was trying to solve for. I decided to focus on the following:
- Determining how to run the exact same ESLint command that the GitLab CI Template was running, using the same configuration as Drupal Core.
- Developing an ESLint configuration that could be run within the standalone module codebase (with or without an existing instance of Drupal) but matching Drupal Core and GitLab CI's configuration as closely as possible.
Here we literally want to use the same ESLint binary and config used by Drupal Core. Since this is what Drupal's GitLab CI Template is doing, this is also an opportunity to match the CI linting configuration as closely as possible.
The CI job is running the following command:
$ $CI_PROJECT_DIR/$_WEB_ROOT/core/node_modules/.bin/eslint \ --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" \ --resolve-plugins-relative-to=$CI_PROJECT_DIR/$_WEB_ROOT/core \ --ext=.js,.yml \ --format=junit \ --output-file=$CI_PROJECT_DIR/junit.xml \ $_ESLINT_EXTRA . || EXIT_CODE_FILE=$?And prior to that command, symlinks are also created for some relevant configuration files:
$ cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $ ln -s $CI_PROJECT_DIR/$_WEB_ROOT/core/.eslintrc.passing.json $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/.eslintrc.json $ ln -s $CI_PROJECT_DIR/$_WEB_ROOT/core/.eslintrc.jquery.json $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/.eslintrc.jquery.json $ test -e .prettierrc.json || ln -s $CI_PROJECT_DIR/$_WEB_ROOT/core/.prettierrc.json . $ test -e .prettierignore || echo '*.yml' > .prettierignoreThis means that we'll need to run eslint using Core's 'passing' configuration (which itself extends the 'jquery' configuration.)
To match that, I created an eslint:core script in the module's package.json:
{ "scripts": { "eslint:core": "../../../core/node_modules/.bin/eslint . \ --no-error-on-unmatched-pattern \ --ignore-pattern='*.es6.js' \ --resolve-plugins-relative-to=../../../core \ --ext=.js,.yml \ -c ../../../core/.eslintrc.passing.json" } }I was surprised to find that even after running this command locally, the CI job was still failing. It turned out that ESLint wasn't using Core's Prettier config in this case, resulting in a different set of formatting rules being applied. Copying core/.prettierrc.json into the module's root directory resolved this issue.
Copying Drupal Core's prettier config wholesale isn't great. The approaches to referencing and extending a prettier config are clunky, but possible. A more ideal solution would be to have Drupal's prettier config as a package that could be referenced by both core and contrib modules.
Using a Standalone ESLint ConfigurationIdeally it would also be possible to run this linting outside of the context of a full Drupal instance. This could help speed up things like pre-commit hooks, some CI tasks, and also make quick linting checks easier to run. With the lessons from using Drupal Core's ESLint configuration fresh in mind, I took another shot at using the eslint-plugin-drupal-contrib plugin.
First, I installed it in the module as a dev dependency:
npm i -D eslint-plugin-drupal-contribNext, I created a file .eslintrc.contrib.json in the module's root directory:
{ "extends": ["plugin:drupal-contrib/passing"] }This will result in eslint using the same configuration as Drupal Core's 'passing' configuration, but without needing to reference Core's configuration files. Finally, you can run this by adding the following eslint script in the module's package.json:
{ "scripts": { "eslint": "eslint . \ -c .eslintrc.contrib.json \ --no-eslintrc" } }You might be surprised to see the --no-eslintrc flag above. That prevents ESLint from looking for any other configuration files in the directory tree. Without it, ESLint will find the Drupal Core configuration files if this happens to be run from within a Drupal project. This will result in ESLint attempting to resolve plugins using Drupal Core's node_modules directory, which may or may not exist.
Also note that ESLint 8.x uses the --no-eslintrc flag, while the ESLint 9.x equivalent is --no-config-lookup. Drupal core is currently on ESLint 8.x, which is the previous major release.
Happy LintingI ran into a few more hiccups than I expected along the way, but now feel confident that I can have consistent linting results between my local environment and the Drupal.org CI system in all of the JavaScript code I write for contrib modules. Hopefully this can help you do the same.
Resources- Drupal GitLab CI Template
- ESLint
- Prettier
- ESLint Drupal Contrib plugin
- Checking custom JavaScript with ESLint - an alternative approach that can be run from the conext of /core.
The Drop Times: Insights from DrupalJam Speakers: Integration, Experience, and Advocacy
Real Python: Python Interfaces: Object-Oriented Design Principles
Interfaces play an important role in software engineering. As an application grows, updates and changes to the code base become more difficult to manage. More often than not, you wind up having classes that look very similar but are unrelated, which can lead to some confusion. In this video course, you’ll see how you can use a Python interface to help determine what class you should use to tackle the current problem.
In this video course, you’ll be able to:
- Understand how interfaces work and the caveats of Python interface creation
- Comprehend how useful interfaces are in a dynamic language like Python
- Implement an informal Python interface
- Use abc.ABCMeta and @abc.abstractmethod to implement a formal Python interface
[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]
Jonathan Dowland: Quake (soundtrack)
I haven't done that much crate digging recently, but I did stick this on last week: Trent Reznor's soundtrack for Quake, originally released (within the game) in 1996, and finally issued for the first time independently in 2020.
Quake LP cover and inner covers
I picked it up the Nine Inch Nails gig in Cornwall, 2022.
An interesting factoid about the original release was the CD was mastered with the little-known pre-emphasis flag set to "on". This was relatively unusual at the time (1996) that it was never clear whether it was deliberate or not. CD ripping back then usually used an analog audio path from the CD-ROM drive to the PC sound card, and the CD-ROM would apply the necessary pre-emphasis. Therefore, ripping software didn't need to deal with it, and so most of it (then and now) doesn't, even though the path had long since changed to a purely-digital extraction. Thus, the various copies of the soundtrack circulating may or may not have had pre-emphasis correction applied, and if they did, it may or may not have been required to hear the soundtrack as it was intended.
I spent a bit of time a few years ago, before the reissue, trying to determine what was "correct". There is certainly an audible difference with pre-emphasis applied (or not), but it wasn't clear which was the intended experience. The reissue should have cleared this up once and for all, but I haven't gone back to check what the outcome was.
Contributions of Open Source to AI: a panel discussion at CPDP-ai conference
I participated as a panelist at the CPDP-ai 2024 conference in Brussels last week where we discussed the significant contributions of Open Source to AI and highlighted the specific properties that differentiate Open Source AI from proprietary solutions. Representing the Open Source Initiative (OSI), the globally recognized non-profit that defines the term Open Source, I emphasized the longstanding principle of granting users full agency and control over technology, which has been proven to deliver extensive social benefits.
Below is a glimpse at the questions and answers posed to me and my fellow panelists:
Question: Stefano, please explain what the contribution to AI from Open Source is, and if there are specific properties of Open Source AI that make a difference for the users and for the people who are confronted with its results.
Response: The Definition of Open Source Software has existed for over 25 years; That doesn’t apply to AI. The Open Source Definition for software provides a stable north star for all participants in the digital ecosystem, from small and large companies to citizens and governments.
The basic principle of the Open Source Definition is to grant to the users of any technology full agency and control over the technology itself. This means that users of Open Source technologies have self-sovereignty of the technical solutions.
The Open Source Definition has demonstrated that massive social benefits accrue when you remove the barriers to learning, using, sharing and improving software systems. There is ample evidence that giving users agency, control and self-sovereignty of their technical choices produces a viable ecosystem based on permissionless innovation. Multiple studies by the EU Commission and Harvard researchers have assigned significant economic value to Open Source Software, all based on that single, clear, understood and approved Definition from 26 years ago.
For AI, and especially the most recent machine learning solutions, it’s less clear how society can maintain self-sovereignty of the technology and how to achieve permissionless innovation. Despite the fact that many people talk about Open Source AI, including the AI Act, there is no shared understanding of what that means, yet!
The Open Source Initiative is concluding a global, multi-stakeholder co-design process to find an unequivocal definition of Open Source AI, and we’re heading towards the conclusion of this process with a vastly increased knowledge of the AI machine learning space. The current draft of the Open Source AI Definition recognizes that in order to study, use, share and modify AI, one needs to refer to an AI system, not a single individual component. The global process has identified the components required for society to maintain control of the technology and these are:
- Detailed information about the dataset used to train the system and the code so that a skilled person can train a system with similar capabilities
- All the libraries and tools used to run training and inference
- The model architecture and the parameters, like weights and biases
Having unrestricted access to all these elements is what makes an AI an Open Source AI.
We’re in the final stretch of the process, starting to gather support for the current draft of the definition.
The most controversial part of the discussion is the role of data in the training. To answer your question about the power of big foreign tech companies, putting aside the hardware requirements, the data is where the fight is. There seem to be two views of the world on data when it comes to AI: One thinks that text and data mining is basically strip mining humanity and all accumulation of data without consent of the rights holders must be made illegal. Another view of the world is that text and data mining for the purpose of training Open Source AI is probably the only antidote to the superpowers of large corporations. These camps haven’t found a common position yet. Japan seems to have made up its mind already, legalizing unrestricted text and data mining. We’ll see where the lawsuits in the US will go, if they ever get to a decision in court or, as I suspect, they will be settled out of court.
In any case, data, competence and to some extent hardware, are the levers to control the development of AI.
Open Source has been leveling the playing field of technologies. We know from past experience with Open Source software that giving people unrestricted access to the means of digital production enables tremendous economic value. This worked in Europe as well as in China. We think that Open Source AI can have the same effect of generating value while leaving control of the technology in the hands of society.
Question: Big tech companies are important for the development of AI. Apart from the purely technological impacts, there is also economic importance. The European Commission has been very concerned about the Digital Single Market recently, and has initiated legislation such as DSA and DMA to improve competition and market access. Will these instruments be sufficient in view of AI roll-out, thinking also of the recently adopted AI Act? Or will additional attention need to be paid?
Response: Open is the best antidote to the concentration of power. That said, I see these legislations as the sticks, very necessary. I’d love us to think also about carrots. We don’t want to repeat the mistakes of the past with the early years of the internet. Open Source software was equally available in the US and Europe but despite that, the few European champions of Open Source haven’t grown big enough to have a global impact. And some of the biggest EU companies aren’t exactly friendly with Open Source either.
Chinese companies have taken a different approach. But in Europe we have talents, and we have an attractive quality of life so we can get even more talents. Finding money is never an issue. We need to remove the disincentives to grow our companies bigger, widen the access to the internal EU market and support their international expansion, too.
For example, we need to review European Regulation 1025, on standardization to accommodate for Open Source. 1025 Regulation was written at a time when Open Source was considered a “business model” and information and communication technology standards were about voltages in a wire. Today, Open Source is between 80% and 90% of all software and “digital elements” comprise some part of every modern product. Even hardware solutions are dominated by “digital elements.” As such, the approach taken by 1025 is out of date and most likely needs a root-and-branch rethink to properly apply to the world today and the world we anticipate tomorrow.
We need to make sure that the standardization rules required by the Cyber Resilience Act are written together with Open Source champions so the rules don’t favor exclusively the cartel of European patent holders who try to seek rent instead of innovating. Europe has all the means to be at the center of AI innovation; It embodies the right values of diversity and collaboration.
Closing remarks: We think that Open Source is the best antidote to fight market concentration in AI. Data is where the concentration of power is happening now and it’s in the hands of massive corporations: not only Google, Meta, Amazon, Reddit but also Sony, Warner, Netflix, Getty Images, Adobe … All these companies have already gained access to massive amounts of data, legally. These companies basically own our data, legally: Our pictures, the graph of our circles of friends, all the books and movies…
There is a risk that if we don’t write policies that allow text and data mining in exchange of a real Open Source AI (one that society can fully control) then we risk leaving the most powerful AI systems in the hands of the oligopoly who can afford trading money for access to data.
Specbee: A quick guide to integrating CiviCRM with Drupal
Python Bytes: #386 Major releases abound
joshics.in: Drupal 10: Not Just Another Upgrade, But a Revolution in Web Development
Ever had to scratch your head, ferreting out the secret weapon behind those mammoth success stories of the digital world? Well, ponder no more, you've just stumbled upon the world of Drupal 10!
As the latest prodigy of the Drupal family, Drupal 10 isn't just a facelift but a tool that champions uncharted territories. With an arsenal of new features, it's here to empower developers - both seasoned and novice ones.
Let's picture this through an everyday scenario. You're a site developer catering to a global audience. Earlier, you'd have to have multiple versions of the site to cater to various languages. Drupal 10 simplifies this with its built-in multilingual feature. You can now translate and localise your website without bothersome plugins.
Consider another common tussle developers face - keeping up with the digital world's insatiable appetite for interactive and responsive designs. With Drupal 10's layout builder, you can create and customize layouts per content type, per node, or even per user role.
Even SEO, the lifeline of online visibility, gets a boost with Drupal's 10 in-built meta tag and path auto modules. Now you can ensure your site stays in the limelight with less effort and more smart work.
Yet the standout trait of Drupal 10, one that deserves a tip of the hat, is the ease of upgrade. Remember the hair-pulling days of upgrading from Drupal 7 to 8? Those days are in the rear view mirror as Drupal 10 ensures a seamless upgrade, promising the preservation of custom themes and modules.
In conclusion, Drupal 10 is not just a new version, but a pivotal shift in web development that caters to today's fast-paced, ever-evolving digital landscape. It's about time we embrace it!
Drupal 10 Drupal PlanetHaruna 1.1.2
Haruna version 1.1.2 is out.
You can get it now on flathub:
Availability of other package formats depends on your distro and the people who package Haruna.
Windows version:
- haruna-1.1.2-windows-gcc-x86_64.exe
- haruna-1.1.2-windows-gcc-x86_64.7z
- haruna-1.1.2-windows-gcc-x86_64-dbg.7z
If you like Haruna then support its development: GitHub Sponsors | Liberapay | PayPal
Feature requests and bugs should be posted on bugs.kde.org, but for bugs make sure to fill in the template and provide as much information as possible.
Changelog: 1.1.2Bugfixes:
- Disabled track selection menus and buttons when there are no tracks to be selected
- Fixed custom command toggling
- Re-added "Scroll to playing item" and "Trash file" options to playlist context menu, lost during Qt6 port
- Fixed some mpv properties not being correctly set at startup
- Fixed video rendering on Windows
Plasma 6 and 'traditional' window tiling
I was keeping myself on Plasma 5.x until recently. I got so accustomed to the Bismuth window tiling script for KWin that I couldn’t imagine myself updating to Plasma 6.x where Bismuth doesn’t work.
Unfortunately (?), one of the recent Debian updates broke Bismuth in Plasma 5.x as well, so I had nothing keeping me on the old version anymore. I’m now (again) running the development version of (most) KDE software.
Since the update, I managed to make the Qtile tiling window manager work with Plasma to some extent. But the integration between Qtile and Plasma I hacked was less than ideal, and I kept switching between KWin which worked perfectly, as KWin does, but without tiling, and my Frankenstein Qtile which didn’t work that well, but it had tiling.
Maybe I’ll write about it if I get back to hacking Qtile, but that might not happen any time soon because…
KrohnkiteThen I saw the news that the predecessor of Bismuth – the Krohnkite script has been ported to KWin 6 – see the announcement on reddit, github to get and review the code, and kde store for the package you can install.
Huge kudos to all who are involved in the rebirth, the script works as well as it did with KWin 5.
Window decorationThe only thing missing was the simple ‘just a line around the window’ window decoration that Bismuth had.
KWin 6 and Krohnkite + Bismuth decorationNow we have that as well, I’ve ported the original Bismuth window decoration to KWin 6 (nothing huge, just a few tiny changes to make it compile). The code, and the installation instructions are available on github.
You can support my work on Patreon, or you can get my book Functional Programming in C++ at Manning if you're into that sort of thing. -->Reproducible Builds (diffoscope): diffoscope 270 released
The diffoscope maintainers are pleased to announce the release of diffoscope version 270. This version includes the following changes:
[ Chris Lamb ] * No-change release due to broken version 269 tarballs.You find out more by visiting the project homepage.
TestDriven.io: Approximate Counting in Django and Postgres
FreeBSD 13 Testing
FreeBSD 13 is still supported as of this writing (much to the chagrin of the KDE-FreeBSD folks, who would like 14-only as soon as possible for ease of support and patching). My own machine is a weird Franken-beastie somewhere between 13.2 and 13.3, but I’ve been wrestling with some package-building failures on the FreeBSD cluster machines for all of 13.2, 13.3 and 14.0 – it builds on my machine, and then fails with compiler errors on the cluster. More weirdly still, it looks like “obvious missing C++ headers”, so I don’t understand why it works for me. Here’s some notes for my future self about quickly setting up a virtual machine for ports testing.
After I wrote this down, and started doing some testing, it turned out I had a local fix, which I had forgotten to push. Facepalm time, but at least I have a handful of notes for future me when I have an actual problem.
- Set up a VirtualBox VM with a CD drive and a 40GiB hard disk,
- Get a FreeBSD 13.2 install ISO image,
- Run through the FreeBSD installation. This takes maybe 5 minutes with all of the default settings and creating a single user. I used automatic UFS on the whole virtual disk. Don’t bother with the ports tree.
After booting the newly-installed system, configuration for ports testing can start.
- As root, pkg install git cmake , which will first install the package manager, then git and cmake, which are two things we’re going to need anyway.
- As root, clone the ports tree. I used git clone --depth 50 -b 2024Q2 https://git.freebsd.org/ports.git /usr/ports to get the quarterly branch.
- Use the package manager to find out the dependencies of the desired port. With pkg rquery %dn followed by the name of the desired port, you get the dependencies of the port. Since most FreeBSD ports are developer-batteries-included, those are also the build dependencies.
- Use pkg install to install them. Backtick expansion can make things easier here.
- If there’s no package available, then the ports framework offers make build-depends-list run-depends-list which will print full paths to the ports directories of the dependencies. With a little bit of sed(1) processing, this turns into a list of installable packages.
Once the system is up, ports builds can proceed as usual.
Bounteous.com: A New Age of Drupal: Drupal CMS
Drupal Association blog: Pride Month 2024: Celebrating International Pride
To celebrate Pride Month 2024, the Drupal Association is sharing information to uplift international organizations that support the LGBTQ+ community and donating our proceeds of themed apparel from the Drupal Swag Shop to those organizations. Pride Month is celebrated in June each year to acknowledge the anniversary of the Stonewall Uprising (1969), which was a tipping point for the gay liberation movement and spurred the growth of LGBTQ+ support. The movement has since spread across the globe. Read more on the history of Pride Month.
The Drupal Association is guided by the values of open source, which have a strong history of inclusivity. Our focus is human-centric. We believe that the way forward is with collective responsibility, accountability, and care. As stated in the Open Web Manifesto, the open web thrives on inclusion: Everyone in the world, regardless of background, identity, wealth, or status, has a home on the open web. Inclusivity is one of Drupal’s core principles, making an open web possible. At the core of our beliefs is that every individual, regardless of sexual orientation, gender identity, or expression, has a place here and deserves to be supported.
This year, the Drupal Association will celebrate LGBTQ+ organizations from around the world who work in different sectors: jobs and training, legal advocacy, refugee support, and youth mental health. We invite you to learn more about each organization that we highlight. Then, we ask you, the Drupal Community, to vote for which organization will receive the proceeds from Drupal Pride swag raised during Pride Month in the Drupal Swag Shop.
Here are the organizations we will be celebrating during each week of the month:
-
Week 1: Micro Rainbow International Foundation is an organization that works globally to help LGBTQ+ people achieve their full potential in life and have equal access to employment, training, education, financial services, healthcare, housing, places of faith, and public places and services.
-
Week 2: Human Dignity Trust defends the human rights of LGBTQ+ people globally to challenge laws that persecute people on the basis of their sexual orientation and/or gender identity.
-
Week 3: Rainbow Railroad supports refugees, helping at-risk LGBTQ+ people get to safety worldwide. They’ve helped over 13,000 LGBTQ+ individuals find safety through emergency relocation, crisis response, cash assistance, and more.
-
Week 4: The Trevor Project provides resources for international LGBTQ+ youth, including a 24/7 helpline and a safe and secure social networking site for LGBTQ+ youth and their allies.
Follow the Drupal Association on Linkedin and X/Twitter as we celebrate each organization this month!
You can shop now and throughout the month of June in the Drupal Swag Shop for Drupal Pride gear! At the end of the month, 100% of the Drupal Association’s profits from the sales of the Drupal Pride gear will be donated to the LGBTQ+ organization that receives the most votes. Shop now and spread the word with the community!
When you’re ready, we invite you to vote for the organization for which you want to receive the donation.
We want to hear your Drupal Pride stories!In addition to celebrating LGBTQ+ organizations worldwide, we want to hear the Drupal community’s stories! What does Drupal Pride mean to you? We want to hear why Pride is important to you. We invite you to share your story with us to be featured on the Drupal Association social media channels celebrating Pride Month 2024!
We are looking for videos that are less than 30 seconds long, short quotes, or photos that we can share on social media to amplify your messages. To share your story, you can either upload it to this Google Drive folder or email it directly to christina@association.drupal.org. We look forward to seeing your submissions and celebrating Pride together!
Open Source AI Definition – Weekly update June 3
- A first draft of the report of the validation phase has been published. The validation phase is designed to review the compatibility of existing systems with the current draft definition. These are the systems in question: Arctic, BLOOM, Falcon, Grok, Llama 2, Mistral, OLMo, OpenCV, Phy-2, Pythia, and T5.
- Problems and initial findings:
- Elusive documents: Not having system creators involved meant reviewers had to independently search for legal documents, resulting in many blanks in the document list and subsequent analysis.
- One component, many artifacts, and documents: Some components were linked to multiple artifacts and documents, complicating the review process as source code and documentation could be spread across several repositories and reports.
- Compounded components: Components in the checklist often combined multiple artifacts, such as training and validation code, making it difficult to track down specific legal documents.
- Compliant? Conformant? Six out of eleven required components need a legal framework that is “compliant” or “conformant” with the Open Source Definition, prompting a need for clearer guidance on reviewing non-software components.
- Reverting to the license: Reviewers suggested simplifying the process by relying on whether a legal document is OSI-approved, conformant, or compliant to guarantee the right to use, study, modify, and share the component, eliminating the need for independent assessment.
- Next steps:
- As we are looking to fill in the gaps from above we call on both system creators and independent volunteers to complete various system reviews.
- If your familiar system is not on the list, contact Mer on the forum
- Initial questions and queries:
- @jasonbrooks asks if the validation process should check if there’s “sufficiently detailed information about the data used to train the system so a skilled person can recreate a substantially equivalent system.” It’s unclear if this has been confirmed, and examples of skilled individuals achieving this would be helpful.
- @stefano replies that the Preferred form lists enduring principles, while the Checklist details required components. Validation ensures components like training methodologies and data provenance are available, enabling system recreation. Mer’s report highlights the difficulty in finding these components, suggesting a need for a better method. One idea is a detailed survey for AI developers, though companies like Meta might misuse the “Open Source” label. Public pressure may eventually deter such abuses.
- @amcasari adds insights into the process of reviewing licenses.
- @jasonbrooks asks if the validation process should check if there’s “sufficiently detailed information about the data used to train the system so a skilled person can recreate a substantially equivalent system.” It’s unclear if this has been confirmed, and examples of skilled individuals achieving this would be helpful.
- This week, the conversation shifted heavily toward the possibilities of creating a gradient approach to open licensing.
- @Markhas shared that he is publishing a paper regarding open washing, the AI ACT, and a case for a gradient notion of openness.
- In line with previous points mostly raised by @danish_contactor, Mark highlights the RAIL licenses and argues that it should count towards openness too, stating that “I think providers and users of LLMs should not be free to create oil spills in our information landscape and I think RAIL provides useful guardrails for that.”
- They also present their visualization of the degrees of openness of different systems
- @stefano has reiterated that the open-source AI definition will remain binary, just like the Open Source Definition is binary. And responding to @Markhas and @danish_contactor, he linked to Kate Downing legal analysis of RAIL licensing framework.
- Answering @stefano’s earlier questions, @mark adds that it’s challenging to fine-tune a model without knowing the initial training data and techniques. Examples like Meta and Mistral fine-tunes show success despite the lack of transparency in the original training data. Intel’s Neural 7B and AllenAI’s Tulu 70B demonstrate effective fine-tuning with detailed disclosure of fine-tuning steps and data. However, these efforts can’t qualify as truly open AI systems due to the closed nature of the base models and potential legal liabilities.
- @stefano closed the topic stating that, based on feedback, “Derivatives of non-Open Source AI cannot be Open Source AI”
- @amscott added that AI developers will likely self-certify compliance with the OSAID, with objective certification needed for arbitration in nuanced cases. Like the OSD, the OSAID will mature through community practice. A simple self-certification tool could promote transparency and document good practices.
- @mark added that The EU AI Act emphasizes “Open Source” systems, offering exemptions attractive to companies like Meta and Mistral. The AI Act requires disclosure templates overseen by an AI Office, potentially leading to intense lobbying efforts. If Open Source organizations influence regulation and certification, transparency may strengthen the Open Source ecosystem.
- Question from @Jennifer Ding regarding why “information” is a focus for the data category and not the code and model categories.
- @Matt White adds that OSD-Conformant (in the checklist) should be defined somewhere.
- He further adds (to Data Information, under checklist) that many “open” models withhold various forms of data, making it unreasonable to expect model producers to release all the information necessary for full replication of the data pipeline if data is not a required component of the definition
- @Micheal Dolan adds that ”the use of OSD-compliant and OSD-conformant without any definitions of either term is difficult to parse the meaning of.” and suggests some solutions.
- Missing a recap of how we got to where we are now? OSI was present at PyCon in Pittsburgh where we held a workshop regarding our current definition and spoke with many knowledgeable shareholders. You can read about it here.
Test and Code: 221: How to get pytest to import your code under test
We've got some code we want to test, and some tests.
The tests need to be able to import the code under test, or at least the API to it, in order to run tests against it.
How do we do that? How do we set things up so that our tests can import our code?
In this episode, we discuss two options:
- Installing the code under test as a pip installable package with `pip install -e /path/to/local/package`.
- Using the pythonpath pytest setting.
Sponsored by Mailtrap.io
- An Email Delivery Platform that developers love.
- An email-sending solution with industry-best analytics, SMTP, and email API, SDKs for major programming languages, and 24/7 human support.
- Try for Free at MAILTRAP.IO
Sponsored by The Complete pytest Course
- For the fastest way to learn pytest, go to courses.pythontest.com
- Whether your new to testing or pytest, or just want to maximize your efficiency and effectiveness when testing.
Talking Drupal: Talking Drupal #453 - Urban Institute
Today we are talking about Urban Institute, What they do, and How they use Drupal with guest Josh Miller. We’ll also cover Access Unpublished as our module of the week.
For show notes visit: www.talkingDrupal.com/453
Topics- Tell us how you got started with Drupal
- What does Urban Institute do
- What do you do at Urban Institute
- Number of people on dev team
- Number of sites
- How does Urban Institute use Drupal
- Are you using a custom upstream
- How many sites on Drupal 7
- Are you doing Page builders
- What kind of front end tools do you use
- What is the preferred local development tool
- Why did Urban Institute choose Drupal
- What is the hardest part of using Drupal at a large non profit
- What is the most interesting interactive experience you have built for Urban Institute
- Urban Institute
- Josh's new custom home
- Urban Institute at DrupalCon 2023
- DKAN
- Drupal GovCon
- Post-recording
Josh Miller - joshmiller
HostsNic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Randy Fay - rfay
MOTW Correspondent- Martin Anderson-Clutz - mandclu.com mandclu
- Brief description:
- Have you ever wanted to get feedback on unpublished content from people who aren’t users on your Drupal site? There’s a module for that.
- Module name/project name:
- Brief history
- How old: created in Feb 2011 by aberg, though recent releases are by Christian Fritsch (chr.fritsch) of Thunder
- Versions available: 8.x-1.5
- Maintainership
- Security coverage
- Test coverage
- Number of open issues: 58 open issues, 17 of which are bugs against the current branch
- Usage stats:
- 8,638 sites
- Module features and usage
- Once installed, this module adds a new element to your unpublished entity forms, for generating links with a special hash value. When generating the link, you can choose how long the hash value can be used for access.
- Within that form section, you can copy the access URL for any of your generated tokens, and then paste into an email or some kind of direct message.
- You will need to set a permission for users to access content using the special access URLs, so if you want anyone with the URL to be allowed access, you’ll need to assign that permission to the Anonymous user role
- The access lifetime can be anything from 1 day to unlimited (never expires), and you can set the default value in the settings form. That form also allows you to set the URL parameter that will be used for access, gives you options to modify the HTTP headers on the unpublished page, and has a check box you can use to delete all expired tokens.
- Expired tokens will be deleted on cron run, and when you delete an entity any related tokens are also removed.
- This use case of allowing review of unpublished content for people who aren’t users in the Drupal site is a request I hear on a regular (if infrequent) basis, so I’ve personally found this module really useful.
- Necessary Patch: https://www.drupal.org/project/access_unpublished/issues/3421309
- Not to be confused with https://www.drupal.org/project/preview_link
- Preview link is missing the ability to set length of access.
Python Morsels: Python's many command-line utilities
Every command-line tool included with Python. These can be run with python -m module_name.
Table of contents
- How -m works
- General-purpose CLI tools
- Especially handy on Windows machines
- Working with Python code
- Analyzing Python code
- Just for fun
- Other Python-related tools
- Oddly meta tools
- Less useful tools
- Every command-line tool in Python
Running Python with the -m command-line argument tells Python to run a given Python module as if it were a Python script.
Some modules do something at import time. For example the antigravity module will open up a web browser for an XKCD comic. Running this module from the command-line would do the same thing as importing it:
$ python -m antigravityThis is called an "import side effect" and most modules avoid import side effects. Fun Easter egg modules like antigravity and this are the exception.
Modules that avoid import side effects need a different mechanism to change their behavior when run as a command-line script or when imported as a module. Python uses a __name__ variable to distinguish between importing a module and running a module as a script.
When Python runs a module as a script, it sets the module's name to the string "__main__" (normally __name__ would contain the module's actual name). See more in defining a main function in Python.
For packages, Python also looks for a __main__.py file to run (there's one in the zipfile package for example).
This distinction between module versus script allows for some really nifty command-line tools.
General-purpose CLI toolsThe first tools we'll look …
Read the full article: https://www.pythonmorsels.com/cli-tools/