Closed alerque closed 3 years ago
The current release doesn't use tox. It runs tests with nose
:
pip install .[test]
nosetests
You can see all tests green here: https://github.com/wireservice/agate-sql/actions/runs/1034818027
Whether CHECK (boolean IN (0, 1))
appears (as in your quoted failure) depends on the versions of SQLAlchemy and maybe the MySQL adapter being used. You can compare against the test environments in the above build.
The difference between pytest
and nose
is irrelevant here. I get the same error when testing with nosetests
as the test runner.
I'm pretty sure the issue is going to turn out to be that your tests require old versions of dependencies. Note from your passing test log:
Collecting parsedatetime!=2.5,!=2.6,>=2.1
Downloading parsedatetime-2.4.tar.gz (58 kB)
I'm testing on a distro that has has up to date versions of all dependencies. Just because your version of testing with pinned versions of everything pass doesn't mean all is well. That will help people that run venv's and know the right things to hold back. However an argument can be made that if it doesn't work on current stable released versions of dependencies that is at least an aging crack if not a bug. In this case the actual library seems to work fine still, just the tests fail, but being able to run tests is very valuable for distro packages that need to check if everything is found in the right places etc.
Just for background, this is issue is being raised at all because I'm trying to get csvkit
and hence its dependencies into the default official Arch Linux package repositories. Vendoring dependencies is not an option.
parsedatetime introduced a breaking change. That is why we exclude specific versions. See:
https://github.com/certbot/certbot/issues/8042 https://github.com/bear/parsedatetime/issues/246 https://github.com/pyca/cryptography/pull/5264 https://github.com/dssg/triage/issues/721 https://github.com/wireservice/agate/issues/743 https://github.com/wireservice/csvkit/issues/1081
We are not the only project to reject those versions of parsedatetime. If, for Arch Linux, it is necessary to use the latest version of parsedatetime, even if it breaks lots of things like certbot, then I guess we will just have to hope that parsedatetime's maintainers un-break things.
OpenSUSE seems to have written a patch https://github.com/bmwiedemann/openSUSE/commit/6ba73c5eb4f4e53416620de528c25e3138d44993 to revert the change in https://github.com/wireservice/agate-sql/issues/33
As I mention in #33, the issue seems to be that, depending on the version of SQLAlchemy and MySQL, either the CHECK (boolean IN (0, 1))
constraint gets added, or it doesn't. But the existence of this constraint has no impact on csvkit or agate-sql whatsoever. So, I can just as well relax the test.
The tests should pass now!
Great, thanks! Will there be a release soon to reflect this? Or should I try applying that SUSE patch for now? I'll hold off a few days if a release is immanent.
0.5.8 should appear on PyPi shortly 🚀
I'm the packager for this on Arch Linux and I'm starting to run into some problems. I realize you use Tox here for testing and that makes sense for your upstream use case, but it does not allow testing in place on a system to confirm that distro packages are serving their functions.
First, using setuptools as a test runner stopped working a while back because datetime as used in this project is no longer compatible with the current released version of datetime.
Second, switching to pytest as a runner, I get the following test failure. I presume this is again a time parsing issue related to Python upstream datetime changes.
Additionally it's worth noting that some other deprecations warnings are in play and Python 3.10 is going to add another failure, although it looks like that might be in a transitive dependency.
It is probably worth updating this project to use current APIs and doing a minor release so that it can be used more robustly than inside a private venv bubble with old releases of stuff.