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

Bug. TypeError: 'NoneType' object is not subscriptable. Unpin PyShp to fix in Cross_platform branch? #97

Open
JamesParrott opened this issue Oct 10, 2024 · 1 comment

Comments

@JamesParrott
Copy link
Collaborator

The main branch of sDNA has a static copy of PyShp 2.1.0

__version__ = "2.1.0"

The bug in the description comes from the older versions of PyShp 2.1.0, so can still occur in sDNA using these older versions of PyShp. PyShp fixed the bug in v2.1.3 (and is now on v2.3.1)
GeospatialPython/pyshp@f2f91ce

In the cross platform branch, PyShp is pinned to 2.1.0 for strict compatibility.

https://github.com/fiftysevendegreesofrad/sdna_plus/blob/Cross_platform/requirements/base.txt

It's trivial to relax or bump the version pin. But the pin currently ensures the two branches use exactly the same code.

Unpinning the PyShp version is a design change towards dynamic linking instead of dynamic linking with version pinning (being reasonably close to the previous static linking). This would only affect the other branch though.

A quick scroll through the issues will show numerous other documented differences between the branches (in order to achieve compilation and passing of the vast majority of the regression tests). In comparison to those, shipping or allowing updated PyShp versions, is easy, harmless and best practise.

I've tested removing the version pin, in a new branch based on the Cross_Platform branch:

Cross_platform...Latest_PyShp_(do_not_pin_to_v2.1.0)

No test failures occurred:
https://github.com/fiftysevendegreesofrad/sdna_plus/actions?query=branch%3ALatest_PyShp_%28do_not_pin_to_v2.1.0%29++

The existing the tests didn't uncover this bug however.

@JamesParrott
Copy link
Collaborator Author

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

No branches or pull requests

1 participant