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

Remove deprecated functions and parameters #245

Merged
merged 14 commits into from
Feb 7, 2025

Conversation

HexDecimal
Copy link
Collaborator

Removes a significant amount of code which was publicly marked as deprecated in the latest release. This should make the rest of the code easier to maintain. All deprecated features have been removed except for get_rpaths since _get_rpaths needs more work to replace it in tests.

Refactors get_archs with changes noted in the changelog.

Improves the output of pytest in CI a little bit by showing which lines are uncovered. I've marked the if __name__ == "__main__": branches in commands as uncoverable.

Each removal is its own commit in case anything needs to be reverted, edited, or split into separate PR's.

Pull Request Checklist

  • Read and follow the CONTRIBUTING.md guide
  • Mentioned relevant issues
  • Append public facing changes to Changelog.md
  • Ensure new features are covered by tests
  • Ensure fixes are verified by tests

Refactor tests to use _get_install_ids
External URL's in removed notes seem to be broken

tree_libs tests seem redundant with adjacent tests

_allow_all is only used in delocating.py now
Refactor get_archs, now accepts PathLike and raises FileNotFoundError
Coverage xml is automatic and does not need its own step
Commands must be an explicit sequence, similar to subprocess
Command main functions are covered but these branches can not be covered by the script testing tool.
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.43%. Comparing base (86bae83) to head (95b56ba).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #245      +/-   ##
==========================================
+ Coverage   96.92%   97.43%   +0.50%     
==========================================
  Files          16       16              
  Lines        1366     1246     -120     
==========================================
- Hits         1324     1214     -110     
+ Misses         42       32      -10     

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

@matthew-brett
Copy link
Owner

How long have these functions been deprecated for (in terms of time, and releases)?

@HexDecimal
Copy link
Collaborator Author

HexDecimal commented Jan 30, 2025

Some are very recent, some are older. Some of them are documented with .. deprecated::.

Many of these functions have a broken implementation which is either not aware of recursive libraries or is not aware of rpaths or @loader_path. This brokenness was often enforced by current tests so alternative functions had to be created to replace them. Most of the new functions are private as I consider them internal to delocate and not as public facing as say delocate_wheel or delocate_path.

Removed/changed functions:

  • copy_recurse: deprecated since 0.9, broken/outdated implementation
  • delocate_wheel check_verbose parameter: deprecated since 0.10
  • fuse_trees lib_exts parameter: deprecated since 0.13, poor implementation
  • tree_libs: deprecated since 0.9, broken/outdated implementation
  • resolve_rpath: deprecated since 0.9, broken/outdated implementation
  • back_tick: deprecated since 0.10, should've been a private function and is easily replaced by the Python 3 standard library
  • unique_by_index, deprecated since 0.12, this function is effectively a vendored copy of more-itertools unique_everseen and should not be public
  • get_install_id: deprecated since 0.12, broken/outdated implementation
  • lipo_fuse: deprecated since 0.13, should've been a private function and is a lot of technical overhead for what can now be a call to subprocess.run in Python 3
  • Other removed functions are private with a leading underscore
  • get_archs: not removed but modified to use FileNotFoundError for missing files instead of RuntimeError

Not removed:

  • get_rpaths: deprecated since 0.12 due to being broken/outdated but will not be removed by this PR

Times of releases with times of deprecation:

  • 0.13.0 - 2025-01-29 (just now): fuse_trees(lib_exts), lipo_fuse
  • 0.12.0 - 2024-08-29 (5 months ago): unique_by_index, get_install_id, get_rpaths
  • 0.11.0 - 2024-03-22 (10 months ago)
  • 0.10.7 - 2023-12-12 (2 years ago): delocate_wheel(check_verbose), back_tick
  • 0.9.1 - 2021-09-17 (4 years ago): copy_recurse, tree_libs, resolve_rpath

@matthew-brett
Copy link
Owner

In general, I am sure that a) not many people are using the internal functions, and b) those that are will tend to be release managers, so able to adapt quickly. So fast deprecation / removal cycles are OK, if that is what you prefer.

Copy link
Owner

@matthew-brett matthew-brett left a comment

Choose a reason for hiding this comment

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

Looks good - comment on change in Exception.

@HexDecimal
Copy link
Collaborator Author

HexDecimal commented Jan 30, 2025

comment on change in Exception.

What do you mean by this? The change to get_archs is already mentioned in the changelog.

@matthew-brett
Copy link
Owner

matthew-brett commented Jan 31, 2025 via email

@HexDecimal HexDecimal merged commit 6a0b30e into matthew-brett:main Feb 7, 2025
15 checks passed
@HexDecimal HexDecimal deleted the remove-deprecated branch February 7, 2025 20:08
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