timvink / mkdocs-git-authors-plugin

MkDocs plugin to display git authors of a page.
https://timvink.github.io/mkdocs-git-authors-plugin
MIT License
68 stars 17 forks source link

Not tested with py311 - deprecation warnings #70

Closed ssbarnea closed 1 year ago

ssbarnea commented 1 year ago

The fact that this plugin is not tested with py311 prevented it from finding some deprecation runtime warnings:

INFO     -  DeprecationWarning: pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-op
              File "/opt/homebrew/lib/python3.11/site-packages/mkdocs_git_authors_plugin/ci.py", line 23, in raise_ci_warnings
                with Path(path):
              File "/opt/homebrew/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py", line 891, in __enter__
                warnings.warn("pathlib.Path.__enter__() is deprecated and scheduled "
INFO     -  Cleaning site directory

BTW, If you want to avoid having to update the list of python version on GHA, you might find https://github.com/coactions/dynamic-matrix useful.

timvink commented 1 year ago

Thanks for mentioning. I can't seem to reproduce the warning locally (python 3.11.0). Made a change to the context manager nonetheless, hopefully that fixes it. Can you try installing from the master branch?

timvink commented 1 year ago

3.11 has also been added to the github actions matrix, see https://github.com/timvink/mkdocs-git-authors-plugin/actions/runs/4221698161/jobs/7329305103

ssbarnea commented 1 year ago

Thanks. I will make a PR if I spot it again. Maybe they changes something in 3.11.1 or 3.11.2. Anyway, now that we have it tested, it will be very easy to patch it.

SilentGlasses commented 1 year ago

Hey there... I didn't want to create a new issue when this one exists.. I just installed this pluin and have this issue... Do you know if this fix got merged into the plugin already or if not, can we get it added in?

INFO     -  DeprecationWarning: pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-op
              File "/usr/local/lib/python3.11/site-packages/mkdocs_git_authors_plugin/ci.py", line 23, in raise_ci_warnings
                with Path(path):
              File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py", line 891, in __enter__
                warnings.warn("pathlib.Path.__enter__() is deprecated and scheduled "
python --version
Python 3.11.2
pip3 list
Package                                   Version
----------------------------------------- ----------
Babel                                     2.12.1
beautifulsoup4                            4.11.2
certifi                                   2022.12.7
charset-normalizer                        3.1.0
click                                     8.1.3
colorama                                  0.4.6
csscompressor                             0.9.5
EditorConfig                              0.12.3
fontawesome-markdown                      0.5.0
ghp-import                                2.1.0
gitdb                                     4.0.10
GitPython                                 3.1.31
htmlmin                                   0.1.12
idna                                      3.4
Jinja2                                    3.1.2
jsbeautifier                              1.14.7
jsmin                                     3.0.1
Markdown                                  3.3.7
markdown-include                          0.8.1
MarkupSafe                                2.1.2
mergedeep                                 1.3.4
mkdocs                                    1.4.2
mkdocs-autolinks-plugin                   0.7.0
mkdocs-git-authors-plugin                 0.7.0
mkdocs-git-revision-date-localized-plugin 1.2.0
mkdocs-macros-plugin                      0.7.0
mkdocs-material                           9.1.1
mkdocs-material-extensions                1.1.1
mkdocs-mermaid2-plugin                    0.6.0
mkdocs-minify-plugin                      0.6.2
mkdocs-pymdownx-material-extras           2.4.2
packaging                                 23.0
pip                                       23.0.1
Pygments                                  2.14.0
pymdown-extensions                        9.10
python-dateutil                           2.8.2
pytz                                      2022.7.1
PyYAML                                    6.0
pyyaml_env_tag                            0.1
regex                                     2022.10.31
requests                                  2.28.2
setuptools                                65.6.3
six                                       1.16.0
smmap                                     5.0.0
soupsieve                                 2.4
termcolor                                 2.2.0
urllib3                                   1.26.14
watchdog                                  2.3.1

Thanks for looking into this.

edit: added the full pip3 list as well as the python version just in case. I am running this on a Mac running mac OS Monterey 12.6.3

SilentGlasses commented 1 year ago

@timvink

3.11 has also been added to the github actions matrix, see https://github.com/timvink/mkdocs-git-authors-plugin/actions/runs/4221698161/jobs/7329305103

Not sure if this matters but during the unit tests, it seems to be using python@v2 not v3... I may be reading this wrong tho... Sorry if I am.

ldeluigi commented 1 year ago

@timvink Could you please release the fix?

timvink commented 1 year ago

Sorry for the very long delay. v0.7.1 just hit pypi. Please re-open this issue if this doesn't solve it.

timvink commented 1 year ago

Not sure if this matters but during the unit tests, it seems to be using python@v2 not v3.

Just updated the github workflows, thanks for mentioning :) https://github.com/timvink/mkdocs-git-authors-plugin/commit/5c1d8b056dd7c302413674fec605d06403c5a2de