bradbell / cmpad

Compare Algorithmic Differentaiton Packages
1 stars 1 forks source link

environment.sh problems #13

Open bradbell opened 6 days ago

bradbell commented 6 days ago

When I run the following command om MacOS with Homebrew

in/get_package.sh release all

It seems that the install of toml does not really happen and I get the following output:

...
cpp/bin/get_package.sh: autodiff OK
source bin/environment.sh build_type=release
# begin: creatting build/release
pip install toml
pip install pytest
pip install numpy==1.26.4
# end: creatting build/release
python/bin/get_package.py release autograd
Traceback (most recent call last):
  File "/Users/bradbell/repo/cmpad.git/python/bin/get_package.py", line 44, in <module>
    import toml
ModuleNotFoundError: No module named 'toml'

If I then check for toml and then re-install it and then check for toml, I get

cmpad.git>ls build/release/lib/python3.12/site-packages/toml
ls: build/release/lib/python3.12/site-packages/toml: No such file or directory
cmpad.git>source bin/environment.sh
(release) cmpad.git>pip install toml
Collecting toml
  Using cached toml-0.10.2-py2.py3-none-any.whl.metadata (7.1 kB)
Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Installing collected packages: toml
Successfully installed toml-0.10.2
(release) cmpad.git>ls build/release/lib/python3.12/site-packages/toml
__init__.py decoder.py  ordered.py
__pycache__ encoder.py  tz.py
utke1 commented 6 days ago

In https://github.com/bradbell/cmpad/blob/3febdb224223cf3bfbd7213b10fd8da154255d07/bin/environment.sh#L27 I would remove the redirect to /dev/null. Personally I am pretty much always in favor of showing most command outputs and I am not sure that hiding the output to reduce clutter here outweighs the downside of not seeing what the failure might have been the first time around and why the failure didn't cause an exit from the script

bradbell commented 5 days ago

I remove the removed the redirect (as suggested above). It turns out that even on linux, pip was not separating the debug and release environments. In addition, it was also seeing another virtual environment that I have my Fedora system.

The following change passes the bin/check_all.sh test on linux: https://github.com/bradbell/cmpad/commit/c73442b256ae49132d3ea555a8f1efb67f756fd0

It also fixed the confusion mentioned above on MacOS.