Skip to content

Update project environment and dependencies to Python 3.12 - #314

Open
Priyankm23 wants to merge 1 commit into
creativecommons:mainfrom
Priyankm23:update-python-version-214
Open

Priyankm23 wants to merge 1 commit into
creativecommons:mainfrom
Priyankm23:update-python-version-214

Conversation

@Priyankm23

Copy link
Copy Markdown

Fixes

Description

This PR addresses #214 by updating the project Python environment and dependencies to Python 3.12.

Python 3.12 is targeted instead of 3.13 because all project dependencies (pandas, matplotlib, lxml, protobuf, google-api-python-client) have stable pre-built wheels, it matches Ubuntu 24.04 LTS defaults, and it adds the PEP 695 typing syntax needed for static typing in #212.

Technical details

  • Updated Pipfile to require Python 3.12.
  • Regenerated Pipfile.lock to lock SHA-256 package hashes and markers for Python 3.12 wheels.
  • Updated .pre-commit-config.yaml default language version to python3.12.
  • Updated GitHub Actions workflows (static_analysis.yml, test_scripts_help.yml, 1-fetch.yml, 2-process.yml.disabled, 3-report.yml.disabled) to use Python 3.12.
  • No other feature changes included.

Tests

Tested locally on Ubuntu 24.04 (WSL) with Python 3.12.3 and Pipenv 2026.9.1:

  • Ran ./dev/test_scripts_help.sh — all 14 scripts passed (exit code 0).
  • Ran flake8, isort --check-only ., black --check ., and git diff --check (0 errors).
  • Dry-ran scripts/3-report/zzz-notes.py --quarter 2026Q3 and scripts/2-process/wikipedia_process.py --quarter 2026Q3 (both completed cleanly).
Click to view test logs
$ pipenv run ./dev/test_scripts_help.sh
✅ scripts/1-fetch/arxiv_fetch.py
✅ scripts/1-fetch/gcs_fetch.py
✅ scripts/1-fetch/github_fetch.py
✅ scripts/1-fetch/smithsonian_fetch.py
✅ scripts/1-fetch/wikipedia_fetch.py
✅ scripts/2-process/gcs_process.py
✅ scripts/2-process/github_process.py
✅ scripts/2-process/smithsonian_process.py
✅ scripts/2-process/wikipedia_process.py
✅ scripts/3-report/gcs_report.py
✅ scripts/3-report/github_report.py
✅ scripts/3-report/smithsonian_report.py
✅ scripts/3-report/wikipedia_report.py
✅ scripts/3-report/zzz-notes.py
exit status: 0

$ pipenv run flake8
(Clean exit code: 0)

$ pipenv run isort --check-only .
Skipped 1 files (.git)
(Clean exit code: 0)

$ pipenv run black --check .
All done! ✨ 🍰 ✨
17 files would be left unchanged.
(Exit code: 0)

$ git diff --check
(Clean exit code: 0)

$ pipenv run ./scripts/3-report/zzz-notes.py --quarter 2026Q3
2026-10-17 11:51:38,521 - INFO - zzz-notes - Parsing command-line arguments
2026-10-17 11:51:38,522 - INFO - shared - Updating paths: replacing 2026Q4 with 2026Q3
2026-10-17 11:51:38,522 - INFO - shared - PATHS:
    repo: /home/priyank/projects/quantifying
        data:           ./data
        data_1-fetch:   ./data/2026Q3/1-fetch
        data_2-process: ./data/2026Q3/2-process
        data_3-report:  ./data/2026Q3/3-report
        data_phase:     ./data/2026Q3/3-report
        data_quarter:   ./data/2026Q3
2026-10-17 11:51:38,522 - INFO - shared - ordered_sections: ['gcs_report.py', 'github_report.py', 'smithsonian_report.py', 'wikipedia_report.py', 'zzz-notes.py']
2026-10-17 11:51:38,522 - INFO - shared - section_title: Notes
(Exit code: 0)

$ pipenv run ./scripts/2-process/wikipedia_process.py --quarter 2026Q3
2026-10-17 11:51:39,628 - INFO - wikipedia_process - Parsing command-line options
2026-10-17 11:51:39,629 - INFO - shared - Updating paths: replacing 2026Q4 with 2026Q3
2026-10-17 11:51:39,629 - INFO - shared - Updating paths: replacing 2026Q4 with 2026Q3
2026-10-17 11:51:39,629 - INFO - shared - PATHS:
    repo: /home/priyank/projects/quantifying
        data:           ./data
        data_1-fetch:   ./data/2026Q3/1-fetch
        data_2-process: ./data/2026Q3/2-process
        data_3-report:  ./data/2026Q3/3-report
        data_phase:     ./data/2026Q3/2-process
        data_quarter:   ./data/2026Q3
2026-10-17 11:51:39,629 - INFO - wikipedia_process - Output files already exists for 2026Q3
(Exit code: 0)

Checklist

  • I have read and understood the Developer Certificate of Origin (DCO), below, which covers the contents of this pull request (PR).
  • My pull request doesn't include code or content generated with AI (also see Avoiding generative AI development tools — Creative Commons Open Source).
  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated unit tests and/or test scripts for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@Priyankm23
Priyankm23 requested review from a team as code owners October 17, 2026 14:32
@Priyankm23
Priyankm23 requested review from TimidRobot and possumbilities and removed request for a team October 17, 2026 14:32
@cc-open-source-bot cc-open-source-bot moved this to In review in TimidRobot Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Update project to newest possible Python

2 participants