ganga-devs / ganga

Ganga is an easy-to-use frontend for job definition and management
GNU General Public License v3.0
100 stars 159 forks source link

Add deprecation system #2294

Open egede opened 9 months ago

egede commented 9 months ago

A deprecation system should be developed for Ganga. It should

alexanderrichards commented 9 months ago

possibly https://pypi.org/project/Deprecated/

egede commented 9 months ago

Looks interesting. Maybe add to this some way where the CI testing will start to fail a test if there are old "deprecations" that has not been removed. So maybe the decorator should have a way of marking the deprecation period. In the example below

@deprecated(version='8.6.9', reason="Singularity is the old name, use Apptainer instead", expiry=datetime.date(2024,7,1))

would then if used give the message

WARNING: Deprecated in version 8.6.9. Singularity is the old name, use Apptainer instead. Class will be removed in first release after 2024-07-01.
egede commented 9 months ago

The CI testing will then just have a test that starts failing if it finds any line with an expiry date that is before the current date. Should probably be made as a separate section in the testing (that is not required to pass) to avoid messing up the test of some unrelated PR. Or maybe we could do some of the same kind of magic as we have for the PEP8 testing where a PR is automatically created with the deprecated functions marked for removal.

alexanderrichards commented 9 months ago

makes sense

dg1223 commented 8 months ago

possibly https://pypi.org/project/Deprecated/

@alexanderrichards I think I am gonna borrow this idea for #2293 :)

egede commented 8 months ago

Links somewhat in with #2149. The issue here is related to Ganga code that gets deprecated, while the other one is related to python syntax that gets deprecated.

egede commented 6 months ago

Suggested steps for developing this. @YilinZhao6 Let us know if you start working on this.