c-w / gutenberg

A simple interface to the Project Gutenberg corpus.
Apache License 2.0
321 stars 59 forks source link

Fix tests + drop Python 3.5 #143

Closed hugovk closed 2 years ago

codecov-commenter commented 3 years ago

Codecov Report

Merging #143 (c1de9ff) into master (2c9aace) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #143   +/-   ##
=======================================
  Coverage   97.22%   97.22%           
=======================================
  Files          28       28           
  Lines        1080     1080           
=======================================
  Hits         1050     1050           
  Misses         30       30           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2c9aace...c1de9ff. Read the comment docs.

hugovk commented 3 years ago

At least one problem fixed:

$pythonVersionMajor = python -c 'import sys; print(sys.version_info.major)' returns a string and the ($pythonVersionMinor -ge 8) comparison was failing and it was returning the wrong tag.

Need to convert it to an int before comparison. We could do $pythonVersionMajor as well? Well, I'm hoping we'll drop Python 2 support before Python 10 comes out :)


Next: wheels.zip will need updating with the Windows wheel for Python 3.10.


And then ci.yml is failing for older Python versions too, unrelated to this PR:

  File "/usr/local/lib/python3.8/site-packages/rdflib/plugins/sparql/parserutils.py", line 113, in __init__
    self.name = name
AttributeError: can't set attribute

Any ideas on this?

c-w commented 2 years ago

Fixed Python 3.10 on Windows. Dropped support for Python 3.5 which is EOL. Looking into the can't set attribute error.

c-w commented 2 years ago

Looks like the error is related to https://github.com/RDFLib/rdflib/issues/1458. Pinning pyparsing to a 2.x release seems to do the trick. I also dropped 3.10 from the support matrix as rdflib doesn't support it yet.

c-w commented 2 years ago

@hugovk For Python 3.10 support it looks like we'll have to update to rdflib v6 which has a bunch of breaking API changes. Also bsddb3 is deprecated for newer Python versions and should be swapped for berkeleydb. If you're curious, feel free to open a PR with those sorts of changes and I reckon we can drop Python 2.7 at the same time. See https://github.com/c-w/gutenberg/issues/144