Skip to content

MAINT: PEP8 further compliance (manual check) constants.py module#3750

Draft
alan-techdev wants to merge 2 commits intopy-pdf:mainfrom
alan-techdev:issue-3231
Draft

MAINT: PEP8 further compliance (manual check) constants.py module#3750
alan-techdev wants to merge 2 commits intopy-pdf:mainfrom
alan-techdev:issue-3231

Conversation

@alan-techdev
Copy link
Copy Markdown
Contributor

This partially fixes the Issue 3231 by focusing on none public API inside the pypdf/constants.py module.
public API for constants module

In regards to constants.py line 586 ( op = "/op") and 602 (ca = "/ca"); they are being left in order to avoid breaking the test cases (test_constants.py::test_slash_prefix) line 36 which state the below

 if cls == GraphicsStateParameters and attr in ["ca", "op"]:
                continue

The attribute is hardcoded so either we change the test case or ?
The reason is to keep PR into minium

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.59%. Comparing base (64a793b) to head (b9e6b9f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pypdf/_page.py 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3750   +/-   ##
=======================================
  Coverage   97.59%   97.59%           
=======================================
  Files          55       55           
  Lines       10228    10228           
  Branches     1877     1877           
=======================================
  Hits         9982     9982           
  Misses        141      141           
  Partials      105      105           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@stefan6419846 stefan6419846 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please have a look at the failing tests?

Additionally, this unfortunately is wrong - pypdf.constants is a public module, thus - even if they are not part of the docs directly - they have to be considered public API. Renaming them thus requires a proper deprecation process.

@alan-techdev
Copy link
Copy Markdown
Contributor Author

Noted. I will try to address private module instead

@stefan6419846 stefan6419846 marked this pull request as draft May 4, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants