Skip to content

Conversation

@barskern
Copy link
Contributor

@barskern barskern commented Jul 16, 2025

A start of restructuring the python code to a package/module. This allows easier inclusions, cleaner interfaces and also makes it easier to work and maintain the code. The work has been done partly at the 2nd computing workshop of SHIP. The splitting and re-naming has been done at a best effort practice, and due to a lack of tools locally (specifically ROOT), these changes are not really tested. Hence please do clone these changes to try them out locally.

This PR also introduces UV, which is a great package manager for python. In this case, it seems as though "only" root and the standard libraries are used, but using UV could open the possibilities for easy use of other libraries. Also it allows managing multiple python versions seamlessly. See their website for more info.

NOTE! When observed I have also changed some minor naming issues, which are not backwards compatible. Because the very nature of this PR is to break backwards compatibility completely, I deemed it worthwhile to make those changes in the same PR.

@barskern barskern requested a review from a team as a code owner July 16, 2025 09:43
@barskern barskern force-pushed the oruud/structure-python-as-package branch from 75707b0 to 6f169ce Compare July 16, 2025 09:47
@olantwin
Copy link
Contributor

Thank you, this is very impressive work! The structuring into different subdirectories seems very logical and a good first step to get our python files under control.

I know about uv and have been meaning to experiment with it. The question will be how we can allow it to integrate with packages from LCG, CVMFS and support the python environment needed by SWAN. Apart from the lock file, I don't see how much of this depends on uv.

@olantwin
Copy link
Contributor

If you resolve the merge conflict, at least the main scripts can already be tested in the CI, with manual testing to follow.

@barskern barskern force-pushed the oruud/structure-python-as-package branch from 6f169ce to 8062e2d Compare July 16, 2025 11:28
@barskern
Copy link
Contributor Author

@olantwin You are right about uv for the moment not really bringing anything to the table in this repo besides the minimal lockfile in which I simply included pytest for development purposes. Anyhow, it is how I generated the pyproject and it uses e.g. hatchling and some other modern tooling. As you say, the challenge will probably be to figure out how to define the dependencies that come from other sources than pypi.

@barskern
Copy link
Contributor Author

@olantwin So for the last part now, the fairship package has to be installed into the runtine environment setup by the setUp.sh script. I was looking a bit at it, but I don't know the intricacies of how its all put together. As you perhaps know already, could you tie it together?

@olantwin
Copy link
Contributor

@olantwin So for the last part now, the fairship package has to be installed into the runtine environment setup by the setUp.sh script. I was looking a bit at it, but I don't know the intricacies of how its all put together. As you perhaps know already, could you tie it together?

Yes, I'll figure that part out.

@barskern barskern force-pushed the oruud/structure-python-as-package branch from 56463c4 to 0ebb3aa Compare October 21, 2025 12:50
@barskern barskern force-pushed the oruud/structure-python-as-package branch from 0ebb3aa to 2a2fcbb Compare October 23, 2025 15:12
@barskern barskern force-pushed the oruud/structure-python-as-package branch from 2a2fcbb to 01d3ab4 Compare October 23, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants