diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 38388594..00000000 --- a/.flake8 +++ /dev/null @@ -1,17 +0,0 @@ -[flake8] -ignore = E501, W503, E402 -builtins = "c, get_config" -exclude = - .cache, - .github, - docs - -enable-extensions = "G" -extend-ignore = - G001, G002, G004, G200, G201, G202, - # black adds spaces around ':' - E203 -per-file-ignores = - # B011: Do not call assert False since python -O removes these calls - # F841 local variable 'foo' is assigned to but never used - tests/*: B011, F841 diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml deleted file mode 100644 index a1375174..00000000 --- a/.github/workflows/check-release.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Check Release -on: - push: - branches: ["main"] - pull_request: - -jobs: - check_release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install Dependencies - run: | - pip install -e . - - name: Check Release - uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ca145a9..7320a94e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11-dev"] fail-fast: false steps: @@ -36,6 +36,15 @@ jobs: name: codecov-umbrella fail_ci_if_error: true + check_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + docs: runs-on: ubuntu-latest steps: @@ -48,20 +57,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.0 - with: - extra_args: --all-files --hook-stage=manual - - name: Help message if pre-commit fail - if: ${{ failure() }} - run: | - echo "You can install pre-commit hooks to automatically run formatting" - echo "on each commit with:" - echo " pre-commit install" - echo "or you can run by hand on staged files with" - echo " pre-commit run" - echo "or after-the-fact on already committed files with" - echo " pre-commit run --all-files --hook-stage=manual" + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1 check_links: runs-on: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae253086..bb792ddf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,3 @@ -ci: - skip: [check-jsonschema] - repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 @@ -54,10 +51,11 @@ repos: hooks: - id: mdformat - - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 + - repo: https://github.com/john-hen/Flake8-pyproject + rev: 1.1.0.post0 hooks: - - id: flake8 + - id: Flake8-pyproject + alias: flake8 additional_dependencies: ["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"] stages: [manual] @@ -70,3 +68,4 @@ repos: files: ^\.github/workflows/ types: [yaml] args: ["--schemafile", "https://json.schemastore.org/github-workflow"] + stages: [manual] diff --git a/pyproject.toml b/pyproject.toml index fdb7e409..56e050c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,9 +50,6 @@ docs = [ before-build-python = ["sudo apt-get update", "sudo apt-get install -qq octave octave-signal liboctave-dev"] before-check-links = ["sudo apt-get update", "sudo apt-get install -qq octave octave-signal liboctave-dev"] -[tool.jupyter-releaser] -skip = ["check-links"] - [tool.hatch.version] path = "oct2py/_version.py" @@ -89,3 +86,26 @@ filterwarnings= [ "ignore:Using deprecated:UserWarning:oct2py", "ignore:Key - value pairs:UserWarning:oct2py", ] + +[tool.flake8] +ignore = "E501, W503, E402" +builtins = "\"c, get_config\"" +exclude = [ + ".cache", + ".github", + "docs", +] +enable-extensions = "\"G\"" +extend-ignore = [ + "G001", + "G002", + "G004", + "G200", + "G201", + "G202", + "E203", +] +per-file-ignores = [ + "tests/*: B011", + "F841", +]