Skip to content

Update python requirement#345

Open
TheoLaudatQM wants to merge 3 commits intomainfrom
fix/python_requirement
Open

Update python requirement#345
TheoLaudatQM wants to merge 3 commits intomainfrom
fix/python_requirement

Conversation

@TheoLaudatQM
Copy link
Copy Markdown
Collaborator

No description provided.

@TheoLaudatQM TheoLaudatQM requested a review from yomach August 21, 2025 13:05
@TheoLaudatQM TheoLaudatQM force-pushed the fix/python_requirement branch from 088813d to 9205050 Compare October 20, 2025 15:25
@TheoLaudatQM
Copy link
Copy Markdown
Collaborator Author

Hey @yomach since I had to update the poetry lock file, can you please take a quick look if everything is fine before I merge it?

@yomach
Copy link
Copy Markdown
Contributor

yomach commented Oct 20, 2025

Hey @yomach since I had to update the poetry lock file, can you please take a quick look if everything is fine before I merge it?

Did you do poetry install and everything worked?

@TheoLaudatQM
Copy link
Copy Markdown
Collaborator Author

It actually didn't because of a breaking change in numpy (distributils) from python 3.12 onward:

    | Command '[...]' returned non-zero exit status 1.
    |
    | Running from numpy source directory.
    | setup.py:67: DeprecationWarning:
    |
    |   `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
    |   of the deprecation of `distutils` itself. It will be removed for
    |   Python >= 3.12. For older Python versions it will remain present.
    |   It is recommended to use `setuptools < 60.0` for those Python versions.
    |   For more details, see:
    |     https://numpy.org/devdocs/reference/distutils_status_migration.html

Do I need to manually take care of these dependencies, or is there a smarter way to do it?

@yomach
Copy link
Copy Markdown
Contributor

yomach commented Oct 20, 2025

  1. There are better ways, we can ask R&D for help if needed.
  2. I'm not even sure we need it here, the Python (and numpy) requirements will come from qm-qua and qualang-tools... We can have much leaner requirements here
  3. In any case, you can copy numpy (and others) from here: https://github.com/qm-labs/qm-qua-sdk/blob/main/pyproject.toml

@TheoLaudatQM
Copy link
Copy Markdown
Collaborator Author

Shouldn't all the dependencies come from qm-qua anyway?
In any case, I tried copying and pasting the requirements from qm-qua, and it is still not working, so the simplest will probably be to take it with R&D or DevOps in order to set up the pyproject file properly.
We did it without poetry for the qualibration_graph directory in qua-libs, and it is working like a charm, so there is something that I clearly don't understand with poetry...

@TheoLaudatQM TheoLaudatQM requested a review from OziEgri December 5, 2025 12:58
@OziEgri
Copy link
Copy Markdown
Collaborator

OziEgri commented Dec 8, 2025

@TheoLaudatQM , I am not sure what dependencies are needed but Poetry is mostly used for configuring virtual env (like requirments.txt on steroids) If you want to make sure you run with specific versions of libs, its a great way to do it. If your code runs at an environment or virtual environment where all needed libs for the interpreter are alredy installed, than no need to use poetry, but if you plan for it to work on other machine, or other virtual env, then there is. I hope that helped. If not, let's talk.
From what I see, the test recommands creting the .lock file again, as the .toml is old..

@TheoLaudatQM
Copy link
Copy Markdown
Collaborator Author

Thanks @OziEgri. Poetry has always been used to validate the requirements on qua-libs and py-qua-tools and check that users can seamlessly install all the packages with the version requirements and dependencies (it was implemented before I joined QM).
Now this PR is just about allowing python 3.12 which is now supported by qm-qua, but I am getting dependency errors with poetry which was working fine before.
This is PR directly comes from a customer so it has relatively high priority, but I have no idea how to solve it (I already recreated the lock files and update the toml file, but with no success), do you?

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.

3 participants