Skip to content

Commit

Permalink
Removed py3.7 support, chagned to flit
Browse files Browse the repository at this point in the history
* Improved some typing and fixed linting errors
* Adding more type annotations
  • Loading branch information
muhrin committed Aug 14, 2024
1 parent 12e4473 commit ae0b8f6
Show file tree
Hide file tree
Showing 106 changed files with 1,151 additions and 1,837 deletions.
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
ignore = E203, E266, E501, W503, F403, F401
max-line-length = 120
ignore = E203, E266, E501, W503, F403, F401, E704
max-line-length = 100
max-complexity = 18
select = B,C,E,F,W,T4,B9
exclude =
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.8
- uses: pre-commit/action@v2.0.0
python-version: '3.10'
- uses: pre-commit/action@v3.0.1

tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
include:
- python-version: 3.8
- python-version: 3.10
rabbitmq: 3.6
- python-version: 3.8
- python-version: 3.10
rabbitmq: 3.8

steps:
Expand Down
91 changes: 64 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,68 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
args: ['--maxkb=5000']
- id: end-of-file-fixer
- id: check-case-conflict
- id: detect-private-key
- id: check-docstring-first
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args: [ '--maxkb=5000' ]
- id: end-of-file-fixer
- id: check-case-conflict
- id: detect-private-key
- id: check-docstring-first
- id: fix-encoding-pragma
exclude: &exclude_files >
(?x)^(
docs/.*|
)$
args: [ --remove ]
- id: trailing-whitespace

- repo: https://github.com/ikamensh/flynt/
rev: '1.0.1'
hooks:
- id: flynt

- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
exclude: (.*)/migrations
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: [ "-c", ".bandit.yaml" ]
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.35.0
hooks:
- id: commitizen
stages: [commit-msg]

- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8

- repo: https://github.com/pycqa/isort
rev: '5.13.2'
hooks:
- id: isort

- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
hooks:
- id: bandit
args: [ "-c", ".bandit.yaml" ]

- repo: https://github.com/PyCQA/pylint
rev: v3.2.6
hooks:
- id: pylint
language: system
exclude:
(?x)^(
docs/.*|
test/.*
)$

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.29.0
hooks:
- id: commitizen
stages: [ commit-msg ]

- repo: https://github.com/srstevenson/nb-clean
rev: 3.3.0
hooks:
- id: nb-clean
6 changes: 3 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=missing-docstring, useless-object-inheritance, locally-disabled
disable=missing-docstring, useless-object-inheritance, locally-disabled, consider-using-from-import, use-dict-literal

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -372,7 +372,7 @@ known-third-party=enchant
[DESIGN]

# Maximum number of arguments for function / method
max-args=6
max-args=10

# Maximum number of attributes for a class (see R0902).
max-attributes=12
Expand Down Expand Up @@ -422,4 +422,4 @@ valid-metaclass-classmethod-first-arg=mcs

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtin.Exception
File renamed without changes.
2 changes: 1 addition & 1 deletion black.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
line-length = 120
line-length = 100
target-version = ['py37', 'py38', 'py39', 'py310']
include = '\.pyi?$'
exclude = '''
Expand Down
8 changes: 3 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from importlib.machinery import SourceFileLoader

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

from importlib.machinery import SourceFileLoader

sys.path.insert(0, os.path.abspath(os.path.dirname("__file__")))

module = SourceFileLoader(
"version",
os.path.join(
os.path.dirname(os.path.abspath(__file__)), "..", "..", "mincepy", "version.py"
),
os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "mincepy", "version.py"),
).load_module()

autoclass_content = "both"
Expand Down
Loading

0 comments on commit ae0b8f6

Please sign in to comment.