Re-export distutils.dep_util through setuptools.modified#4069
Re-export distutils.dep_util through setuptools.modified#4069
distutils.dep_util through setuptools.modified#4069Conversation
|
Before we naively expose this behavior, let's ask ourselves what these functions are used for (in pywin32) and determine where is the best place to host them. Setuptools is aiming to be primarily a build backend and not have dependencies on the library (except in setup.py). I see that pywin32 uses two functions, one in setup.py and the other in a test. Moreover, the one use in setup.py has a comment "unclear why we need to check this". I'd like to first determine what |
Sounds sensible to me. I'll do some investigation on pywin32's side and see how much value these utility methods bring it (or dont). |
|
In pywin32 it's used to check if a file should be rebuilt/re-generated. All 3 instances of
I think I get what you're going for here. Either these 4 file-edit-time comparison methods could be moved to their own library, or included as part of an existing file-manipulation one. Where it would belong better than in setuptools. I think it does make sense, I'm not sure where it would belong best though and where to start requesting. |
|
Thanks for the exploration. I do think we want to expose these functions from setuptools. I did some work in distutils to modernize and clean up the implementations. That should make implementing Before we expose these new public names, I do think we should seriously consider re-naming this module. I can deal with the migration to the new name. |
|
Thank you for the consideration
I completely agree.
I don't have a strong opinion on this. Some thoughts: Functions in the module currently only compare modification date, and the name "modified" is quite telling of what the module does, but maybe that's to close to implementation?
Thanks! Feel free to close this PR as superseded by the new one. |
…ptools into distutils.dep_util
distutils.dep_util through setuptools.dep_utildistutils.dep_util through setuptools.modified
|
Well that's weird. It used to be the case that if I pointed a PR to target a branch and then merged that branch into main, Github would repoint the original PR to main, but in this case, it closed this PR and I'm unable to reopen (the re-open is greyed out). |
|
Aha! By re-pushing the feature/distutils-sync branch, I was able to re-open this PR. |
Use functions from setuptools.modified instead.
!!
********************************************************************************
Please use `setuptools.modified` instead of `setuptools.dep_util`.
By 2024-May-21, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See pypa/setuptools#4069 for details.
********************************************************************************
!!
Use functions from setuptools.modified instead.
!!
********************************************************************************
Please use `setuptools.modified` instead of `setuptools.dep_util`.
By 2024-May-21, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See pypa/setuptools#4069 for details.
********************************************************************************
!!
Summary of changes
Re-export
distutils.dep_utilthroughsetuptools.modifiedI'm looking into progressively migrating
distutilusage in pywin32 (mhammond/pywin32#2119), wheredistutils.dep_util.neweranddistutils.dep_util.newer_groupare used.Migration guides (https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html and https://peps.python.org/pep-0632/#migration-advice) don't mention
distutils.dep_util.setuptools.dep_utilalready exists. It seems sensible to re-export the rest ofdistutils.dep_utilas part ofsetuptool's API.Edit: see conversations below, re-exporting thought
setuptools.modified.Pull Request Checklist
newsfragments/.(See documentation for details)