Skip to content

Commit

Permalink
Add typing support (#132)
Browse files Browse the repository at this point in the history
* black formatting and isort
* non relative import paths
* typing
* pyupgrade
* add test for python 3.12;
  • Loading branch information
barrust committed Jan 6, 2024
1 parent 86c4080 commit ef22c59
Show file tree
Hide file tree
Showing 12 changed files with 1,736 additions and 1,701 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand All @@ -23,7 +23,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
python -m pip install -e .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
13 changes: 6 additions & 7 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -175,22 +175,22 @@ ignored-parents=
max-args=12

# Maximum number of attributes for a class (see R0902).
max-attributes=7
max-attributes=35

# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5

# Maximum number of branch for function / method body.
max-branches=12
# Maximum number of branch for function / method body (see R0912)
max-branches=15

# Maximum number of locals for function / method body.
max-locals=15
max-locals=20

# Maximum number of parents for a class (see R0901).
max-parents=7

# Maximum number of public methods for a class (see R0904).
max-public-methods=20
max-public-methods=40

# Maximum number of return / yield for function / method body.
max-returns=6
Expand Down Expand Up @@ -598,8 +598,7 @@ variable-naming-style=snake_case
[EXCEPTIONS]

# Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException, builtins.Exception


[LOGGING]
Expand Down
20 changes: 10 additions & 10 deletions mediawiki/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
"""
mediawiki module initialization
"""
from .mediawiki import MediaWiki, URL, VERSION
from .mediawikipage import MediaWikiPage
from .exceptions import (
MediaWikiException,
PageError,
MediaWikiGeoCoordError,
RedirectError,
from mediawiki.exceptions import (
DisambiguationError,
MediaWikiAPIURLError,
HTTPTimeoutError,
MediaWikiAPIURLError,
MediaWikiCategoryTreeError,
MediaWikiException,
MediaWikiGeoCoordError,
MediaWikiLoginError,
PageError,
RedirectError,
)
from mediawiki.mediawiki import URL, VERSION, MediaWiki
from mediawiki.mediawikipage import MediaWikiPage

__author__ = "Tyler Barrus"
__maintainer__ = "Tyler Barrus"
Expand All @@ -22,8 +22,8 @@
__version__ = VERSION
__credits__ = ["Jonathan Goldsmith"]
__url__ = URL
__bugtrack_url__ = "{0}/issues".format(__url__)
__download_url__ = "{0}/tarball/v{1}".format(__url__, __version__)
__bugtrack_url__ = f"{__url__}/issues"
__download_url__ = f"{__url__}/tarball/v{__version__}"

__all__ = [
"MediaWiki",
Expand Down

0 comments on commit ef22c59

Please sign in to comment.