falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.51k stars 937 forks source link

Deprecate `compile_uri_template()` #1967

Closed CaselIT closed 2 years ago

CaselIT commented 2 years ago

The compile_uri_template() function is not consistent with compiled router regarding tailing slash.

I don't know either what the plan for compile_uri_template() is. I think it is left as a utility method for building custom routers, and I suppose, may continue to exist as such.

This PR does a good job at explaining the status quo, so maybe let's just merge it, and create a new issue for making this method slightly more consistent with CompiledRouter.

Originally posted by @vytas7 in https://github.com/falconry/falcon/pull/1961#pullrequestreview-777018325

The options may be

CaselIT commented 2 years ago

As a datapoint, it does not seem very used, https://github.com/search?q=compile_uri_template&type=code

My vote goes to deprecation followed by leaving as is.

vytas7 commented 2 years ago

The story behind it (found by @CaselIT): https://github.com/falconry/falcon/issues/532.

I would vote for deprecation and subsequent removal in a next major version. We could move it to some sort of add-ons or "talons" package if anyone still needs it.

CaselIT commented 2 years ago

do you think we can deprecate it in v3 for removal in v4?

vytas7 commented 2 years ago

Yes, we can. Preferably we should surface a deprecation warning in at least a couple of minor versions, like 3.1 and 3.2.

vytas7 commented 2 years ago

@dukedougal it is not unlikely that we might decide to deprecate and eventually remove this method. As per https://github.com/falconry/falcon/issues/532#issuecomment-98237528, are you still relying on this method in your codebase?

vytas7 commented 2 years ago

Fixed in #1971