Feeds

Will Kahn-Greene: Bleach 6.0.0 release and deprecation

Planet Python - Mon, 2023-01-23 11:55
What is it?

Bleach is a Python library for sanitizing and linkifying text from untrusted sources for safe usage in HTML.

Bleach v6.0.0 released!

Bleach 6.0.0 cleans up some issues in linkify and with the way it uses html5lib so it's easier to reason about. It also adds support for Python 3.11 and cleans up the project infrastructure.

There are several backwards-incompatible changes, hence the 6.0.0 version.

https://bleach.readthedocs.io/en/latest/changes.html#version-6-0-0-january-23rd-2023

I did some rough testing with a corpus of Standup messages data and it looks like bleach.clean is slightly faster with 6.0.0 than 5.0.0.

Using Python 3.10.9:

  • 5.0.0: bleach.clean on 58,630 items 10x: minimum 2.793s

  • 6.0.0: bleach.clean on 58,630 items 10x: minimum 2.304s

The other big change 6.0.0 brings with it is that it's now deprecated.

Bleach is deprecated

Bleach sits on top of html5lib which is not actively maintained. It is increasingly difficult to maintain Bleach in that context and I think it's nuts to build a security library on top of a library that's not in active development.

Over the years, we've talked about other options:

  1. find another library to switch to

  2. take over html5lib development

  3. fork html5lib and vendor and maintain our fork

  4. write a new HTML parser

  5. etc

With the exception of option 1, they greatly increase the scope of the work for Bleach. They all feel exhausting to me.

Given that, I think Bleach has run its course and this journey is over.

What happens now?

Possibilities:

  1. Pass it to someone else?

    No, I won't be passing Bleach to someone else to maintain. Bleach is a security-related library, so making a mistake when passing it to someone else would be a mess. I'm not going to do that.

  2. Switch to an alternative?

    I'm not aware of any alternatives to Bleach. I don't plan to work on coordinating the migration for everyone from Bleach to something else.

  3. Oh my goodness--you're leaving us with nothing?

    Sort of.

I'm going to continue doing minimal maintenance:

  1. security updates

  2. support for new Python versions

  3. fixes for egregious bugs (begrudgingly)

I'll do that for at least a year. At some point, I'll stop doing that, too.

I think that gives the world enough time for either something to take Bleach's place, or for the sanitizing web api to kick in, or for everyone to come to the consensus that they never really needed Bleach in the first place.

Bleach. Tired. At the end of its journey.

Where to go for more

For more specifics on this release, see here: https://bleach.readthedocs.io/en/latest/changes.html#version-6-0-0-january-23rd-2023

Documentation and quickstart here: https://bleach.readthedocs.io/en/latest/

Source code and issue tracker here: https://github.com/mozilla/bleach

Categories: FLOSS Project Planets

texinfo @ Savannah: Texinfo 7.0.2 released

GNU Planet! - Mon, 2023-01-23 11:52

We have released version 7.0.2 of Texinfo, the GNU documentation format. This is a minor bug-fix release.

It's available via a mirror (xz is much smaller than gz, but gz is available too just in case):

http://ftpmirror.gnu.org/texinfo/texinfo-7.0.2.tar.xz
http://ftpmirror.gnu.org/texinfo/texinfo-7.0.2.tar.gz

Please send any comments to bug-texinfo@gnu.org.

Full announcement:

https://lists.gnu.org/archive/html/info-gnu/2023-01/msg00008.html

Categories: FLOSS Project Planets

Python Morsels: Reading a CSV file in Python

Planet Python - Mon, 2023-01-23 11:00

You don't need third-party libraries to read CSV file in Python! Python's csv module includes helper functions for reading CSV files, tab-delimited files, and other delimited data files.

Table of contents

  1. Reading a CSV file with csv.reader
  2. Skipping the header row in a CSV file
  3. Mapping CSV headers to columns
  4. Reading tab-delimited data files
  5. Use csv.reader or csv.DictReader to read CSV files in Python

Reading a CSV file with csv.reader

The Python Standard Library has a csv module, which has a reader function within it:

>>> import csv >>> csv.reader <built-in function reader>

We can use the reader function by passing it an iterable of lines. This usually involves passing reader a file object, because files are iterables in Python, and as we loop over them, we'll get back each line in our file (see reading a file line-by-line in Python).

Here we have a CSV file called penguins_small.csv:

species,island,bill_length_mm,bill_depth_mm,flipper_length_mm,body_mass_g,sex Adelie,Torgersen,39.1,18.7,181,3750,MALE Adelie,Dream,39.5,16.7,178,3250,FEMALE Adelie,Biscoe,39.6,17.7,186,3500,FEMALE Chinstrap,Dream,46.5,17.9,192,3500,FEMALE Gentoo,Biscoe,46.1,13.2,211,4500,FEMALE

Let's use Python's built-in open function to [open our file for reading][reading from a file].

>>> penguins_file = open("penguins_small.csv")

Now we can call pass the file object we got back to csv.reader:

>>> penguins_file = open("penguins_small.csv") >>> reader = csv.reader(penguins_file)

When we call csv.reader we'll get back a reader object:

>>> reader <_csv.reader object at 0x7fd34c861930>

We can loop over that reader object to get the rows within it:

>>> for row in reader: ... print(row) ...

When we loop over a csv.reader object, the reader will loop over the file object that we originally gave it and convert each line in our file to a list of strings:

>>> for row in reader: ... print(row) ... ['species', 'island', 'bill_length_mm', 'bill_depth_mm', 'flipper_length_mm', 'body_ mass_g', 'sex'] ['Adelie', 'Torgersen', '39.1', '18.7', '181', '3750', 'MALE'] ['Adelie', 'Dream', '39.5', '16.7', '178', '3250', 'FEMALE'] ['Adelie', 'Biscoe', '39.6', '17.7', '186', '3500', 'FEMALE'] ['Chinstrap', 'Dream', '46.5', '17.9', '192', '3500', 'FEMALE'] ['Gentoo', 'Biscoe', '46.1', '13.2', '211', '4500', 'FEMALE']

Each list represents one row in our file, and each string in each list represents the data in one column in that row.

Skipping the header row in a CSV file

Note that csv.reader doesn't know …

Read the full article: https://www.pythonmorsels.com/csv-reading/
Categories: FLOSS Project Planets

Real Python: Linear Algebra in Python: Matrix Inverses and Least Squares

Planet Python - Mon, 2023-01-23 09:00

Linear algebra is an important topic across a variety of subjects. It allows you to solve problems related to vectors, matrices, and linear equations. In Python, most of the routines related to this subject are implemented in scipy.linalg, which offers very fast linear algebra capabilities.

