Modernize scripts to Python 3 and add recent distribution releases#2
Modernize scripts to Python 3 and add recent distribution releases#2Vai-Man wants to merge 2 commits intoosrf:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Python scripts for Python 3 compatibility and updates distribution lists to include recent Ubuntu, Debian, and ROS 2 releases. The changes ensure the scripts can process download statistics for newer platform releases.
Changes:
- Updated shebangs from
pythontopython3in analyze_awstats.py and analyze_edits.py - Migrated from deprecated
urllib.unquote()tourllib.parse.unquote()for Python 3 compatibility - Added 9 new Ubuntu releases (groovy through noble), 2 Debian releases (bookworm, trixie), and 2 ROS 2 releases (iron, jazzy)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/analyze_edits.py | Updated shebang to python3 |
| scripts/analyze_awstats.py | Updated shebang to python3, migrated urllib import, and expanded distro lists with recent releases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
scripts/analyze_awstats.py
Outdated
| UBUNTU_DISTROS = ['precise', 'quantal', 'raring', 'saucy', 'trusty', 'utopic', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful', 'bionic', 'cosmic', 'disco', 'eoan', 'focal', 'groovy', 'hirsute', 'impish', 'jammy', 'kinetic', 'lunar', 'mantic', 'noble'] | ||
| DEBIAN_DISTROS = ['jessie', 'stretch', 'buster', 'bullseye', 'bookworm', 'trixie'] | ||
| OS_DISTROS = UBUNTU_DISTROS + DEBIAN_DISTROS | ||
| ARCHES = ['i386', 'amd64', 'armhf', 'arm64', 'source'] | ||
| ROS1_DISTROS = ['boxturtle', 'cturtle', 'diamondback', 'electric', 'fuerte', 'groovy', 'hydro', 'indigo', 'jade', 'kinetic', 'lunar', 'melodic', 'noetic'] |
There was a problem hiding this comment.
The newly added Ubuntu releases 'groovy', 'kinetic', and 'lunar' create naming conflicts with existing ROS1 distros that have the same names (line 11). The get_distro_from_url function (line 60-65) uses a simple substring match (if distro in url) to identify OS distros, which could cause incorrect identification when these conflicting names appear in URLs. This could lead to misattribution of download statistics. Consider whether these Ubuntu releases should be excluded from the list, or if get_distro_from_url needs to be updated to use more precise matching logic to differentiate between OS and ROS distros.
This PR modernizes the codebase for Python 3 compatibility and updates distro lists with recent releases.
Updates
Python 3 Modernization:
#!/usr/bin/env python3inanalyze_awstats.pyandanalyze_edits.pyurllib.unquote()by importing fromurllib.parseUpdated Distribution Lists: