Closed iyanmv closed 5 months ago
Here I attach the logs from pytest (removing the ones caused by missing xarray) test_errors.txt
Hi @iyanmv -
The dependencies on both xarray and git
in testing would be nice to make more clear. Your suggestions both sound good.
The other issues look like they are either the ones resolved by #723 (which will be released in CmdStanPy 1.2.1 after the CmdStan release dust settles, probably next week) or are caused by your CmdStan source files being in a location that does not have read/write access
Indeed that patch fixes one test, but not the rest. I think you are right that most of them are permission issues.
To be honest, I don't know how to package this without making too many changes. Are you aware of any distro offering this in their repos? I think the simplest solution for now is to copy the CmdStan directory to a writable temp path just for the tests.
I know very little about distro packaging, unfortunately. It is a restriction of CmdStan's current make
-based build system that CmdStan needs to be able to write to its own directory, which I know makes several packaging standards unhappy. Your suggestion would probably fix the tests, but anyone actually trying to use CmdStanPy would get similar errors in their own code
Out of tree builds are one of the items on the wishlist for a new build system (probably based on CMake or something similar) but there's no timeline and not a ton of free effort to spare there, unfortunately. The make
-based system works just barely enough that a replacement isn't mandatory, so it languishes on
Since it sounds like all the failures are accounted for, I'm going to go ahead and close this issue. Sorry it wasn't a bit more satisfyingly resolved!
Summary:
Some tests fail when using the release tarball.
Description:
In order to create a package for a distribution, I download the latest release tarball, build it (or in this case create a wheel package file
cmdstanpy-1.2.0-py3-none-any.whl
) and then run the tests on an isolated environment that only installs that wheel tarball together with the required dependencies (cmdstan, numpy, pandas, tqdm and stanio).I'm running the tests with:
And this are the results:
Some tests fail to run because they assume that
git
is installed and that the directory is a git repo in order to delete compiled models and output results (seecleanup_test_files()
from module conftest.py).Others fail because they assume xarray is installed, when it's not marked as a test dependency (only optional).
To solve the second issue I will simply mark xarray as a dependency instead of optional dependency. For the first, I could write a patch but I first want to hear from you if it makes sense. My idea is to modify the function
cleanup_test_files()
to check ifgit
is installed and ifDATAFILES_PATH
is a git repo. If both are true, then the current code can be used. Otherwise, nothing is done.Additional Information:
For context, this is the (provisional) PKGBUILD that I wrote:
Current Version:
cmdstan 2.34.0 (with patch https://github.com/stan-dev/cmdstan/pull/1239 included) cmdstanpy 1.2.0