Skip to content

Set publisher components at instantiation#64

Draft
domdfcoding wants to merge 1 commit intotwolfson:masterfrom
domdfcoding:fix-deprecations
Draft

Set publisher components at instantiation#64
domdfcoding wants to merge 1 commit intotwolfson:masterfrom
domdfcoding:fix-deprecations

Conversation

@domdfcoding
Copy link

Docutils has deprecated the set_components method, but it looks like these could always be provided when creating the Publisher so I don't think this change breaks backwards compatibility.

@twolfson
Copy link
Owner

Thanks for the PR and inspecting backwards compatibility!

I'm currently tight on bandwidth to run some checks before landing/releasing.

Is this time sensitive? Would it be okay if I revisit this in a month? (obv preferable to do sooner, but unsure how long it'll be until I get bandwidth back)

@domdfcoding
Copy link
Author

domdfcoding commented Aug 14, 2025 via email

@domdfcoding
Copy link
Author

On closer examination I realise this only works with docutils 0.22. The parameters for Publisher existed on earlier versions, but took a class not a string. The code could be gated with docutils.__version_info__, but it depends how far off docutils 2.0 is and when you plan to drop support for older docutils and Python versions (0.22 requires 3.9+). I'll mark this as draft in the meantime.

@domdfcoding domdfcoding marked this pull request as draft August 19, 2025 19:54
@twolfson
Copy link
Owner

twolfson commented Aug 19, 2025 via email

@twolfson
Copy link
Owner

I'm still quite under water regarding my queue, but I just glanced at the PyPI release dates and it seems 0.22 was only Jul 29 2025? https://pypi.org/project/docutils/#history

Can you share more about when the deprecation error comes up / what it looks like? Is it at import time or when some rst-lint method is called?

@twolfson twolfson changed the title Set publusher components at instantiaion Set publisher components at instantiation Sep 23, 2025
@twolfson
Copy link
Owner

twolfson commented Sep 23, 2025

I took a deeper look just now since I'd realized I didn't even read your code yet.

I usually don't like modifying code behavior off versions, since it can break in interesting ways -- and instead like modifying off any errors instead (hence deprecation error ask)

Buuuut it looks like in this case, there's no way to sniff for that -- which makes backwards compatibility a form of gymnastics.

Maybe we just release this as a breaking change (i.e. major semver) + document it accordingly. What are your thoughts?

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