Skip to content

Drop stray deprecation marker from Project._init_source_folders - #987

Open
mcepl wants to merge 2 commits into
changelog-news-fragmentsfrom
mcepl/deprecated_tests
Open

mcepl wants to merge 2 commits into
changelog-news-fragmentsfrom
mcepl/deprecated_tests

Conversation

@mcepl

@mcepl mcepl commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Description

Every rope.base.project.Project() construction emits

DeprecationWarning: Delete once deprecated functions are gone

because the private Project._init_source_folders carries
@utils.deprecated(...). The method is live code: it is the only
reader of the source_folders preference and fills
_custom_source_folders for Project.get_source_folders().

History: in cac5786 (2014) the decorator was put on the old
PyCore._init_source_folders, which only served the then-deprecated
PyCore.get_source_folders and was meant to be deleted together
with it. In 2ee332a that PyCore copy was removed (the PyCore wrapper
now delegates to Project), but the decorator was moved onto the
Project replacement instead of being dropped. Its condition has
therefore been met since 2014.

This PR just removes the decorator; behaviour is otherwise unchanged.
Removing the remaining public @utils.deprecated wrappers (pycore,
taskhandle, change_signature, …) is a separate API-breaking change
and intentionally not part of this PR.

Stacked on #985 (changelog fragments); please merge that first.

Checklist (delete if not relevant):

  • I have added a changelog fragment to changelog.d/ (see changelog.d/README.md)

Every construction of rope.base.project.Project emitted a
DeprecationWarning "Delete once deprecated functions are gone",
even though _init_source_folders is a private, live method: it is
the only reader of the `source_folders` preference and fills
_custom_source_folders for Project.get_source_folders().

The marker originated in cac5786 (2014), where it decorated the
old PyCore._init_source_folders, which only existed to serve the
then-deprecated PyCore.get_source_folders and was meant to be
deleted together with it. In 2ee332a the PyCore copy was removed
and PyCore.get_source_folders made to delegate to Project, but the
decorator was moved onto the Project replacement instead of being
dropped with the code it described. Its condition has thus been
met since 2014; remove the decorator and keep the method.
mcepl added a commit that referenced this pull request Nov 30, 2026
Describe the removal of the stray DeprecationWarning emitted on
every Project() construction, so it is collected into CHANGELOG.md
at the next release.
Describe the removal of the stray DeprecationWarning emitted on
every Project() construction, so it is collected into CHANGELOG.md
at the next release.
@mcepl
mcepl force-pushed the mcepl/deprecated_tests branch from 5927dab to aada3ee Compare November 30, 2026 10:27
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (18e7d47) to head (aada3ee).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           changelog-news-fragments     #987      +/-   ##
============================================================
- Coverage                     95.46%   95.46%   -0.01%     
============================================================
  Files                           134      134              
  Lines                         26946    26945       -1     
============================================================
- Hits                          25723    25722       -1     
  Misses                         1223     1223              

☔ View full report in Codecov by Harness.
📢 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.

@mcepl
mcepl requested a review from lieryan November 30, 2026 10:28

@lieryan lieryan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

This branch has not been deployed

No deployments
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