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 }} diff --git a/.github/workflows/wemake-python.yml b/.github/workflows/wemake-python.yml new file mode 100644 index 000000000000..8104693b12c4 --- /dev/null +++ b/.github/workflows/wemake-python.yml @@ -0,0 +1,18 @@ +name: wps +on: + pull_request: + branches: + - main + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: wemake-services/wemake-python-styleguide@master + with: + reporter: 'github-pr-check' + env: + GITHUB_TOKEN: ${{ secrets.github_token }} 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.cfg b/setup.cfg new file mode 100644 index 000000000000..7117e1189aaf --- /dev/null +++ b/setup.cfg @@ -0,0 +1,62 @@ +# 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 + + +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/** 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