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

Switch from distutils to setuptools #12259

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vkuznet
Copy link
Contributor

@vkuznet vkuznet commented Feb 11, 2025

Fixes #12256

Status

in development

Description

Provide switch from distutils to setuptools library for all scripts and tools used by WMCore code-base. This PR provides the following:

  • .github/workflows/build_and_install_locally.yaml new CI/CD workflow to locally build and install WM packages
  • bin/test_local_build_and_install.sh script which imitates CI/CD workflow and relies on virtual environment to build and install WM packages locally
  • modified version of all setup scripts used in build process of WM packages. The current WM build system follows these steps:
    • setup.py script can be used to build wmcore package, e.g. python setup.py sdist
    • setup_template.py script is used by CI/CD workflows to build concrete WM package, e.g. reqmgr2
      • CI/CD workflow (e.g. .github/workflows/pypi_build_and_images.yaml) copies setup_tempate.py into setup.py and properly setup package name
      • it also creates package specific version of requirements.txt
      • finally, it runs python3 setup.py clean sdist to create distribution tar ball.

NOTE 1: the WM build steps run within CI/CD pipeline as a matrix and therefore overwritten setup.py and requirements.txt files never cause any problems, i.e. they are within separate docker images during CI/CD execution, i.e. within specific matrix build.

NOTE 2:

  • The provided bin/test_local_build_and_install.sh script only build and install WM packages in local virtual environment. It does not verifies their functionality though as it requires additional setup like databases, htcondor, gfal libraries.

  • It also install all WM packages within single virtual environment. Another approach would be use individual virtual environment areas for individual WM packages, and if it will be desired I can provide a new script or modify bin/test_local_build_and_install.sh accordingly. The issue with multiple virtual environments that it waste disk space as WM packages share dependencies among each other. Therefore, I opted with single virtual environment approach.

  • Local builds and installation skips htcondor and gfal dependencies as they are very centric for CERN based Linux OS. All other dependencies are OS agnostic and presented in local build/install procedure which can be performed on any Linux, and macOS versions.

NOTE 3: I removed setup_wmcore.py from the repository in this commit since I was unable to find out usage of this code anywhere in WMCore repository.

Is it backward compatible (if not, which system it affects?)

Most likely YES, but I'm not 100% sure.

I performed local installation and compared tarballs using distutils and setuptools, but no actual tests were done with individual packages as it requires their upload to PyPi and installation elsewhere.

Related PRs

External dependencies / deployment changes

@vkuznet vkuznet added Python3 Technical Debt Used to track issues that address technical needs internal to WM team labels Feb 11, 2025
@vkuznet vkuznet self-assigned this Feb 11, 2025
@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 6 changes in unstable tests
  • Python3 Pylint check: failed
    • 20 warnings and errors that must be fixed
    • 4 warnings
    • 124 comments to review
  • Pycodestyle check: succeeded
    • 37 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/348/artifact/artifacts/PullRequestReport.html

@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 5 changes in unstable tests
  • Python3 Pylint check: failed
    • 14 warnings and errors that must be fixed
    • 4 warnings
    • 124 comments to review
  • Pycodestyle check: succeeded
    • 37 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/349/artifact/artifacts/PullRequestReport.html

@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 5 changes in unstable tests
  • Python3 Pylint check: failed
    • 14 warnings and errors that must be fixed
    • 4 warnings
    • 124 comments to review
  • Pycodestyle check: succeeded
    • 37 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/350/artifact/artifacts/PullRequestReport.html

@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 3 changes in unstable tests
  • Python3 Pylint check: failed
    • 14 warnings and errors that must be fixed
    • 4 warnings
    • 124 comments to review
  • Pycodestyle check: succeeded
    • 37 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/353/artifact/artifacts/PullRequestReport.html

@vkuznet vkuznet force-pushed the disutils2setuptools branch from c38ee4f to f1e5c63 Compare February 12, 2025 13:23
@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 2 changes in unstable tests
  • Python3 Pylint check: failed
    • 8 warnings and errors that must be fixed
    • 4 warnings
    • 123 comments to review
  • Pycodestyle check: succeeded
    • 35 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/356/artifact/artifacts/PullRequestReport.html

@vkuznet vkuznet force-pushed the disutils2setuptools branch 2 times, most recently from fa79dbb to 874d394 Compare February 12, 2025 13:55
@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 5 changes in unstable tests
  • Python3 Pylint check: failed
    • 30 warnings and errors that must be fixed
    • 4 warnings
    • 132 comments to review
  • Pycodestyle check: succeeded
    • 40 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/357/artifact/artifacts/PullRequestReport.html

@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 30 warnings and errors that must be fixed
    • 4 warnings
    • 132 comments to review
  • Pycodestyle check: succeeded
    • 40 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/358/artifact/artifacts/PullRequestReport.html

@vkuznet vkuznet force-pushed the disutils2setuptools branch from 874d394 to 5becac3 Compare February 12, 2025 14:32
@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 2 changes in unstable tests
  • Python3 Pylint check: failed
    • 29 warnings and errors that must be fixed
    • 4 warnings
    • 131 comments to review
  • Pycodestyle check: succeeded
    • 40 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/359/artifact/artifacts/PullRequestReport.html

@vkuznet vkuznet force-pushed the disutils2setuptools branch from 5becac3 to 576e325 Compare February 12, 2025 15:45
@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 4 changes in unstable tests
  • Python3 Pylint check: failed
    • 25 warnings and errors that must be fixed
    • 4 warnings
    • 131 comments to review
  • Pycodestyle check: succeeded
    • 39 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/360/artifact/artifacts/PullRequestReport.html

@vkuznet
Copy link
Contributor Author

vkuznet commented Feb 12, 2025

@amaltaro , @todor-ivanov , @mapellidario I asked you to review this PR and I want to let you know that I identified that we have setup_wmcore.py file in repository that is not used anywhere. I don't know if we need it and I'll be happy to remove it but before that I want to inform you about this finding as well along the changes I made in this PR.

@amaltaro
Copy link
Contributor

@vkuznet if you couldn't find any reference to it, my suggestion is to make a new commit deleting it and making an explicit note in the initial PR description that it is being deleted because it is unused.

@vkuznet
Copy link
Contributor Author

vkuznet commented Feb 12, 2025

@vkuznet if you couldn't find any reference to it, my suggestion is to make a new commit deleting it and making an explicit note in the initial PR description that it is being deleted because it is unused.

ok, removed and adjusted the description.

@dmwm-bot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 4 changes in unstable tests
  • Python3 Pylint check: failed
    • 25 warnings and errors that must be fixed
    • 4 warnings
    • 132 comments to review
  • Pycodestyle check: succeeded
    • 40 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/WMCore-PR-Report/361/artifact/artifacts/PullRequestReport.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python3 Technical Debt Used to track issues that address technical needs internal to WM team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean-up and refactor WM Core build tools
3 participants