Python Monthly News

Python News: What's New From June 2022

by Martin Breuss community

June 2022 brought a flurry of exciting news for the Python community! The PSF received funding for a new role focused on security, and held elections for four seats on the board of directors. Results from two important developer surveys were published, and new versions of both Python and some popular packages saw the light of day.

PEP 691 got accepted, extending the Simple API for Python packaging indexes. With the Python 3.12 change page live, you can now start hitting refresh to be the first to know about upcoming features and deprecations in next year’s major Python release.

With summer in full swing, there have also been more in-person meetups in the Python community, and others are still to come.

Let’s dive into the biggest Python news from the past month!

The Python Software Foundation Has News

The Python Software Foundation (PSF) is the organization behind Python. It aims to “promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers” (Source).

If you haven’t heard of the PSF before, make sure to check out the PSF blog, which you’ll see linked a few times in this news article.

PSF Elects New Board Directors

Elections to fill four seats on the PSF board of directors took place during the second half of June. A term for a seat on the PSF board of directors lasts for three years, and directors are eligible for reelection. To vote in this election, you had to be a registered PSF member with voting rights.

This year, there were a lot of nominees, and the seats were filled with the four nominees who received the most votes:

  1. Kushal Das
  2. Jannis Leidel
  3. Dawn Wages
  4. Simon Willison

If you’re curious what it means to serve on the PSF board and what a director’s duties are, then you can watch a video in which three board members describe Life as a Python Software Foundation Director.

Congratulations to the new and returning board directors, and big thanks to all the other nominees for their continued engagement in the Python community.

PSF Releases 2021 Annual Report

This month, the PSF also released its 2021 annual report. Last year marked the twentieth anniversary of the Python Software Foundation, and the thirtieth anniversary for Python itself:

A page from the annual report of the PSF for 2021, showing some highlights of the year

The report highlights how four team members joined the PSF in new roles during 2021. Python packaging and CPython itself received strong support through the dedicated roles of Packaging Project Manager and Developer in Residence. Funding for event grants started up again, with a focus on online events. The PSF also organized PyCon US 2021 as a fully online event.

If you’re curious to learn more, then you can read the full report online.

OpenSSF Funds A Security Role for the Python Ecosystem

Sadly not for the first time, there was another set of malicious packages identified on PyPI. Because Python is used by such a large community worldwide, such attacks can have dangerous and wide-reaching consequences. In the news article linked above, you’ll see that these packages aimed to expose programmers’ secrets.

Therefore, it’s great news that the Open Source Security Foundation (OpenSSF) has decided to fund a new role in the PSF.

The person filling the role will have a chance to positively impact the current state of security in the wider Python ecosytem as they “provide security expertise for Python, the Python Package Index (PyPI), and the rest of the Python ecosystem” (Source).

The grant money will also be used to complete a security audit on critical open source infrastructure in the Python ecosystem, such as PyPI and the CPython source code itself. Having a dedicated role and financing will hopefully go a long way in boosting security for Python’s large global community.

Survey Results Are In!

Maybe you participated in a developer survey in the past, or you like to skim the results to get an idea of where the community is headed. In June, the results of two important developer survey were published.

Python Developer Survey

In the beginning of the month, the PSF announced the results of the fifth annual Python Developers Survey, which was a collaboration between the PSF and JetBrains.

You can view some of the results of the survey with visualizations on the dedicated web page, or you can crack your data analysis knuckles and see what you can find in the raw data.

For the first time, explicit questions about Python packaging were included in the survey:

A graph showing the distribution of what dependency tools Python developers prefer to use

By a slim margin, Poetry is the most popular tool for dependency management, alongside Pipenv and pip-tools.

In the section about Python packaging, you can also see that pip and venv are the most popular tools related to packaging and that most developers record their project dependencies in a requirements.txt file.

Python developers primarily publish their packages to PyPI, even though 37 percent of the respondents state that they publish packages to a private Python package index. With PEP 691 accepted, will some of them move to hosting package information in JSON in the future?

