Closed EwoutH closed 6 months ago
Hi @toruseo! I would like to use this package for my MSc thesis. I'm a maintainer of two open source libraries, so I can help implementing some best practices for packaging, deploying, testing and continuous integration.
This specific issue is particularly important to me, it needs to be build properly for all the other stuff to work and thus enable rapid iteration. So I'm glad to help out!
I understand however that maintenance of a libraries takes time and effort, so I'm curious on what your medium to long term vision is on this library. If you want to have a call sometime to discuss this please let me know!
If you're not able to spend much time on it, that's also fine, but then I might need to create my own fork. I don't prefer that, because I would like this library to grow based on the contributions of multiple people and keep the effort centralised.
I think the problem is fixed now. Can you check?
Sorry for waiting. I am working on this project in my spare time, so my response may be delayed.
Thanks for working on it! I appreciate it, open-source work can be hard and demanding. Thanks!
I confirmed it fixed both in CI and locally!
When attempting to install
uxsim
usingpip install .
orpip install -e .
, the installation process fails during the phase wherepip
tries to get the requirements to build the wheel. This issue arises because thesetup.py
script indirectly imports theuxsim
package, which in turn imports external dependencies such asnumpy
. Since these external dependencies are not yet installed at the point whensetup.py
is executed to determine the installation requirements, this results in aModuleNotFoundError
.Steps to Reproduce
uxsim
repository or download the source code.numpy
,matplotlib
, etc.) already installed.pip install .
orpip install -e .
from the root directory of theuxsim
project.You can also directly run:
Expected Behavior
The
pip install
command should successfully install theuxsim
package along with its specified dependencies without requiring them to be installed beforehand.Actual Behavior
The installation process fails with a
ModuleNotFoundError
, indicating that one of the external packages (numpy
is mentioned specifically) could not be found. This error is traced back to an import statement in theuxsim
package that is executed as part of thesetup.py
script's execution.Impact
This issue prevents the package from being installed in environments where the dependencies are not already present. It affects both development environments and end-users attempting to install
uxsim
for the first time, potentially limiting the adoption and usability of the package.Workaround
A temporary workaround involves manually installing the dependencies listed in
INSTALL_REQUIRES
from thesetup.py
file before attempting to installuxsim
. However, this approach is not ideal as it circumvents the automated dependency resolution and installation process provided bypip
.Suggested Fix
To resolve this issue, it is recommended to refactor the
setup.py
script and the package initialization process to avoid importing the package or any modules that require external dependencies. Instead, consider one of the following approaches:setup.py
without importing them from within the package.setup.py
without executing import statements that depend on external packages.Additional Information
This issue persists even when the dependencies are installed beforehand, indicating that the version fetching mechanism is inherently flawed and requires attention regardless of the installation environment.
You can see the full error message also here: https://github.com/EwoutH/UXsim/actions/runs/8110064753/job/22166521983
Related: