From 447b62c4816efbd85727a12191a310bac5c416cc Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 19 May 2022 06:46:31 -0700 Subject: [PATCH] fix CI (#4) --- .flake8 | 15 ++++++++++ .flake8-tests | 28 +++++++++++++++++++ .github/ISSUE_TEMPLATE/documentation-issue.md | 10 ------- .github/ISSUE_TEMPLATE/new-typing-feature.md | 10 ------- .github/ISSUE_TEMPLATE/other-issue.md | 10 ------- .../ISSUE_TEMPLATE/typing-extensions-issue.md | 10 ------- .github/workflows/build-docs.yml | 26 ----------------- .github/workflows/ci.yml | 4 +-- .github/workflows/package.yml | 2 -- test-requirements.txt | 3 ++ 10 files changed, 48 insertions(+), 70 deletions(-) create mode 100644 .flake8 create mode 100644 .flake8-tests delete mode 100644 .github/ISSUE_TEMPLATE/documentation-issue.md delete mode 100644 .github/ISSUE_TEMPLATE/new-typing-feature.md delete mode 100644 .github/ISSUE_TEMPLATE/other-issue.md delete mode 100644 .github/ISSUE_TEMPLATE/typing-extensions-issue.md delete mode 100644 .github/workflows/build-docs.yml create mode 100644 test-requirements.txt diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..fc71a6e2 --- /dev/null +++ b/.flake8 @@ -0,0 +1,15 @@ +[flake8] + +max-line-length = 90 +ignore = + # irrelevant plugins + B3, + DW12, + # code is sometimes better without this + E129, + # consistency with mypy + W504 +exclude = + # tests have more relaxed formatting rules + # and its own specific config in .flake8-tests + src/test_typing_extensions.py, diff --git a/.flake8-tests b/.flake8-tests new file mode 100644 index 00000000..5a97fe89 --- /dev/null +++ b/.flake8-tests @@ -0,0 +1,28 @@ +# This configuration is specific to test_*.py; you need to invoke it +# by specifically naming this config, like this: +# +# $ flake8 --config=.flake8-tests [SOURCES] +# +# This will be possibly merged in the future. + +[flake8] +max-line-length = 100 +ignore = + # temporary ignores until we sort it out + B017, + E302, + E303, + E306, + E501, + E701, + E704, + F722, + F811, + F821, + F841, + W503, + # irrelevant plugins + B3, + DW12, + # consistency with mypy + W504 diff --git a/.github/ISSUE_TEMPLATE/documentation-issue.md b/.github/ISSUE_TEMPLATE/documentation-issue.md deleted file mode 100644 index 6122c8f5..00000000 --- a/.github/ISSUE_TEMPLATE/documentation-issue.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Documentation issue -about: Report a problem or suggest changes for the documentation at https://typing.readthedocs.io/ -title: '' -labels: 'topic: documentation' -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/new-typing-feature.md b/.github/ISSUE_TEMPLATE/new-typing-feature.md deleted file mode 100644 index 733df29e..00000000 --- a/.github/ISSUE_TEMPLATE/new-typing-feature.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: New typing feature -about: Suggest a new feature for Python's typing system -title: '' -labels: 'topic: feature' -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/other-issue.md b/.github/ISSUE_TEMPLATE/other-issue.md deleted file mode 100644 index 484282c7..00000000 --- a/.github/ISSUE_TEMPLATE/other-issue.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Other issue -about: Report any other issue -title: '' -labels: 'topic: other' -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/typing-extensions-issue.md b/.github/ISSUE_TEMPLATE/typing-extensions-issue.md deleted file mode 100644 index 226796e6..00000000 --- a/.github/ISSUE_TEMPLATE/typing-extensions-issue.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: typing-extensions issue -about: Report a problem or suggest changes for the typing-extensions library -title: '' -labels: 'topic: typing-extensions' -assignees: '' - ---- - - diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml deleted file mode 100644 index 43711d0f..00000000 --- a/.github/workflows/build-docs.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build the documentation - -on: - pull_request: - -permissions: - contents: read - -jobs: - build: - - name: Build documentation - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Install dependencies - run: | - pip install --upgrade pip - pip install -r docs/requirements.txt - - name: Build the documentation - run: make -C docs html diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 302b2cae..43986802 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: run: | # Be wary of running `pip install` here, since it becomes easy for us to # accidentally pick up typing_extensions as installed by a dependency - cd typing_extensions/src + cd src python -m unittest test_typing_extensions.py linting: @@ -61,4 +61,4 @@ jobs: run: flake8 - name: Lint tests - run: flake8 --config=.flake8-tests typing_extensions/src/test_typing_extensions.py + run: flake8 --config=.flake8-tests src/test_typing_extensions.py diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 25f95868..4e270719 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -29,7 +29,6 @@ jobs: - name: Build and install wheel run: | - cd typing_extensions python -m build . export path_to_file=$(find dist -type f -name "typing_extensions-*.whl") echo "::notice::Installing wheel: $path_to_file" @@ -60,7 +59,6 @@ jobs: - name: Build and install sdist run: | - cd typing_extensions python -m build . export path_to_file=$(find dist -type f -name "typing_extensions-*.tar.gz") echo "::notice::Installing sdist: $path_to_file" diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..658ae0a5 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +flake8 +flake8-bugbear +flake8-pyi