Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Friendly request to @deprecate API changes via semver #84

Open
dehann opened this issue Aug 24, 2022 · 2 comments
Open

Friendly request to @deprecate API changes via semver #84

dehann opened this issue Aug 24, 2022 · 2 comments
Labels
docs Things related to documentation enhancement

Comments

@dehann
Copy link

dehann commented Aug 24, 2022

Hi BioAlignments,

Just wanted to put in a friendly request for API changes to follow Julia's @deprecate pattern for API changes please, so for example in package v0.1.x:

# src/AwesomeCode.jl
oldsignature(x::Int) = # does thing

Then the API change goes into v0.2.0 along with the deprecation

# src/AwesomeCode.jl
newsignature(x::Float64) = # does similar thing

# src/Deprecated.jl
@deprecate oldsignature(x::Int) newsignature(float(x))

This will give users a chance to update their scripts with a useful auto-generated warning, which tells them how to replace old calls with new ones.

Then remove the deprecation in v0.3

# src/AwesomeCode.jl
newsignature(x::Float64) = # does similar thing

Also consider listing breaking changes in a NEWS.md. Based on a quick search it looks like the @deprecate feature is not used here much.

Thanks for the great package!

@dehann
Copy link
Author

dehann commented Aug 24, 2022

Oh, there is also overwriting the Base.getproperty(obj::MyType, f::Symbol) when deprecating fields in a struct. And then inside that use Base.getfield to avoid stack overflows.

Can close this issue on comment received :-)

@kescobo
Copy link
Member

kescobo commented Aug 25, 2022

Yeah, we definitely should do this throughout BioJulia, especially after packages have reached v1.0. Apologies for the failure to do so in the past. In principle, we could even do patch-releases on previous versions retroactively, though I'm not sure how much effort that's worth.

Unfortunately, developer time in this ecosystem is pretty limited - I suspect this is why it wasn't done in the past. As an aside, if you want to make a PR for this purpose, I think it would be very warmly received :-)

@kescobo kescobo added enhancement docs Things related to documentation labels Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Things related to documentation enhancement
Projects
None yet
Development

No branches or pull requests

2 participants