In particular, linear models play an important role in a variety of real-world problems, and scipy.linalg provides tools to compute them in an efficient way.

In this tutorial, you’ll learn how to:

  • Study linear systems using determinants and solve problems using matrix inverses
  • Interpolate polynomials to fit a set of points using linear systems
  • Use Python to solve linear regression problems
  • Use linear regression to predict prices based on historical data

This is the second part of a series of tutorials on linear algebra using scipy.linalg. So, before continuing, make sure to take a look at the first tutorial of the series before reading this one.

Free Source Code: Click here to download the free code and dataset that you’ll use to work with linear systems and algebra in Python with scipy.linalg.

Now you’re ready to get started!

Getting Started With Linear Algebra in Python

Linear algebra is a branch of mathematics that deals with linear equations and their representations using vectors and matrices. It’s a fundamental subject in several areas of engineering, and it’s a prerequisite to a deeper understanding of machine learning.

To work with linear algebra in Python, you can count on SciPy, which is an open-source Python library used for scientific computing, including several modules for common tasks in science and engineering.

Of course, SciPy includes modules for linear algebra, but that’s not all. It also offers optimization, integration, interpolation, and signal processing capabilities. It’s part of the SciPy stack, which includes several other packages for scientific computing, such as NumPy, Matplotlib, SymPy, IPython, and pandas.

scipy.linalg includes several tools for working with linear algebra problems, including functions for performing matrix calculations, such as determinants, inverses, eigenvalues, eigenvectors, and the singular value decomposition.

In the previous tutorial of this series, you learned how to work with matrices and vectors in Python to model practical problems using linear systems. You solved these problems using scipy.linalg.

In this tutorial, you’re going a step further, using scipy.linalg to study linear systems and build linear models for real-world problems.

In order to use scipy.linalg, you have to install and set up the SciPy library. Besides that, you’re going to use Jupyter Notebook to run the code in an interactive environment. SciPy and Jupyter Notebook are third-party packages that you need to install. For installation, you can use the conda or pip package manager. Revisit Working With Linear Systems in Python With scipy.linalg for installation details.

Note: Using Jupyter Notebook to run the code isn’t mandatory, but it facilitates working with numerical and scientific applications.

For a refresher on working with Jupyter Notebooks, take a look at Jupyter Notebook: An Introduction.

Next, you’ll go through some fundamental concepts of linear algebra and explore how to use Python to work with these concepts.

Understanding Vectors, Matrices, and the Role of Linear Algebra

A vector is a mathematical entity used to represent physical quantities that have both magnitude and direction. It’s a fundamental tool for solving engineering and machine learning problems. So are matrices, which are used to represent vector transformations, among other applications.

Note: In Python, NumPy is the most used library for working with matrices and vectors. It uses a special type called ndarray to represent them. As an example, imagine that you need to create the following matrix:

With NumPy, you can use np.array(), to create it, providing a nested list containing the elements of each row of the matrix:

>>>In [1]: import numpy as np In [2]: np.array([[1, 2], [3, 4], [5, 6]]) Out[2]: array([[1, 2], [3, 4], [5, 6]])

NumPy provides several functions to facilitate working with vector and matrix computations. You can find more information on how to use NumPy to represent vectors and matrices and perform operations with them in the previous tutorial in this series.

A linear system or, more precisely, a system of linear equations, is a set of equations linearly relating to a set of variables. Here’s an example of a linear system relating to the variables x₁ and x₂:

Here you have two equations involving two variables. In order to have a linear system, the values that multiply the variables x₁ and x₂ must be constants, like the ones in this example. It’s common to write linear systems using matrices and vectors. For example, you can write the previous system as the following matrix product:

Comparing the matrix product form with the original system, you can notice the elements of matrix A correspond to the coefficients that multiply x₁ and x₂. Besides that, the values in the right-hand side of the original equations now make up vector b.

Read the full article at https://realpython.com/python-linear-algebra/ »

[ 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

Python for Beginners: Iterate Rows in a Pandas Dataframe

Planet Python - Mon, 2023-01-23 09:00

We use pandas dataframes to handle tabular data in python. In this article, we will discuss different ways to iterate rows in a pandas dataframe.

Table of Contents
  1. Iterate a Pandas Dataframe Using iloc Attribute
  2. Iterate Rows in a Pandas Dataframe Using the loc Attribute
  3. Iterate Rows Using iterrows() Method in Pandas
  4. Conclusion
Iterate a Pandas Dataframe Using iloc Attribute

The iloc attribute in a pandas dataframe is used to select a row at a specified position from the dataframe. The iloc attribute contains the  _iLocIndexer object. Using the _iLocIndexer object, we can select any row from the dataframe using the position of the row and python indexing

To iterate rows in the pandas dataframe using the iloc attribute, we will first find the number of rows in the dataframe using the len() function. The len() function takes the dataframe as its input and returns the number of rows. 

After finding the number of rows, we will use a for loop and _iLocIndexer object to iterate rows of the dataframe as shown below.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}] df=pd.DataFrame(myDicts) print("The input dataframe is:") print(df) print("The rows are:") num_rows=len(df) for position in range(num_rows): print(df.iloc[position])

Output:

The input dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 The rows are: Roll 1 Maths 100 Physics 80 Chemistry 90 Name: 0, dtype: int64 Roll 2 Maths 80 Physics 100 Chemistry 90 Name: 1, dtype: int64 Roll 3 Maths 90 Physics 80 Chemistry 70 Name: 2, dtype: int64

In this example, we first converted a list of dictionaries to a dataframe. Then, we calculated the number of rows in the dataframe using the len() function. After this, we used a for loop and the iloc attribute to iterate over the dataframe.

Iterate Rows in a Pandas Dataframe Using the loc Attribute

The loc attribute in a pandas dataframe is used to select a row at a specified index from the dataframe. The loc attribute contains a _LocIndexer object. Using the _LocIndexer object, we can select any row in a dataframe using the index of the row and the indexing operator. 

To iterate through rows in the pandas dataframe using the loc attribute, we will first get the list containing the index values using the index attribute of the dataframe. Then, we will use a for loop and the loc attribute to iterate rows as shown in the following example.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}] df=pd.DataFrame(myDicts) print("The input dataframe is:") print(df) df.set_index("Roll",inplace=True) print("The rows are:") indices=df.index for index in indices: print(df.loc[index])

Output:

The input dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 The rows are: Maths 100 Physics 80 Chemistry 90 Name: 1, dtype: int64 Maths 80 Physics 100 Chemistry 90 Name: 2, dtype: int64 Maths 90 Physics 80 Chemistry 70 Name: 3, dtype: int64

In this example, we have used the loc and the index attribute of the dataframe to iterate through the rows.

The loc attribute can be helpful when we have to iterate through the rows of a dataframe at specific indices. You can select a list of indices and iterate over the rows having those indices using the loc operator without knowing the rows’ position in the dataframe. On the other hand, If you want to iterate through a dataframe using the iloc attribute, you need to know the position of the required rows in the dataframe.

Iterate Rows Using iterrows() Method in Pandas

Instead of using the iloc and loc attributes, you can use the iterrows() method to iterate through rows in a pandas dataframe. 

The iterrows() method, when invoked on a dataframe, returns an iterator object to the rows of the dataframe. After creating the iterator object, you can use a for loop to iterate through the rows of the pandas dataframe as shown below.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}] df=pd.DataFrame(myDicts) print("The input dataframe is:") print(df) print("The rows are:") for row in df.iterrows(): print(row)

Output:

The input dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 The rows are: (0, Roll 1 Maths 100 Physics 80 Chemistry 90 Name: 0, dtype: int64) (1, Roll 2 Maths 80 Physics 100 Chemistry 90 Name: 1, dtype: int64) (2, Roll 3 Maths 90 Physics 80 Chemistry 70 Name: 2, dtype: int64) Conclusion

In this article, we have discussed different ways to iterate through rows of a dataframe in python. 

To learn more about python programming, you can read this article on how to sort a pandas dataframe. You might also like this article on how to drop columns from a pandas dataframe.

I hope you enjoyed reading this article. Stay tuned for more informative articles.

Happy Learning!

The post Iterate Rows in a Pandas Dataframe appeared first on PythonForBeginners.com.

Categories: FLOSS Project Planets

GNU Guix: Meet Guix at FOSDEM

GNU Planet! - Mon, 2023-01-23 08:56

GNU Guix will be present at FOSDEM next week, February 4th and 5th. This is the first time since the pandemic that FOSDEM takes place again “in the flesh” in Brussels, which is exciting to those of us lucky enough to get there! Everything will be live-streamed and recorded thanks to the amazing FOSDEM crew, so everyone can enjoy wherever they are; some of the talks this year will be “remote” too: pre-recorded videos followed by live Q&A sessions with the speaker.

Believe it or not, it’s the 9th year Guix is represented at FOSDEM, with more than 30 talks given in past editions! This year brings several talks that will let you learn more about different areas of the joyful Hydra Guix has become.

This all starts on Saturday, in particular with the amazing declarative and minimalistic computing track:

There are many other exciting talks in this track, some of which closely related to Guix and Guile; check it out!

You can also discover Guix in other tracks:

As was the case pre-pandemic, we are also organizing the Guix Days as a FOSDEM fringe event, a two-day Guix workshop where contributors and enthusiasts will meet. The workshop takes place on Thursday Feb. 2nd and Friday Feb. 3rd at the Institute of Cultural Affairs (ICAB) in Brussels.

Again this year there will be few talks; instead, the event will consist primarily of “unconference-style” sessions focused on specific hot topics about Guix, the Shepherd, continuous integration, and related tools and workflows.

Attendance to the workshop is free and open to everyone, though you are invited to register (there are few seats left!). Check out the workshop’s wiki page for registration and practical info. Hope to see you in Brussels!

About GNU Guix

GNU Guix is a transactional package manager and an advanced distribution of the GNU system that respects user freedom. Guix can be used on top of any system running the Hurd or the Linux kernel, or it can be used as a standalone operating system distribution for i686, x86_64, ARMv7, AArch64, and POWER9 machines.

In addition to standard package management features, Guix supports transactional upgrades and roll-backs, unprivileged package management, per-user profiles, and garbage collection. When used as a standalone GNU/Linux distribution, Guix offers a declarative, stateless approach to operating system configuration management. Guix is highly customizable and hackable through Guile programming interfaces and extensions to the Scheme language.

Categories: FLOSS Project Planets

Mike Driscoll: PyDev of the Week: Fabio Pliger

Planet Python - Mon, 2023-01-23 08:25

This week we welcome Fabio Pliger (@b_smoke) as our PyDev of the Week! Fabio is the creator and tech lead of PyScript. You can see what else Fabio is working on over at GitHub.

Let’s spend a few moments getting to know about Fabio!

Can you tell us a little about yourself (hobbies, education, etc):

I was born in Rio de Janeiro – Brasil, from a big family of Italian immigrants, where I stayed until I was 15 when I moved to Italy, finished my studies, and graduated in Computer Science.

Videogames were one of my biggest passions growing up and probably the main trigger for my interest in computers even if, unfortunately, I don’t have much time to play these days. Other than programming, computers, and video games, photography is one of my current major hobbies these days.

Why did you start using Python?

I started using Python around 2001/2002 when I was working at my very first gig as a programmer. A friend of my boss at the time had a son who was very passionate (and talented) about Python, so my manager asked me to check it out. We became friends, I fell in love with the language and a few years later we founded the Python Italia Association (with other friends) to promote Python and Pycon in Italy.

What other programming languages do you know and which is your favorite?

These days, if I’m not using Python, I mostly program in Javascript or TypeScript. I must say that I definitely enjoy TypeScript more than Javascript. Needless to say, my favorite language remains Python.

In the past, I’ve also worked with Visual Basic, C#, C, and a bit of Caml (which I quite enjoyed) and Java in college but none of them really made me enjoy programming as Python does. I’d definitely enjoy having some time to learn Rust and Go.

What projects are you working on now?

At the moment, I spend most of my time on PyScript and related projects inside Anaconda. More specifically, in PyScript, I’m currently working on its Plugin system that will allow anyone to create pure Python plugins that can extend PyScript functionality and even create new tags. For instance, it’d be really easy to create a new tag (let’s say ) that can interpret Markdown content and translate it to HTML and that can be done in pure Python and in just about 10 lines of code.

Another feature I’m currently starting to work on is a PyScript higher-level interface to the DOM (in Python). It’s currently already possible to interact with the DOM through a very simple API and the native Javascript API (accessible through Pyodide) but we want to create an API that is powerful and yet, very Pythonic and simple to use.

Which Python libraries are your favorite (core or 3rd party)?

Oh.. that’s a really hard question

