Skip to content

Conversation

ciscorn
Copy link
Contributor

@ciscorn ciscorn commented Dec 25, 2022

I have made things!

  • Provide more specific type-hints for GeoDjango modules.
  • Fixed some missing exports in contrib/gis/**/__init__.py
  • Removed unintentional re-exports in many modules.

Related issues

No

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Oh wow! Thanks a lot! This is amazing!

But, I literally have 0 experience with gis.
Maybe @intgr or @adamchainz have more knowledge?

@intgr
Copy link
Collaborator

intgr commented Dec 25, 2022

Nope, I have no experience with Django GIS.

Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

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

Looks good on a cursory read. As noted above, the TypedDjango team doesn't use GeoDjango. I'm inclined to just merge this as is, it's filling out types that used to be just Any.

Changes like this are rarely perfect and we shouldn't expect them to be. If it causes regressions for users, they will be reported and can be improved.

@intgr
Copy link
Collaborator

intgr commented Jan 4, 2023

There was some overlap between this PR and #1265 (which just got merged to master).

I have pushed a merge with the latest master.

Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

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

After looking into this some more, there are lots of re-exports that look like they shouldn't be re-exports.

Usually Django only has re-exports in __init__.py files. Also items in explicit module __all__ = [...] should be re-exported. The remaining typically should not be.

@intgr
Copy link
Collaborator

intgr commented Jan 4, 2023

PS: I don't expect you to fix all the pre-existing incorrect re-exports. Just fix the new ones you have added in this PR.

Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

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

Thanks! Waiting for the CI to finish.

@intgr
Copy link
Collaborator

intgr commented Jan 4, 2023

Maybe @mjakob can try this out and share some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants