Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3.10 collections test suite update #312

Closed
wants to merge 20 commits into from

Conversation

mburridge96
Copy link

@mburridge96 mburridge96 commented Jul 31, 2022

Python 3.10 collections depreciated the use of Iterable. Iterable has now been moved to collections.abc.

Tested in python 3.9 and 3.10 and passed 100% of tests. Python 3.8 had type issues with SBOL.components (ABCMeta type not subscriptable) so could not run helper functions. Question is does the testing suite require python 3.8 support? If it does will have to look into it further

Updated requirements.txt to be more exhaustive of requirements.

Added small troubleshooting section for Ubuntu setup.
fix #310

Updated requirements.txt to include all required packages
Collections Iterable depreciated, now located in collections.abs
Further updated requirements.txt from successful passing test build
sbol3>=1.0b10
sbol-utilities>=1.0a15
biopython
astroid==2.11.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's typically better to avoid including indirect requirements in the requirements.txt list.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok didn't realise! Always thought it was better to be more explicit to have a more consistent environment. Will remove.

@@ -1,5 +1,5 @@
import math
from collections import Iterable
from collections.abc import Iterable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is iterable a type options? If so, we can get backward compatibility through from __future__ import annotations

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So using future does allow collections to be backwards compatible, but v3.8 didn't yet have .removesuffix() for strings which is used through part_retrieve.py.

Added some handling to this to get around this issue, but 2 tests still fail in py v3.8 as filecmp asserts deem integrated package and collated file to be different in test_collation and test_all_import_types.

Copy link
Contributor

@jakebeal jakebeal Aug 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those issues are likely due to the update in rdflib that causes it to no longer have a spurious newline, which I fixed in #311. If you update your branch, it should resolve those issues. If it doesn't resolve those issues, it will be necessary to look deeper.

@jakebeal jakebeal added the automation GitHub action automation work label Aug 1, 2022
mburridge96 and others added 9 commits August 2, 2022 23:17
Added handling for py v3.8 prefix/suffix handling.
py v3.8 still fails on test_collation adn test_all_import_types
Updated requirements.txt to include all required packages
Collections Iterable depreciated, now located in collections.abs
Further updated requirements.txt from successful passing test build
Added handling for py v3.8 prefix/suffix handling.
py v3.8 still fails on test_collation adn test_all_import_types
@jakebeal
Copy link
Contributor

@mburridge96 Are these failures expected here?

@mburridge96
Copy link
Author

Not at all, should have failed on testing but not on linting. Will have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation GitHub action automation work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test against Python 3.10
2 participants