I can’t name one favorite library. But will name some of my favorites:

  • Conda: when I started using Python (many many maaaaany years ago ) it was such a pain to create Python environments. Conda magic makes it all feel so easy but I still remember the hours and days spent trying to get Python packages and C dependencies to compile on Windows machines, back in the day.
  • Pytest: definitely love writing tests with Pytest. It has a brilliant API and its plugin system is really good. Highly recommend it to anyone who cares about testing their software (which should be everyone
  • Pandas and Numpy: there’s a reason Pandas is so much loved by the data science community. It’s a great framework that allows users to manipulate data and access the power of Numpy with a very accessible interface.
  • Typer and Rich: if you ever had to write a CLI application you probably will love these libraries. They are a mix of simple API that just makes sense and powerful features that would usually require a lot of boilerplate code.
  • FastAPI: from the same author of Typer, FastAPI is a high-performant and modern web framework on top of Starlette and Pydantic (Oh, yeah, I also love Pydantic ) that focuses on user experience alongside performance.

There are many more that I’d love to mention but I realize this list is becoming “way bigger than your one favorite package”. The one common thread you can notice across all these libraries is how easy and user-focused they are. They just make developers’ life much easier with great design and performance.

What’s the origin story of PyScript?

Peter Wang [co-parent of PyScript] and I have been entertaining the idea of democratizing programming and data science for quite some time. A lot of what we do at Anaconda revolves around the idea of making tools more accessible and easier to use. We also often have conversations about current technology, trends, and whatnot.

Python, the most popular programming language in the world today, doesn’t have a very compelling story on the 2 most popular HW and SW systems in the world: phones/tablet devices and the browser. We started to look into it and actually, the eco-system was quite ready for a platform to enable Python on the browser with a simple yet rich interface (with all the progress on browsers, today they are basically a very secure and portable VM and WASM is a very interesting “Virtual OS”). After a few weeks/months of talking about it and doing some research, I started developing a prototype (that got accelerated after Peter was invited to Keynote at Pycon). The rest is history

What are the top 3 things you have learned so far while working on PyScript?

It’s probably a mix of things I’ve learned and confirmation of some things I knew already

  1. If you build something useful, people will come, use and contribute; even if it’s not perfect. It was especially true for when we released the first version of PyScript very quickly for the PyCon announcement. I made several trade-offs that I wouldn’t normally allow (and was extremely worried about) but we were hoping users would love the concept and vision and be forgiven while we paid our tech debt, and that’s what has been happening.
  2. “The web” and Python are 2 very different things. Python in the browser is (and will be for a long time) different: in good and less good ways. WASM (and Python on the browser) are very young technologies and we have a lot to build and learn.
  3. Technology is not the only hard challenge in software development. People and naming things can often be harder. There are lots of great projects out there and we often choose to build yet another version of the same thing instead of building on top of them. If we start communicating more and finding ways to build on top of them we can achieve great things! PyScript is intentionally trying to be additive to the ecosystem rather than competitive.
Is there anything else you’d like to say?

As cheesy as it may sound, I’d really like to thank the Python community. My personal experience is definitely one of these stories that you hear around: “came for the language, stayed for the community”. Yes, Python is great, but its community is just what makes it unique.

Also, WebAssembly is a really interesting and powerful technology. CPython now builds to WASM but there’s so much more we can do to increase support and performance. I really believe that WebAssembly can be the next-gen container technology and it can be what can bring Python to the browser and mobile. As a community Python community should probably start paying a lot of attention to it. That’s why we created PyScript and one of the reasons I invite everyone to try it!

The post PyDev of the Week: Fabio Pliger appeared first on Mouse Vs Python.

Categories: FLOSS Project Planets

Season of KDE 2023: Mentees and Projects

Planet KDE - Mon, 2023-01-23 07:29

By Benson Muite

This year Season of KDE has several projects focusing on the accessibility and sustainability goals. There are three projects focused on accessibility, three on sustainability and three additional projects in other areas.

The sustainability projects had fifteen excellent applicants for just three projects, so selecting mentees was challenging. The time mentee applicants invested in applying is much appreciated, and any applicants who have not been selected are encouraged to continue contributing to KDE and open source. It is possible to make smaller contributions to KDE projects that allow possible mentors to see your work and then mentor you informally.

The projects and their mentees that were officially selected for SoK are listed below.

Sustainability Projects

These projects are related to the Blauer Engel (Blue Angel) for FOSS project, a certification for environmentally friendly open source software. The Blauer Engel project is part of the Global Ecolabelling Network, a non-profit organization that certifies eco-friendliness of products within a particular class, and thus allows users to make informed choices.

Accessibility Projects

These projects aim to allow eveybody to use KDE software and KDE websites by improving their accessibility.

Additional Projects
  • Automate Flatpak checks in GitLab Invent CI
    • Mentors: Timothée Ravier and Aleix Pol
    • Mentee: Neelaksh Singh
  • Brannon Aw will be working on improving the annotation tools in Spectacle (KDE's screenshot app). They will be adding features such as cropping, an eraser tool, and so on. Spectacle: Improving the annotation tools.
    • Mentor: Bharadwaj Raju
    • Mentee: Brannon Aw
  • Plasma: Better holiday support in the digital clock widget.
    • Mentor: Fushan Wen
    • Mentee: Ruoqing He
  • Théophile Gilgien will be working improving Audiotube. He will be working on multiple small features like KRunner integration, ability to play favorite songs as a playlist and more!
    • Mentor: Carl Schwan, Devin Lin & Jonah Brüchert
    • Mentee: Théophile Gilgien
  • Arpit Jain wil be working on the new epub reader, Arianna, which is based on epub.js and QtWebEngine. His knowledge of web-based technologies will be helpful to achieve his goals of syncing the application color scheme to the webengine content, adding settings and adding a table of content.
    • Mentor: Carl Schwan
    • Mentee: Arpit Jain

Good Luck and have Fun!

KDE thanks the mentors and mentees for improving the KDE ecosystem and wishes them a good experience. The KDE community looks forward to learning about the mentees progress through their blog posts.

Categories: FLOSS Project Planets

Matthew Garrett: Build security with the assumption it will be used against your friends

Planet Debian - Mon, 2023-01-23 05:44
Working in information security means building controls, developing technologies that ensure that sensitive material can only be accessed by people that you trust. It also means categorising people into "trustworthy" and "untrustworthy", and trying to come up with a reasonable way to apply that such that people can do their jobs without all your secrets being available to just anyone in the company who wants to sell them to a competitor. It means ensuring that accounts who you consider to be threats shouldn't be able to do any damage, because if someone compromises an internal account you need to be able to shut them down quickly.

And like pretty much any security control, this can be used for both good and bad. The technologies you develop to monitor users to identify compromised accounts can also be used to compromise legitimate users who management don't like. The infrastructure you build to push updates to users can also be used to push browser extensions that interfere with labour organisation efforts. In many cases there's no technical barrier between something you've developed to flag compromised accounts and the same technology being used to flag users who are unhappy with certain aspects of management.

If you're asked to build technology that lets you make this sort of decision, think about whether that's what you want to be doing. Think about who can compel you to use it in ways other than how it was intended. Consider whether that's something you want on your conscience. And then think about whether you can meet those requirements in a different way. If they can simply compel one junior engineer to alter configuration, that's very different to an implementation that requires sign-offs from multiple senior developers. Make sure that all such policy changes have to be clearly documented, including not just who signed off on it but who asked them to. Build infrastructure that creates a record of who decided to fuck over your coworkers, rather than just blaming whoever committed the config update. The blame trail should never terminate in the person who was told to do something or get fired - the blame trail should clearly indicate who ordered them to do that.

But most importantly: build security features as if they'll be used against you.

comments
Categories: FLOSS Project Planets

Ixis.co.uk - Thoughts: Drupal 10 - Everything You Need to Know

Planet Drupal - Mon, 2023-01-23 03:10
Learn everything you need to know about Drupal 10, the latest version of the popular open-source content management system. From new features to best practices, this blog covers it all.
Categories: FLOSS Project Planets

death and gravity: reader 3.4 released – 5 years, 2000 commits

Planet Python - Sun, 2023-01-22 23:41

Hi there!

I'm happy to announce version 3.4 of reader, a Python feed reader library.

More importantly, reader is now 5 years old!

5 years, 2000 commits #

3.3, released in December, marks reader's 5th anniversary and its 2000th commit.

I don't really know what to say, so I'll just say something that maybe will help others.

I'm happy about reader. But more than that, I'm proud of it growing into what it is.

reader started as a hobby and learning project, scratch-your-own-itch kind of thing. Starting off, I had two goals: it should be a library, and it should be for the long term.1

It continued beyond that, into an experiment.

First, on applying Pieter Hintjens' problem-solution approach, and the ideas in the Write code that is easy to delete, not easy to extend and Repeat yourself, do more than one thing, and rewrite everything essays by tef of programming is terrible.

Second, and more mundane, it was an exercise in how testing and type checking keep code maintainable over time. "Everyone knows" they are good things™, but most jobs rarely emphasize the over time part – I know mine at the time didn't. I wanted a place where I could get an intuitive feel for it.

(If you'd like to read more about any of the above, do let me know.)

Judging the success of either is probably highly subjective. Nevertheless, I think they were both wildly successful. reader is still alive and kicking, despite the limited time I have for it, and I've developed habits and ways of solving problems that I'm constantly using in my professional life.

Sure, reader has flaws, and it's definitely not done (what is?), but it's the longest project I've ever worked on, and probably the best code I've ever written.

Finally, I feel I have to say that while not hugely popular, reader is way more popular than I could've dreamt 5 years ago, especially for a niche, but hopefully still relevant topic like web feeds. Thank you!

What's new? #

Here are the highlights since reader 3.0.

Parser internal API #

The parser internal API is fully documented. It continues to be unstable, but this is a huge first step on the road to internal API stabilization.

I started with the parser because it's probably most useful for plugins (for example, the Twitter plugin uses it extensively), or if you want to retrieve and/or parse feeds with reader, but handle storage and so on yourself (here's a recipe for parsing feeds retrieved with HTTPX).

Faster imports #

The time from process start to usable Reader instance is 3x shorter, by postponing update-related imports until actually needed.

Simpler entry sorting #

When sorting by recent, newly added entries now always appear at the top, regardless of their published date, except on a feed's first update.

This replaces a more complicated heuristic that caused entries added to a feed months after their published (yup, that happens!) to never appear at the top (so you would never see them).

Fewer dependencies #

reader is a library, so I try to keep the number of dependencies as small as possible.

Starting with 3.1, the readtime built-in plugin has no dependencies, and it can be used even if lxml is not available (the library I was using before to calculate read time has a transitive dependency on lxml, which does not always have PyPy Windows wheels).

Python versions #

reader 3.3 adds support for Python 3.11.

reader 3.4 drops support for Python 3.8.

Bug fixes #

There were lots of bug fixes, mainly to plugins (I guess that's a good thing).

For more details, see the full changelog.

That's it for now.

Learned something new today? Share this with others, it really helps!

What is reader? #

reader takes care of the core functionality required by a feed reader, so you can focus on what makes yours different.

reader allows you to:

  • retrieve, store, and manage Atom, RSS, and JSON feeds
    • and even follow Twitter accounts
  • mark articles as read or important
  • add arbitrary tags/metadata to feeds and articles
  • filter feeds and articles
  • full-text search articles
  • get statistics on feed and user activity
  • write plugins to extend its functionality

...all these with:

  • a stable, clearly documented API
  • excellent test coverage
  • fully typed Python

To find out more, check out the GitHub repo and the docs, or give the tutorial a try.

Why use a feed reader library? #

Have you been unhappy with existing feed readers and wanted to make your own, but:

  • never knew where to start?
  • it seemed like too much work?
  • you don't like writing backend code?

Are you already working with feedparser, but:

  • want an easier way to store, filter, sort and search feeds and entries?
  • want to get back type-annotated objects instead of dicts?
  • want to restrict or deny file-system access?
  • want to change the way feeds are retrieved by using Requests?
  • want to also support JSON Feed?
  • want to follow Twitter accounts?
  • want to support custom information sources?

... while still supporting all the feed types feedparser does?

If you answered yes to any of the above, reader can help.

Why make your own feed reader? #

So you can:

  • have full control over your data
  • control what features it has or doesn't have
  • decide how much you pay for it
  • make sure it doesn't get closed while you're still using it
  • really, it's easier than you think

Obviously, this may not be your cup of tea, but if it is, reader can help.

  1. A bit more on this here. [return]

Categories: FLOSS Project Planets

Glyph Lefkowitz: A Very Silly Program

Planet Python - Sun, 2023-01-22 22:06

One of the persistently lesser-known symptoms of ADHD is hyperfocus. It is sometimes quasi-accurately described as a “superpower”1 2, which it can be. In the right conditions, hyperfocus is the ability to effortlessly maintain a singular locus of attention for far longer than a neurotypical person would be able to.

However, as a general rule, it would be more accurate to characterize hyperfocus not as an “ability to focus on X” but rather as “an inability to focus on anything other than X”. Sometimes hyperfocus comes on and it just digs its claws into you and won’t let go until you can achieve some kind of closure.

Recently, the X I could absolutely not stop focusing on — for days at a time — was this extremely annoying picture:

Which lead to me writing the silliest computer program I have written in quite some time.

You see, for some reason, macOS seems to prefer YUV422 chroma subsampling3 on external displays, even when the bitrate of the connection and selected refresh rate support RGB.4 Lots of people have been trying to address this for a literal decade5 6 7 8 9 10 11, and the problem has gotten worse with Apple Silicon, where the operating system no longer even supports the EDID-override functionality available on every other PC operating system that supports plugging in a monitor.

In brief, this means that every time I unplug my MacBook from its dock and plug it back in more than 5 minutes later, its color accuracy is destroyed and red or blue text on certain backgrounds looks like that mangled mess in the picture above. Worse, while the color distinction is definitely noticeable, it’s so subtle that it’s like my display is constantly gaslighting me. I can almost hear it taunting me:

Magenta? Yeah, magenta always looked like this. Maybe it’s the ambient lighting in this room. You don’t even have a monitor hood. Remember how you had to use one of those for print design validation? Why would you expect it to always look the same without one?

Still, I’m one of the luckier people with this problem, because I can seem to force RGB / 444 color format on my display just by leaving the display at 120Hz rather than 144, then toggling HDR on and then off again. At least I don’t need to plug in the display via multiple HDMI and displayport cables and go into the OSD every time. However, there is no API to adjust, or even discover the chroma format of your connected display’s link, and even the accessibility features that supposedly let you drive GUIs are broken in the system settings “Displays” panel12, so you have to do it by sending synthetic keystrokes and hoping you can tab-focus your way to the right place.

Anyway, this is a program which will be useless to anyone else as-is, but if someone else is struggling with the absolute inability to stop fiddling with the OS to try and get colors to look correct on a particular external display, by default, all the time, maybe you could do something to hack on this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29import os from Quartz import CGDisplayRegisterReconfigurationCallback, kCGDisplaySetMainFlag, kCGDisplayBeginConfigurationFlag from ColorSync import CGDisplayCreateUUIDFromDisplayID from CoreFoundation import CFUUIDCreateString from AppKit import NSApplicationMain, NSApplicationActivationPolicyAccessory, NSApplication NSApplication.sharedApplication().setActivationPolicy_(NSApplicationActivationPolicyAccessory) CGDirectDisplayID = int CGDisplayChangeSummaryFlags = int MY_EXTERNAL_ULTRAWIDE = '48CEABD9-3824-4674-9269-60D1696F0916' MY_INTERNAL_DISPLAY = '37D8832A-2D66-02CA-B9F7-8F30A301B230' def cb(display: CGDirectDisplayID, flags: CGDisplayChangeSummaryFlags, userInfo: object) -> None: if flags & kCGDisplayBeginConfigurationFlag: return if flags & kCGDisplaySetMainFlag: displayUuid = CGDisplayCreateUUIDFromDisplayID(display) uuidString = CFUUIDCreateString(None, displayUuid) print(uuidString, "became the main display") if uuidString == MY_EXTERNAL_ULTRAWIDE: print("toggling HDR to attempt to clean up subsampling") os.system("/Users/glyph/.local/bin/desubsample") print("HDR toggled.") print("registered", CGDisplayRegisterReconfigurationCallback(cb, None)) NSApplicationMain([])

and the linked desubsample is this atrocity, which I substantially cribbed from this helpful example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39#!/usr/bin/osascript use AppleScript version "2.4" -- Yosemite (10.10) or later use framework "Foundation" use framework "AppKit" use scripting additions tell application "System Settings" quit delay 1 activate current application's NSWorkspace's sharedWorkspace()'s openURL:(current application's NSURL's URLWithString:"x-apple.systempreferences:com.apple.Displays-Settings.extension") delay 0.5 tell application "System Events" tell process "System Settings" key code 48 key code 48 key code 48 delay 0.5 key code 49 delay 0.5 -- activate hdr on left monitor set hdr to checkbox 1 of group 3 of scroll area 2 of ¬ group 1 of group 2 of splitter group 1 of group 1 of ¬ window "Displays" tell hdr click it delay 1.0 if value is 1 click it end if end tell end tell end tell quit end tell

This ridiculous little pair of programs does it automatically, so whenever I reconnect my MacBook to my desktop dock at home, it faffs around with clicking the HDR button for me every time. I am leaving it running in a background tmux session so — hopefully — I can finally stop thinking about this.

  1. https://totallyadd.com/5-superpowers-of-adhd/ 

  2. https://kids.frontiersin.org/articles/10.3389/frym.2021.625433 

  3. https://en.wikipedia.org/wiki/Chroma_subsampling#4:2:2 

  4. You can see this stack overflow question for all of the gory details. 

  5. https://gist.github.com/adaugherity/7435890 

  6. https://forums.macrumors.com/threads/why-is-getting-4k-ycbcr444-even-60hz-so-difficult.2282601/ 

  7. https://forums.macrumors.com/threads/is-chroma-4-4-4-working.2146335/ 

  8. https://www.mathewinkson.com/2013/03/force-rgb-mode-in-mac-os-x-to-fix-the-picture-quality-of-an-external-monitor/ 

  9. https://www.dpreview.com/forums/thread/4578217 

  10. https://www.reddit.com/r/mac/comments/nh3rxp/m1_mac_external_monitordisplay_force_switch_from/ 

  11. https://github.com/sudowork/fix_m1_rgb 

  12. Thanks, SwiftUI System Preferences rewrite. System Settings is the biggest possible advertisement to developers for the idea that you should just stick with Cocoa if you want your Mac users to have a good time

Categories: FLOSS Project Planets

Brian Okken: Fixing Circular Imports in Python with Protocol

Planet Python - Sun, 2023-01-22 19:00
The problem started when I had two classes that needed to talk to each other. Sometimes, classes need to talk to each other in both directions. The following example is made up, but mostly behaves like the original problem. Let’s say I have a Director and an Actor. The Director tells the Actor to do_action(). In order to do the action, the Actor needs to get_data() from the Director. Here’s our director.
Categories: FLOSS Project Planets

Petter Reinholdtsen: Opensnitch, the application level interactive firewall, heading into the Debian archive

Planet Debian - Sun, 2023-01-22 17:55

While reading a blog post claiming MacOS X recently started scanning local files and reporting information about them to Apple, even on a machine where all such callback features had been disabled, I came across a description of the Little Snitch application for MacOS X. It seemed like a very nice tool to have in the tool box, and I decided to see if something similar was available for Linux.

It did not took long to find the OpenSnitch package, which has been in development since 2017, and now is in version 1.5.0. It has had a request for Debian packaging since 2018, but no-one completed the job so far. Just for fun, I decided to see if I could help, and I was very happy to discover that upstream want a Debian package too.

After struggling a bit with getting the program to run, figuring out building Go programs (and a little failed detour to look at eBPF builds too - help needed), I am very happy to report that I am sponsoring upstream to maintain the package in Debian, and it has since this morning been waiting in NEW for the ftpmasters to have a look. Perhaps it can get into the archive in time for the Bookworm release?

As usual, if you use Bitcoin and want to show your support of my activities, please send Bitcoin donations to my address 15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.

Categories: FLOSS Project Planets

Jonathan Dowland: Barbie crowns

Planet Debian - Sun, 2023-01-22 16:14

My daughters have had great fun designing and printing crowns for their Barbies. We've been through several design iterations, and several colour choices. Not all Barbies have the same head circumference. Real crowns probably don't have a perfectly circular internal shape.

They changed their minds on the green crown soon after it finished, but we managed to find a grateful recipient.

Categories: FLOSS Project Planets

#! code: Drupal 10: Creating Custom Context Providers

Planet Drupal - Sun, 2023-01-22 13:49

I previously looked at injecting context providers into context aware plugins. This time I will explore more about creating our own context providers to plug into this system.

The context provider system is an ideal way to provide context to context aware plugins, with blocks being the prime example. You would use a context provider to inject an entity or value into the block so that actions can be taken using that data.

For example, we could load the current node from the route using context so that we didn't have to bake the route provider logic into the block.

The values we inject also plug into the cache systems and so we don't need to worry about making sure we integrate the cache systems for each type of context within the block system. Cache contexts is all taken care of in the block plugin code.

In this article I will look at why you might want to create a context provider, how to create one, and some examples of them in use.

By default, Drupal comes with the following context providers:

  • Current language context (provided by \Drupal\Core\Language\ContextProvider\CurrentLanguageContext).
  • The node entity from the current route (provided by \Drupal\node\ContextProvider\NodeRouteContext).
  • The taxonomy term entity from the current route (provided by \Drupal\taxonomy\ContextProvider\TermRouteContext).
  • The current user (provided by \Drupal\user\ContextProvider\CurrentUserContext).

This gives us a variety of contexts that are commonly used, but there are many reasons why we would want to create our own context providers. Here are some examples of potential contexts we could create using this system.

Read more

Categories: FLOSS Project Planets

parallel @ Savannah: GNU Parallel 20230122 ('Bolsonaristas') released [stable]

GNU Planet! - Sun, 2023-01-22 13:17

GNU Parallel 20230122 ('Bolsanaristas') has been released. It is available for download at: lbry://@GnuParallel:4

Quote of the month:

  Colorful output
  parallel, with --color flag
  tasks more vibrant now
    -- ChatGPT

New in this release:

  • Bug fixes and man page updates.

News about GNU Parallel:

GNU Parallel - For people who live life in the parallel lane.

If you like GNU Parallel record a video testimonial: Say who you are, what you use GNU Parallel for, how it helps you, and what you like most about it. Include a command that uses GNU Parallel if you feel like it.

About GNU Parallel

GNU Parallel is a shell tool for executing jobs in parallel using one or more computers. A job can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe. GNU Parallel can then split the input and pipe it into commands in parallel.

If you use xargs and tee today you will find GNU Parallel very easy to use as GNU Parallel is written to have the same options as xargs. If you write loops in shell, you will find GNU Parallel may be able to replace most of the loops and make them run faster by running several jobs in parallel. GNU Parallel can even replace nested loops.

GNU Parallel makes sure output from the commands is the same output as you would get had you run the commands sequentially. This makes it possible to use output from GNU Parallel as input for other programs.

For example you can run this to convert all jpeg files into png and gif files and have a progress bar:

  parallel --bar convert {1} {1.}.{2} ::: *.jpg ::: png gif

Or you can generate big, medium, and small thumbnails of all jpeg files in sub dirs:

  find . -name '*.jpg' |
    parallel convert -geometry {2} {1} {1//}/thumb{2}_{1/} :::: - ::: 50 100 200

You can find more about GNU Parallel at: http://www.gnu.org/s/parallel/

You can install GNU Parallel in just 10 seconds with:

    $ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
       fetch -o - http://pi.dk/3 ) > install.sh
    $ sha1sum install.sh | grep 883c667e01eed62f975ad28b6d50e22a
    12345678 883c667e 01eed62f 975ad28b 6d50e22a
    $ md5sum install.sh | grep cc21b4c943fd03e93ae1ae49e28573c0
    cc21b4c9 43fd03e9 3ae1ae49 e28573c0
    $ sha512sum install.sh | grep ec113b49a54e705f86d51e784ebced224fdff3f52
    79945d9d 250b42a4 2067bb00 99da012e c113b49a 54e705f8 6d51e784 ebced224
    fdff3f52 ca588d64 e75f6033 61bd543f d631f592 2f87ceb2 ab034149 6df84a35
    $ bash install.sh

Watch the intro video on http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1

Walk through the tutorial (man parallel_tutorial). Your command line will love you for it.

When using programs that use GNU Parallel to process data for publication please cite:

O. Tange (2018): GNU Parallel 2018, March 2018, https://doi.org/10.5281/zenodo.1146014.

If you like GNU Parallel:

  • Give a demo at your local user group/team/colleagues
  • Post the intro videos on Reddit/Diaspora*/forums/blogs/ Identi.ca/Google+/Twitter/Facebook/Linkedin/mailing lists
  • Get the merchandise https://gnuparallel.threadless.com/designs/gnu-parallel
  • Request or write a review for your favourite blog or magazine
  • Request or build a package for your favourite distribution (if it is not already there)
  • Invite me for your next conference

If you use programs that use GNU Parallel for research:

  • Please cite GNU Parallel in you publications (use --citation)

If GNU Parallel saves you money:

About GNU SQL

GNU sql aims to give a simple, unified interface for accessing databases through all the different databases' command line clients. So far the focus has been on giving a common way to specify login information (protocol, username, password, hostname, and port number), size (database and table size), and running queries.

The database is addressed using a DBURL. If commands are left out you will get that database's interactive shell.

When using GNU SQL for a publication please cite:

O. Tange (2011): GNU SQL - A Command Line Tool for Accessing Different Databases Using DBURLs, ;login: The USENIX Magazine, April 2011:29-32.

About GNU Niceload

GNU niceload slows down a program when the computer load average (or other system activity) is above a certain limit. When the limit is reached the program will be suspended for some time. If the limit is a soft limit the program will be allowed to run for short amounts of time before being suspended again. If the limit is a hard limit the program will only be allowed to run when the system is below the limit.

Categories: FLOSS Project Planets

Dirk Eddelbuettel: Rcpp 1.0.10 on CRAN: Regular Update

Planet Debian - Sun, 2023-01-22 10:51

The Rcpp team is thrilled to announce the newest release 1.0.10 of the Rcpp package which is hitting CRAN now and will go to Debian shortly. Windows and macOS builds should appear at CRAN in the next few days, as will builds in different Linux distribution and of course at r2u. The release was prepared a few days ago, but given the widespread use at CRAN it took a few days to be processed. As always, our sincere thanks to the CRAN maintainers Uwe Ligges and Kurt Hornik. This release continues with the six-months cycle started with release 1.0.5 in July 2020. As a reminder, we do of course make interim snapshot ‘dev’ or ‘rc’ releases available via the Rcpp drat repo and strongly encourage their use and testing—I run my systems with these versions which tend to work just as well, and are also fully tested against all reverse-dependencies.

Rcpp has become the most popular way of enhancing R with C or C++ code. Right now, around 2623 packages on CRAN depend on Rcpp for making analytical code go faster and further, along with 252 in BioConductor. On CRAN, 13.7% of all packages depend (directly) on CRAN, and 58.7% of all compiled packages do. From the cloud mirror of CRAN (which is but a subset of all CRAN downloads), Rcpp has been downloaded 67.1 million times.

This release is incremental as usual, preserving existing capabilities faithfully while smoothing our corners and / or extending slightly. Of particular note is the now fully-enabled use of the ‘unwind’ protection making some operations a little faster by default; special thanks to Iñaki for spearheading this. Kevin and I also polished a few other bugs off as detailed below.

The full list of details follows.

Changes in Rcpp release version 1.0.10 (2023-01-12)
  • Changes in Rcpp API:

    • Unwind protection is enabled by default (Iñaki in #1225). It can be disabled by defining RCPP_NO_UNWIND_PROTECT before including Rcpp.h. RCPP_USE_UNWIND_PROTECT is not checked anymore and has no effect. The associated plugin unwindProtect is therefore deprecated and will be removed in a future release.

    • The 'finalize' method for Rcpp Modules is now eagerly materialized, fixing an issue where errors can occur when Module finalizers are run (Kevin in #1231 closing #1230).

    • Zero-row data.frame objects can receive push_back or push_front (Dirk in #1233 fixing #1232).

    • One remaining sprintf has been replaced by snprintf (Dirk and Kevin in #1236 and #1237).

    • Several conversion warnings found by clang++ have been addressed (Dirk in #1240 and #1241).

  • Changes in Rcpp Attributes:

    • The C++20, C++2b (experimental) and C++23 standards now have plugin support like the other C++ standards (Dirk in #1228).

    • The source path for attributes received one more protection from spaces (Dirk in #1235 addressing #1234).

  • Changes in Rcpp Deployment:

    • Several GitHub Actions have been updated.

Thanks to my CRANberries, you can also look at a diff to the previous release. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page. Bugs reports are welcome at the GitHub issue tracker as well (where one can also search among open or closed issues); questions are also welcome under rcpp tag at StackOverflow which also allows searching among the (currently) 2932 previous questions.

If you like this or other open-source work I do, you can sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Categories: FLOSS Project Planets

Dirk Eddelbuettel: BH 1.81.0-1 oon CRAN: New Upstream, New Library, sprintf Change

Planet Debian - Sun, 2023-01-22 10:14

Boost is a very large and comprehensive set of (peer-reviewed) libraries for the C++ programming language, containing well over one hundred individual libraries. The BH package provides a sizeable subset of header-only libraries for (easier, no linking required) use by R. It is fairly widely used: the (partial) CRAN mirror logs (aggregated from the cloud mirrors) show over 32.6 million package downloads.

Version 1.81.0 of Boost was released in December following the regular Boost release schedule of April, August and December releases. As the commits and changelog show, we packaged it almost immediately and started testing following our annual update cycle which strives to balance being close enough to upstream and not stressing CRAN and the user base too much. The reverse depends check revealed about a handful of packages requiring changes or adjustments which is a pretty good outcome given the over three hundred direct reverse dependencies. So we opened issue #88 to coordinate the issue over the winter break during which CRAN also closes (just as we did before), and also send a wider ‘PSA’ tweet as a heads-up. Our sincere thanks to the two packages that already updated, and the four that likely will soon. Our thanks also to CRAN for reviewing the package impact over the last few days since I uploaded the package earlier this week.

There are a number of changes I have to make each time in BH, and it is worth mentioning them. Because CRAN cares about backwards compatibility and the ability to be used on minimal or older systems, we still adjust the filenames of a few files to fit a jurassic constraints of just over a 100 characters per filepath present in some long-outdated versions of tar. Not a big deal. We also, and that is more controversial, silence a number of #pragma diagnostic messages for g++ and clang++ because CRAN insists on it. I have no choice in that matter. Next, and hopefully this time only, we also found and replaced a few remaining sprintf uses and replaced them with snprintf. Many of the Boost libraries did that, so I hope by the next upgrade for Boost 1.84.0 next winter this will be fully taken care of. Lastly, and also only this time, we silenced a warning about Boost switching to C++14 in the next release 1.82.0 in April. This may matter for a number of packages having a hard-wired selection of C++11 as their C++ language standard. Luckily our compilers are good enough for C++14 so worst case I will have to nudge a few packages next December.

This release adds one new library for url processing which struck us as potentially quite useful. The more detailed NEWS log follows.

Changes in version 1.81.0-1 (2023-01-17)
  • Upgrade to Boost 1.81.0 (#87)

  • Added url (new in 1.81.0)

  • Converted remaining sprintf to snprintf (#90 fixing #89)

  • Comment-out gcc warning messages in three files

Via my CRANberries, there is a diffstat report relative to the previous release.

Comments and suggestions about BH are welcome via the issue tracker at the GitHub repo.

If you like this or other open-source work I do, you can now sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Categories: FLOSS Project Planets

Codementor: How I learned Python (from scratch) 🐍

Planet Python - Sun, 2023-01-22 07:25
About me Please see my background section in my profile 🤓 Why I wanted to learn Python (from scratch) 🐍 I first became interested in learning Python when I was searching for a programming language...
Categories: FLOSS Project Planets

Pages