diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 443353b32..000000000 --- a/.flake8 +++ /dev/null @@ -1,12 +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, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73deb9c74..1f357d302 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ env: defaults: run: - shell: bash -e {0} + shell: bash -eux {0} jobs: build: @@ -108,22 +108,20 @@ jobs: jupyter notebook --version jupyter notebook --help - pre-commit: + link_check: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v2 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install Jupyterlab - run: pip install -e . - - uses: pre-commit/action@v2.0.0 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 with: - extra_args: --all-files --hook-stage=manual - - name: Help message if pre-commit fail - if: ${{ failure() }} - run: | - 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" + ignore-links: "https://playwright.dev/docs/test-cli/" + + pre_commit: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v2 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1 diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 0590dfe9b..059aec440 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -16,10 +16,6 @@ jobs: check_release: runs-on: ubuntu-latest timeout-minutes: 30 - strategy: - matrix: - group: [check_release, link_check] - fail-fast: false steps: - name: Checkout uses: actions/checkout@v2 @@ -29,18 +25,12 @@ jobs: run: | pip install -e . - name: Check Release - if: ${{ matrix.group == 'check_release' }} - uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 + uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 with: token: ${{ secrets.GITHUB_TOKEN }} - version_spec: next - - name: Check Links - if: ${{ matrix.group == 'link_check' }} - uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 - name: Upload Distributions uses: actions/upload-artifact@v2 - if: ${{ matrix.group == 'check_release' }} with: name: notebook-jupyter-releaser-dist-${{ github.run_number }} path: .jupyter_releaser_checkout/dist diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d58638c8..679c53378 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,3 @@ -ci: - # skip any check that needs internet access - skip: [prettier, integrity] - repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 @@ -40,15 +36,24 @@ repos: args: [--max-line-length=200] stages: [manual] - - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.10.1 + hooks: + - id: validate-pyproject + stages: [manual] + + - repo: https://github.com/executablebooks/mdformat + rev: 0.7.16 hooks: - - id: flake8 + - id: mdformat + + - repo: https://github.com/john-hen/Flake8-pyproject + rev: 1.0.1 + hooks: + - id: Flake8-pyproject + alias: flake8 additional_dependencies: - [ - "flake8-bugbear==22.6.22", - "flake8-implicit-str-concat==0.2.0", - ] + ["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"] stages: [manual] - repo: https://github.com/sirosen/check-jsonschema @@ -67,7 +72,8 @@ repos: name: prettier entry: 'npm run prettier:files' language: node - types_or: [json, markdown, ts, tsx, javascript, jsx, css] + types_or: [json, ts, tsx, javascript, jsx, css] + stages: [manual] - id: integrity name: integrity entry: 'npm run integrity --force' diff --git a/readthedocs.yml b/.readthedocs.yaml similarity index 100% rename from readthedocs.yml rename to .readthedocs.yaml diff --git a/package.json b/package.json index b16bd4cf5..86d9b4596 100644 --- a/package.json +++ b/package.json @@ -76,13 +76,7 @@ "version-cmd": [ "jlpm run release:bump --force --skip-commit" ], - "ignore-links": [ - "https://playwright.dev/docs/test-cli/" - ] - }, - "skip": [ - "check-links", - "check-manifest" - ] + "post-version-spec": "dev" + } } } diff --git a/pyproject.toml b/pyproject.toml index 7fba5d6ae..b01be8731 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling>=1.5", "jupyterlab>=4.0.0a30,<5"] +requires = ["hatchling>=1.11", "jupyterlab>=4.0.0a30,<5"] build-backend = "hatchling.build" [project] @@ -66,6 +66,7 @@ dev = [ [tool.hatch.version] path = "notebook/_version.py" +validate-bump = false [tool.hatch.build.targets.wheel.shared-data] "notebook/labextension" = "share/jupyter/labextensions/@jupyter-notebook/lab-extension" @@ -125,3 +126,18 @@ filterwarnings = [ "ignore:make_current is deprecated; start the event loop first", "ignore:clear_current is deprecated" ] + +[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", + # black adds spaces around ':' + "E203", +]