Giter Club home page Giter Club logo

Comments (5)

pawamoy avatar pawamoy commented on June 18, 2024

Hi @kcgthb, thanks for opening this issue :)

I have read the discussion in Material for MkDocs' repository, and to me it would make sense to let users decide whether to emit info or warning messages for plugin configs using the Deprecated API, just like pytest users can decide whether to treat actual warnings as info messages or errors.

I recently added a breaking change in mkdocstrings-python, with a deprecation period where users will first get info logs (not breaking their strict builds), then warnings (now breaking them).

Back to this issue, I wonder though if we should allow setting info level globally, or per deprecation message.

from mkdocs.

kcgthb avatar kcgthb commented on June 18, 2024

I πŸ’― agree that allowing users to choose the message level (INFO or WARNING) for each Deprecated object would be even better!

from mkdocs.

squidfunk avatar squidfunk commented on June 18, 2024

@tomchristie πŸ‘‹ in my view, this issue is a great start for improving MkDocs, as it touches many users. Basically, when you're using --strict mode, your build will fail if you run into a plugin deprecation, but not when you use something that was deprecated in MkDocs. That sounds like an inconsistency, also see squidfunk/mkdocs-material#7146 (comment).

It would be great if you could share your view ☺️

from mkdocs.

tomchristie avatar tomchristie commented on June 18, 2024

but not when you use something that was deprecated in MkDocs

Could you expand on that?

The first part "when you're using --strict mode, your build will fail if you run into a plugin deprecation" seems right, sounds like it's the inconsistency that needs addressing?

from mkdocs.

squidfunk avatar squidfunk commented on June 18, 2024

I did expand on it in the comment I linked: squidfunk/mkdocs-material#7146 (comment)

IMHO, the most sensical thing would be that the Deprecated helper emits something like the following, which are deprecation warnings we fixed when upgrading to 1.6, as was reported in squidfunk/mkdocs-material#7119 (comment):

INFO    -  DeprecationWarning: Do not access Theme._vars, instead access the keys of Theme directly.
             File "/opt/homebrew/lib/python3.10/site-packages/mkdocs_git_revision_date_localized_plugin/plugin.py", line 82, in on_config
               theme_locale = custom_theme._vars.get("locale")
             File "/opt/homebrew/lib/python3.10/site-packages/mkdocs/theme.py", line 87, in _vars
               warnings.warn(
INFO    -  DeprecationWarning: To replace an existing file, call `remove` before `append`.
             File "<snip>/mkdocs-material/material/plugins/privacy/plugin.py", line 445, in _queue
               self.assets.append(file)
             File "/opt/homebrew/lib/python3.10/site-packages/mkdocs/structure/files.py", line 100, in append
               warnings.warn(

MkDocs uses this approach itself for their internal APIs, e.g., the Files collections, see an example, but emit warnings for plugin configurations. IMHO, this is inconsistent, so before we act here, we should discuss this with the maintainers of MkDocs. Interestingly, the aforementioned DeprecationWarnings were formerly also raised with level WARNING and de-escalated to INFO in a subsequent release.

from mkdocs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.