From bbe5b1bf909f60f0e42a04bfec5cc9ccc31facef Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 16:51:31 -0600 Subject: [PATCH 01/11] Create wemake-python-try.yml --- .github/workflows/wemake-python-try.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/wemake-python-try.yml diff --git a/.github/workflows/wemake-python-try.yml b/.github/workflows/wemake-python-try.yml new file mode 100644 index 000000000000..1f973f3c6d43 --- /dev/null +++ b/.github/workflows/wemake-python-try.yml @@ -0,0 +1,16 @@ + +name: "Pull Request Labeler" +on: + pull_request_target: + types: [opened, synchronize, reopened, edited] + +jobs: + pr-labeler: + runs-on: ubuntu-latest + steps: + - name: wemake-python-styleguide + uses: wemake-services/wemake-python-styleguide@latest + with: + reporter: 'github-pr-check' + env: + GITHUB_TOKEN: ${{ secrets.github_token }} From 8f9380022cc271a387539c40f678f3d3787201be Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 17:02:24 -0600 Subject: [PATCH 02/11] Create wemake-python.yml --- .github/workflows/wemake-python.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/wemake-python.yml diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml new file mode 100644 index 000000000000..f234e2bc382b --- /dev/null +++ b/.github/workflows/wemake-python.yml @@ -0,0 +1,15 @@ +name: "Lint Test wemake-python" +on: + pull_request_target: + types: [opened, synchronize, reopened, edited] + +jobs: + pr-labeler: + runs-on: ubuntu-latest + steps: + - name: wemake-python-styleguide + uses: wemake-services/wemake-python-styleguide@0.15.2 + with: + reporter: 'github-pr-check' + env: + GITHUB_TOKEN: ${{ secrets.github_token }} From 0b2140c657383601513738cc7f24035356b11bd9 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 17:15:08 -0600 Subject: [PATCH 03/11] Create setup.cfg --- setup.cfg | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000000..299720d1efe3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,64 @@ +# All configuration for plugins and other utils is defined here. +# Read more about `setup.cfg`: +# https://docs.python.org/3/distutils/configfile.html + + +# === Linter configuration === +# You can reuse this configuration in your own projects. +# See: https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/nitpick.html + +[flake8] +# Base flake8 configuration: +# https://flake8.pycqa.org/en/latest/user/configuration.html +format = wemake +show-source = True +statistics = False +doctests = True + +# Plugins: +max-complexity = 6 +max-line-length = 80 + +# darglint configuration: +# https://github.com/terrencepreilly/darglint +strictness = long +docstring-style = numpy + +# Self settings: +max-imports = 100 + +# Excluding some directories: +exclude = + .git + __pycache__ + .venv + .eggs + *.egg + dist + +# Exclude some pydoctest checks globally: +ignore = D100, D104, D401, W504, RST303, RST304, DAR103, DAR203 + +per-file-ignores = + # Pytest fixtures? Path needs fixing! + numpy/tests/*.py: WPS442 + + +[isort] +# isort configuration: +# https://github.com/timothycrosley/isort/wiki/isort-Settings +include_trailing_comma = true +use_parentheses = true +# See https://github.com/timothycrosley/isort#multi-line-output-modes +multi_line_output = 4 +# Is the same as 80 in flake8: +line_length = 80 + +# We need these lines for Github Action to work correctly, +# **please** do not copy it to your own configs: +default_section = THIRDPARTY +known_first_party = wemake_python_styleguide* +skip_glob = + # These folders contain code badly written for reasons: + tests/fixtures/** + tests/**/snapshots/** From 06dddc7c1a018a7d49d94eb6d763092deae6860f Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 17:26:38 -0600 Subject: [PATCH 04/11] try older version? --- .github/workflows/wemake-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index f234e2bc382b..a34937231f92 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: wemake-python-styleguide - uses: wemake-services/wemake-python-styleguide@0.15.2 + uses: wemake-services/wemake-python-styleguide@0.13.4 with: reporter: 'github-pr-check' env: From 8518cbc9daf8ca2386a264c1791c1f10b8295422 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 17:31:46 -0600 Subject: [PATCH 05/11] try 1.14.1? --- .github/workflows/wemake-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index a34937231f92..2f13636e5cc9 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: wemake-python-styleguide - uses: wemake-services/wemake-python-styleguide@0.13.4 + uses: wemake-services/wemake-python-styleguide@0.14.1 with: reporter: 'github-pr-check' env: From dbd2ee477f825641db3d9a45660a5c0a550d2fb1 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 17:36:07 -0600 Subject: [PATCH 06/11] Try terminal reporter? --- .github/workflows/wemake-python.yml | 4 ++-- setup.cfg | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index 2f13636e5cc9..8a4caf59f801 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -4,12 +4,12 @@ on: types: [opened, synchronize, reopened, edited] jobs: - pr-labeler: + linter: runs-on: ubuntu-latest steps: - name: wemake-python-styleguide uses: wemake-services/wemake-python-styleguide@0.14.1 with: - reporter: 'github-pr-check' + reporter: 'terminal' env: GITHUB_TOKEN: ${{ secrets.github_token }} diff --git a/setup.cfg b/setup.cfg index 299720d1efe3..7117e1189aaf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,8 +36,6 @@ exclude = *.egg dist -# Exclude some pydoctest checks globally: -ignore = D100, D104, D401, W504, RST303, RST304, DAR103, DAR203 per-file-ignores = # Pytest fixtures? Path needs fixing! From 19b52781d40492f75ad131adf5280eb8f1fd9fa6 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 18:04:19 -0600 Subject: [PATCH 07/11] Try without bells and whistles? --- .github/workflows/wemake-python.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index 8a4caf59f801..2bb9e33459d2 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -1,15 +1,6 @@ -name: "Lint Test wemake-python" -on: - pull_request_target: - types: [opened, synchronize, reopened, edited] - -jobs: - linter: - runs-on: ubuntu-latest - steps: - - name: wemake-python-styleguide - uses: wemake-services/wemake-python-styleguide@0.14.1 - with: - reporter: 'terminal' - env: - GITHUB_TOKEN: ${{ secrets.github_token }} +- name: wemake-python-styleguide + uses: wemake-services/wemake-python-styleguide@0.14.1 + with: + reporter: 'terminal' + env: + GITHUB_TOKEN: ${{ secrets.github_token }} From ff13409b9b79d518f7b83bc2470775c1f273a6e3 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 18:08:07 -0600 Subject: [PATCH 08/11] And a last try --- .github/workflows/wemake-python.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index 2bb9e33459d2..297a02850307 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -1,6 +1,14 @@ -- name: wemake-python-styleguide - uses: wemake-services/wemake-python-styleguide@0.14.1 - with: - reporter: 'terminal' - env: - GITHUB_TOKEN: ${{ secrets.github_token }} +name: "Linter" +on: + pull_request_target: + types: [opened, synchronize, reopened, edited] + +jobs: + linter: + steps: + - name: wemake-python-styleguide + uses: wemake-services/wemake-python-styleguide@0.14.1 + with: + reporter: 'terminal' + env: + GITHUB_TOKEN: ${{ secrets.github_token }} From 470c161b2139ab901852a8bc37c60fc78965a868 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 18:16:03 -0600 Subject: [PATCH 09/11] Copy from wps directly (mostly) and as a last-effort But probably the issue is something entirely different and I am just too stupid... --- .github/workflows/wemake-python.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index 297a02850307..8104693b12c4 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -1,14 +1,18 @@ -name: "Linter" +name: wps on: - pull_request_target: - types: [opened, synchronize, reopened, edited] + pull_request: + branches: + - main jobs: - linter: + build: + + runs-on: ubuntu-latest + steps: - - name: wemake-python-styleguide - uses: wemake-services/wemake-python-styleguide@0.14.1 + - uses: actions/checkout@v2 + - uses: wemake-services/wemake-python-styleguide@master with: - reporter: 'terminal' + reporter: 'github-pr-check' env: GITHUB_TOKEN: ${{ secrets.github_token }} From 63a73ce50af4a49fd1427171e8925b2d88d3e051 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 18:16:03 -0600 Subject: [PATCH 10/11] Copy from wps directly (mostly) and as a last-effort But probably the issue is something entirely different and I am just too stupid... --- .github/workflows/wemake-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index 8104693b12c4..ea597eed5b6d 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -2,7 +2,7 @@ name: wps on: pull_request: branches: - - main + - master jobs: build: From 58020e61d40be5fa1b59f0166aa6518fa7f91526 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 9 Mar 2021 16:55:46 -0600 Subject: [PATCH 11/11] TEST Lint action? --- .github/workflows/wemake-python.yml | 2 +- numpy/core/_asarray.py | 12 ++++++++++-- setup.py | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml index ea597eed5b6d..8104693b12c4 100644 --- a/.github/workflows/wemake-python.yml +++ b/.github/workflows/wemake-python.yml @@ -2,7 +2,7 @@ name: wps on: pull_request: branches: - - master + - main jobs: build: diff --git a/numpy/core/_asarray.py b/numpy/core/_asarray.py index df569f22d97a..ce372bdde861 100644 --- a/numpy/core/_asarray.py +++ b/numpy/core/_asarray.py @@ -6,6 +6,9 @@ from .overrides import set_module from .multiarray import array +#oh noes, that is ugly: +from collections import Awaitable, Collection, defaultdict, deque, Hashable, ItemsView, Counter, \ + KeysView, Hashable, ChainMap __all__ = [ "asarray", "asanyarray", "ascontiguousarray", "asfortranarray", "require", @@ -45,7 +48,7 @@ def asarray(a, dtype=None, order=None): asarray_chkfinite : Similar function which checks input for NaNs and Infs. fromiter : Create an array from an iterator. fromfunction : Construct an array by executing a function on grid - positions. + positions. And this line is definitely much too long for my sore eyes :(. It should be shorter! Examples -------- @@ -80,7 +83,12 @@ def asarray(a, dtype=None, order=None): True """ - return array(a, dtype, copy=False, order=order) + if "AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH": + pass + this =1 # No space? + this = 2 # No space? + # What are all those white space issues?: + return array(a, dtype, copy=False , order=order ) @set_module('numpy') diff --git a/setup.py b/setup.py index a86e28341145..7f3386ea4169 100755 --- a/setup.py +++ b/setup.py @@ -16,9 +16,15 @@ All NumPy wheels distributed on PyPI are BSD licensed. +AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHhh ha hahah ah ahah ah hah ah ahha ha haha ha ha hah ah """ DOCLINES = (__doc__ or '').split("\n") + +#oh noes, that is ugly: +from collections import Awaitable, Collection, defaultdict, deque, Hashable, ItemsView, Counter, \ + KeysView, Hashable, ChainMap + import os import sys import subprocess