Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and maintain refcounts.dat #127452

Closed

Conversation

gianfrancomauro
Copy link

@gianfrancomauro gianfrancomauro commented Nov 30, 2024

Related to #127443

Add a script to check and update refcounts.dat and integrate it into CI workflows.

  • Add Doc/tools/check_refcounts.py:

    • Create a script to check if refcounts.dat is up-to-date and sorted.
    • Implement logic to compare refcounts.dat with the stable ABI.
    • Implement logic to check if refcounts.dat is alphabetically sorted.
    • Handle cases where input files do not exist or cannot be read.
    • Allow passing file paths as command-line arguments.
    • Print total counts of entries and mismatches for better insights.
    • Optionally auto-sort and save the refcounts.dat file.
  • Add Doc/tools/Makefile:

    • Add a target to run the check_refcounts.py script.
  • Update .github/workflows/build.yml:

    • Add a CI job to run the check_refcounts.py script.
    • Ensure the job runs when a new function is added to the Stable ABI.
  • Update .github/workflows/lint.yml:

    • Add a CI linter job to check if refcounts.dat is correctly formatted.

For more details, open the Copilot Workspace session.


📚 Documentation preview 📚: https://cpython-previews--127452.org.readthedocs.build/

Related to python#127443

Add a script to check and update `refcounts.dat` and integrate it into CI workflows.

* **Add `Doc/tools/check_refcounts.py`**:
  - Create a script to check if `refcounts.dat` is up-to-date and sorted.
  - Implement logic to compare `refcounts.dat` with the stable ABI.
  - Implement logic to check if `refcounts.dat` is alphabetically sorted.
  - Handle cases where input files do not exist or cannot be read.
  - Allow passing file paths as command-line arguments.
  - Print total counts of entries and mismatches for better insights.
  - Optionally auto-sort and save the `refcounts.dat` file.

* **Add `Doc/tools/Makefile`**:
  - Add a target to run the `check_refcounts.py` script.

* **Update `.github/workflows/build.yml`**:
  - Add a CI job to run the `check_refcounts.py` script.
  - Ensure the job runs when a new function is added to the Stable ABI.

* **Update `.github/workflows/lint.yml`**:
  - Add a CI linter job to check if `refcounts.dat` is correctly formatted.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/python/cpython/issues/127443?shareId=XXXX-XXXX-XXXX-XXXX).
@bedevere-app
Copy link

bedevere-app bot commented Nov 30, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@picnixz
Copy link
Contributor

picnixz commented Nov 30, 2024

Please, I was working on this matter. I assigned the issue to myself to indicate that I'm working on it. In addition, the tool is not sufficient because you can't just sort the lines in one go as they should be grouped.

@picnixz picnixz closed this Nov 30, 2024
@ZeroIntensity
Copy link
Member

@gianfrancomauro Please don't use AI to generate PRs.

@gianfrancomauro gianfrancomauro deleted the update-refcounts branch November 30, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants