mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
![]() # Aider chat conversation: USER: warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning) ASSISTANT: It seems like you're concerned about the deprecation warning from the `pkg_resources` module. We can replace the usage of `pkg_resources` with `packaging.version` for version comparison. Here are the changes needed in the `aider/versioncheck.py` file: ```python aider/versioncheck.py <<<<<<< ORIGINAL import pkg_resources ... if pkg_resources.parse_version(latest_version) <= pkg_resources.parse_version( current_version ): return ======= import packaging.version ... if packaging.version.parse(latest_version) <= packaging.version.parse( current_version ): return >>>>>>> UPDATED ``` This change replaces the deprecated `pkg_resources.parse_version` with `packaging.version.parse` for version comparison. USER: InvalidEditBlock: edit failed! aider/versioncheck.py does not contain the *exact sequence* of ORIGINAL lines you specified. Try again. DO NOT skip blank lines, comments, docstrings, etc! The ORIGINAL block needs to be EXACTLY the same as the lines in aider/versioncheck.py with nothing missing! aider/versioncheck.py does not contain these 8 exact lines in a row: ``` import pkg_resources ... if pkg_resources.parse_version(latest_version) <= pkg_resources.parse_version( current_version ): return ``` ASSISTANT: I apologize for the confusion. Let's try again with the correct sequence of lines from the `aider/versioncheck.py` file: ```python aider/versioncheck.py <<<<<<< ORIGINAL import pkg_resources ... if pkg_resources.parse_version(latest_version) <= pkg_resources.parse_version( current_version ): return ======= import packaging.version ... if packaging.version.parse(latest_version) <= packaging.version.parse( current_version ): return >>>>>>> UPDATED ``` This change replaces the deprecated `pkg_resources.parse_version` with `packaging.version.parse` for version comparison. |
||
---|---|---|
.. | ||
coders | ||
__init__.py | ||
commands.py | ||
diffs.py | ||
dump.py | ||
io.py | ||
main.py | ||
models.py | ||
prompts.py | ||
repomap.py | ||
utils.py | ||
versioncheck.py |