cms-PdmV / cmsPdmV

CERN CMS McM repository
4 stars 10 forks source link

Migrate McM to Python 3 #1124

Open ggonzr opened 5 months ago

ggonzr commented 5 months ago

Update all the McM source code to drop the support for Python 2.

Is your feature related to a problem?

This application still uses Python 2 as the main reference version for its code base. This version has been deprecated since January 2020 and it is required to update it. Also, another motivator is the ongoing OS migration to AlmaLinux 9, newer distributions don’t provide this old package anymore.

Describe the solution you'd like

Initial plan

  1. Build an environment (using containers) to deploy automatically the application as it currently is with all its dependencies.
  2. Include CI actions to build automatically the environment and execute test cases.
  3. Start coding a test suite to test all the API endpoints offered by the application.
  4. Iterate between 2 and 3 until a high test coverage has been reached.
  5. Use the Python 2 to 3 transpiler to migrate as much as possible code.
  6. Perform the required corrections so that no test fails.
  7. Format all the source code using black
  8. Include pylint as a static code analyzer.
  9. Improve the log rotation.
  10. Upgrade all the current packages to its latest version.
  11. Change the container base image to the latest Python 3.11 version
  12. Deploy to production.

More details will be included in the comments below.

Linked ticket: PDMVDEV-5