-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move typestubs -> wikitextprocessor/
- Loading branch information
1 parent
dbdbe61
commit 811e656
Showing
2 changed files
with
74 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
811e656
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use the src-layout to let setuptools discovery the package code automatically. The wiktextract project's pyproject.toml file uses the "custom discovery" feature, but every time a new directory is created the pyproject.toml file needs to be updated.
811e656
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error messages that setuptools gives for the layout stuff are so bad. I've had it happen twice, and I'd already forgotten what the cryptic message about flat layout meant (which was, don't have extra folders in the same directory as your package source folders...), so it took ages to figure out again.
Moving things over into a src directory is probably going to bite us in the ass one way or another (I just know it), so let's keep things as they are and add appropriate package names into pyproject.toml. I'll see if I can figure it out.
811e656
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip install ... -e .
worked out,make test
passed (as you'd expect), committing.811e656
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using pylint? Because this commit adds some unnecessary types to local variables, like
namespace_id: int = int(page_element.findtext
. mypy shouldn't throw error if: int
is not added becuase it can tell the variable type from the function's return type. Maybe you're using pylint? pylint's default rules are too strict, and each lint feature needs to be enabled manually. I'd recommend Ruff, it's default settings are more reasonable.811e656
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm adding the type-hints manually. That one's a bit silly, I admit. EDIT: I had to check to see whether int() throws and error or returns None, so it's not always obvious whether it's
Optional[int]
orint
, and yes, it's a bit silly, but also explicit.The commit failed because I had uncommitted changes I didn't realize fixed an issue with tests (which is why my make test passed while github's failed).