While there aren’t any big suprises in the survey results, the data helps the Python core developers, the Packaging Project Manager, and others in their work.

Next, take a look at the state of the wider developer community!

StackOverflow’s Developer Survey

This year’s StackOverflow developer survey was conducted in May, and over seventy thousand developers participated. They shared opinions about favorite tools, educational background, likes and dislikes, and more!

Python got some love from the wider developer community as well:

Rust […] ties with Python as the most wanted technology with TypeScript running a close second. (Source)

Python also almost tied with HTML/CSS and JavaScript as the most popular language for newcomers who are starting to learn programming. But what about packages in the Python ecosystem?

Because Python is popular among people who are learning to code, packages such as NumPy and pandas are also more popular among newcomers as compared to professional developers.

In terms of web frameworks, developers love FastAPI, and there’s a lot of interest in learning it and using FastAPI to build web APIs.

Did you find anything else that was especially interesting in the developer survey results? If you did, please share your findings in the comments below.

The Python Ecosystem Issues New Releases

Almost every month, several new versions of notable Python packages, or even Python itself, are released. They typically add new features, fix bugs, correct security issues, and more. June 2022 was no exception. You now have several new releases to test, use, and enjoy. Read on to learn more!

Python 3.11.0b3 Expedited

The previous beta release of Python 3.11 (3.11.0b2) had an incompatibilty with pytest. Due to changes in the compiler and AST nodes in Python 3.11, the AST nodes that pytest rewrites by default ended up being invalid.

To avoid requiring users to modify their test suite, the Python 3.11 release team decided to create this extra beta release, which solves this issue. This decision bumps the total number of beta releases for 3.11 from four to five.

You can read more details about 3.11.0b3 on the blog page that announced the expedited release on June 1.

Python 3.10.5 Maintenance

At the beginning of June, the release team also announced the fifth maintenance release of Python 3.10, Python 3.10.5:

This release packs more than 230 bugfixes and docs changes, so you surely want to update :) (Source)

If you’re still on any of the earlier release versions, go get your update to fully enjoy all the new features in Python 3.10 without running into issues that have already been reported and solved.

Django 4.0.5 Bugfix and 4.1 Beta 1

Django kicked off June with the bugfix release of Django 4.0.5, fixing several bugs that were present in 4.0.4.

Later in the month, the Django project announced an exciting update by releasing Django 4.1 beta 1. This release means that all major new features for Django 4.1 are now locked and “only bugs in new features and regressions from earlier versions of Django will be fixed between now and 4.1 final” (Source).

If you’re itching to peek at the many new features coming in Django 4.1, then you can now install Django 4.1 beta 1 and try them out! Make sure to report any bugs you find back to the Django team to help them fix any leftover issues during the development phase.

Requests 2.28.0 and 2.28.1

Requests also issued two new releases this month. In addition to some improvements and bug fixes, the project also dropped support for Python 2.7 and Python 3.6 in 2.28.0, following the suggestion in GitHub PR 6091. This means that new versions of requests won’t support any version of Python 2.x anymore.

The end of the month brought another release with 2.28.1, which added speed optimization in iter_content with transition to yield from.

Python 3.12 Change Page Goes Live

The page describing what’s new in Python 3.12 went live. At the time of writing, there aren’t any new features listed, but you can browse a list of deprecations that will come into effect with the next Python release.

One interesting oddity that has been discussed for a long time is set to take the next step towards producing a visible error:

Currently Python accepts numeric literals immediately followed by keywords, for example 0in x, 1or x, 0if 1else 2. It allows confusing and ambiguous expressions like [0x1for x in y] (which can be interpreted as [0x1 for x in y] or [0x1f or x in y]). A syntax warning is raised if the numeric literal is immediately followed by one of keywords and, else, for, if, in, is and or. In a future release it will be changed to a syntax error.

If you run one of these code examples using an older Python interpreter, then you won’t see any warnings. In 3.11 it raises a DeprecationWarning that you only get to see when you run Python in Development Mode:

Shell
$ python -X dev

Once you’ve started Python 3.11 in Development Mode, you can run the examples to see the DeprecationWarning:

Python
>>> [0x1for x in (1, 2)]
<stdin>:1: DeprecationWarning: invalid hexadecimal literal
[31]

In 3.12, the silent DeprecationWarning will change to a non-silent SyntaxWarning to give you a heads-up when you’re playing around with such shenanigans. As mentioned in the quote further up, the core developers are planning to change this SyntaxWarning into a SyntaxError in a later release.

The “What’s New in Python” pages keep getting updated until the release of that Python version rolls around. Can you find any other interesting deprecations or changes? If there’s one you’d like to discuss, then leave a comment below!

PEP 691 Brings a JSON-Based Simple API for Python Package Indexes

PEP 691 introduces a JSON-based Simple API that allows Python package indexes to use JSON instead of HTML.

This PEP represents a change to the Simple API, which is an interface for Python package indexes. This API is primarily used by installers and resolvers, such as pip, when fetching information about packages for installation.

The JSON-based Simple API is primarily meant as a more machine-friendly alternative to the existing HTML-based Simple API, and therefore refrains from introducing new functionality.

For example, a release of a package on the HTML-based Simple API will need to have all the information about a file contained in an HTML link element:

HTML
<a href="https://files.pythonhosted.org/packages/7a/93/551e43aefa86a6f57e1852d60568024e12a20f5f9bf316a37fc869c0c274/barbican-14.0.0.tar.gz#sha256=1a034410189d045974bf70b703ecdce17c1a7b6a14814541e05ba5cb34f6e419"
   data-requires-python=">=3.6">
    barbican-14.0.0.tar.gz
</a>

The same information served through the JSON-based Simple API is more straightforward to parse:

JSON
{
    "filename": "barbican-14.0.0.tar.gz",
    "hashes": {
        "sha256": "1a034410189d045974bf70b703ecdce17c1a7b6a14814541e05ba5cb34f6e419"
    },
    "requires-python": ">=3.6",
    "url": "https://files.pythonhosted.org/packages/7a/93/551e43aefa86a6f57e1852d60568024e12a20f5f9bf316a37fc869c0c274/barbican-14.0.0.tar.gz",
    "yanked": false
}

You may also spot that there’s actually one new feature as compared to the HTML-based Simple API. By encoding "hashes" as a JSON object, the JSON-based Simple API allows you to include multiple hashes for each file. This isn’t possible with the URL query parameter of the HTML-based simple API.

If you’re a Python end user, then this change will most likely not affect you at all. If you’re a maintainer of a custom Python packaging index, then the addition of the JSON-based Simple API gives you three options:

  1. Do nothing and continue serving package information with the Simple API using text/html as the content type.
  2. Decide to serve package information either in HTML or JSON, using one of the two newly introduced content types:
    1. JSON: application/vnd.pypi.simple.v1+json
    2. HTML: application/vnd.pypi.simple.v1+html
  3. Implement both and decide through content negotiation which version to send back to your users.

In short, PEP 691 is strictly an addition to the long-standing PEP 503 - Simple Repository API and its additions. PyPI won’t drop HTML support, and you can still use a static server to host your custom package index.

If you’re hosting a private Python package index and you don’t want to bother implementing HTML responses, then you can do this now with the new JSON-based Simple API. However, the main benefit from this PEP probably still lies in the future:

This gives us full permission to effectively freeze the HTML API in place, never adding another feature to it, while we start adding new features to the JSON API, freeing us from having to worry about how we can encode something that we want to add into HTML. (Source)

Are there any features of the current HTML-based Simple API that you’ve been sorely missing and that you’d want to see implemented in the JSON-based API? If you have thoughts or suggestions, leave a comment below.

The Python Community Gets Together Again

Like most communities, the Python community benefits when people can meet and converse, including offline! If you’d like to meet other people who work with Python in your area, then take a look at the PyCon calendar.

Also keep in mind that the COVID pandemic isn’t over. Stay safe and be respectful toward others, especially your country’s health care workers.

In-Person Python Meetups Happen Worldwide

PyCon US is over, but there are many other Python community meetings taking place during the summer and beyond. In June, at least three officially announced in-person Python conferences took place:

  1. PyCon Italia in Florence, June 2–5
  2. GeoPython in Basel, June 20–22
  3. PyCon Israel in Tel Aviv, June 28–29

In-person conferences present a great opportunity to meet other like-minded people and connect over shared projects and interests. If you think that you may be ready to mingle responsibly, then take a look at the PyCon calendar to find out about Python conferences and meetups near you.

Tickets for EuroSciPy Become Available

If you live in Europe and work with Python in a scientific field, you might be interested in joining this year’s EuroSciPy. The conference will take place in Basel, Switzerland, from August 29 to September 2.

The five-day event will gather eighty speakers, and you’ll be able to select from twenty-four workshops:

A group of people in the background are overlayed with short statistics about EuroSciPy 2022

Or you can opt out of the workshops altogether and do the hallway track instead—it’s up to you!

Tickets for the fourteenth European Conference on Python in Science are now available for purchase.

PyCon US Tutorial Recordings Available Online

Tutorial recordings from PyCon US 2022 have landed on the PyCon YouTube page:

Tweet announcing that PyCon 2022 Tutorial Recordings have been uploaded to the PyCon YouTube account

Unless you have a time-turner, you couldn’t have possibly joined all the tutorials at PyCon, even if you were lucky enough to go there in person. Take a look at the recordings and share in the comments which ones you’ve found the most interesting and which ones you’d recommend that others watch.

Miscellaneous News

Like always, there’s more that happened in the world of Python. In this final section, you can read about some stories that made the news online.

Anaconda Acquires PythonAnywhere

The software development and consulting company Anaconda, Inc., best known for their widely used Anaconda Python distribution, acquired the cloud-based Python development and hosting environment PythonAnywhere.

According to Anaconda’s news page, PythonAnywhere will “continue to evolve as a standalone product as Anaconda and PythonAnywhere work together to simplify the development and hosting of Python users’ workloads and applications” (Source).

Users of both platforms may soon benefit from improved integration between the two products.

GitHub Sunsets the Atom Text Editor

The Atom text editor has been a much-loved text editor since its inception in 2014. Due to a decline in Atom’s popularity and internal refocusing on other tools and services, GitHub has decided to stop any development on the project and archive all repositories of the Atom organization on December 15.

The official announcement of this decision by GitHub includes a paragraph that honors Atom’s influence on today’s world of text editors:

This is a tough goodbye. It’s worth reflecting that Atom has served as the foundation for the Electron framework, which paved the way for the creation of thousands of apps, including Microsoft Visual Studio Code, Slack, and our very own GitHub Desktop. (Source)

Current Atom users will have six months to switch to using a different product. If you’ve worked with Atom and you’re looking to make the switch to a different code editor, using Visual Studio Code for Python development will likely feel familiar.

What’s Next for Python?

So, what’s your favorite piece of Python news from June? Did we miss anything notable? Will you set up your own package index and experiment with serving JSON? What do you think about improving security in the Python ecosystem? Do you plan to attend a Python conference in 2022? Let us know in the comments!

Happy Pythoning!

🐍 Python Tricks 💌

Get a short & sweet Python Trick delivered to your inbox every couple of days. No spam ever. Unsubscribe any time. Curated by the Real Python team.

Python Tricks Dictionary Merge

About Martin Breuss

Martin likes automation, goofy jokes, and snakes, all of which fit into the Python community. He enjoys learning and exploring and is up for talking about it, too. He writes and records content for Real Python and CodingNomads.

» More about Martin

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Master Real-World Python Skills With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

Master Real-World Python Skills
With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

What Do You Think?

Rate this article:

What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment below and let us know.

Commenting Tips: The most useful comments are those written with the goal of learning from or helping out other students. Get tips for asking good questions and get answers to common questions in our support portal.


Looking for a real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!

Keep Learning

Related Topics: community