From 5192ae44286de25d9faa4ac373e74f3bf49d4f64 Mon Sep 17 00:00:00 2001 From: Anton Tetov <anton@tetov.se> Date: Wed, 28 Sep 2022 21:14:23 +0200 Subject: [PATCH] tooling --- .pre-commit-config.yaml | 20 ++++++++++------- poetry.lock | 38 ++++++++++++++------------------- pyproject.toml | 2 +- tests/test_urscript_commands.py | 12 ++++++----- ur_py_ctl/__init__.py | 10 ++++----- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b53ff8..a4a0ef1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,7 @@ +--- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: check-yaml - id: end-of-file-fixer @@ -9,19 +10,22 @@ repos: - id: mixed-line-ending - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.8.0 hooks: - id: black language_version: python3.9 - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 5.0.4 hooks: - id: flake8 - - repo: https://github.com/asottile/reorder_python_imports - rev: v3.0.1 + - repo: https://github.com/pycqa/isort + rev: 5.10.1 hooks: - - id: reorder-python-imports - args: - - "--py39-plus" + - id: isort + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.981 + hooks: + - id: mypy diff --git a/poetry.lock b/poetry.lock index 33d6c25..b1e891d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -6,14 +6,6 @@ category = "dev" optional = false python-versions = "*" -[[package]] -name = "aspy.refactor-imports" -version = "3.0.1" -description = "Utilities for refactoring imports in python-like syntax." -category = "dev" -optional = false -python-versions = ">=3.7" - [[package]] name = "atomicwrites" version = "1.4.0" @@ -207,6 +199,20 @@ category = "dev" optional = false python-versions = "*" +[[package]] +name = "isort" +version = "5.10.1" +description = "A Python utility / library to sort Python imports." +category = "dev" +optional = false +python-versions = ">=3.6.1,<4.0" + +[package.extras] +plugins = ["setuptools"] +colors = ["colorama (>=0.4.3,<0.5.0)"] +requirements_deprecated_finder = ["pip-api", "pipreqs"] +pipfile_deprecated_finder = ["requirementslib", "pipreqs"] + [[package]] name = "jinja2" version = "3.1.2" @@ -507,17 +513,6 @@ category = "dev" optional = false python-versions = ">=3.6" -[[package]] -name = "reorder-python-imports" -version = "3.0.1" -description = "Tool for reordering python imports" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -"aspy.refactor-imports" = ">=2.3.0" - [[package]] name = "requests" version = "2.28.1" @@ -763,11 +758,10 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = ">=3.9,<3.11" -content-hash = "133e3c8d2eaaac368d4f135508c59e1c8915e148e5d80ea7468c383ba22f6bd1" +content-hash = "e71bab895b53cbe86da200efc31ef9ecba8d664c8ef3223c76f1539ef40459bf" [metadata.files] alabaster = [] -"aspy.refactor-imports" = [] atomicwrites = [] attrs = [] babel = [] @@ -810,6 +804,7 @@ idna = [] imagesize = [] importlib-metadata = [] iniconfig = [] +isort = [] jinja2 = [] linkify-it-py = [] markdown-it-py = [] @@ -841,7 +836,6 @@ pyparsing = [] pytest = [] pytz = [] pyyaml = [] -reorder-python-imports = [] requests = [] six = [] snowballstemmer = [] diff --git a/pyproject.toml b/pyproject.toml index 736e181..8e1df63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,12 +18,12 @@ flake8 = "^4.0.1" mypy = "^0.942" black = "^22.3.0" pre-commit = "^2.18.1" -reorder-python-imports = "^3.0.1" pytest = "^7.1.1" Sphinx = "^5.2.2" myst-parser = {extras = ["linkify"], version = "^0.18.1"} sphinxcontrib-apidoc = "^0.3.0" sphinx-rtd-theme = "^1.0.0" +isort = "^5.10.1" [tool.isort] profile = "black" diff --git a/tests/test_urscript_commands.py b/tests/test_urscript_commands.py index 7767a6f..80155dc 100644 --- a/tests/test_urscript_commands.py +++ b/tests/test_urscript_commands.py @@ -3,11 +3,13 @@ from random import random import pytest -from ur_py_ctl.urscript_commands import _add_whitespace -from ur_py_ctl.urscript_commands import _get_conf -from ur_py_ctl.urscript_commands import _get_func -from ur_py_ctl.urscript_commands import _get_pose -from ur_py_ctl.urscript_commands import move_to_conf +from ur_py_ctl.urscript_commands import ( + _add_whitespace, + _get_conf, + _get_func, + _get_pose, + move_to_conf, +) @pytest.fixture() diff --git a/ur_py_ctl/__init__.py b/ur_py_ctl/__init__.py index 2e07e13..fe7b796 100644 --- a/ur_py_ctl/__init__.py +++ b/ur_py_ctl/__init__.py @@ -13,13 +13,13 @@ DATA_DIR = REPO_DIR / "data" LOG_DIR = REPO_DIR / "log" from .urscript_commands import Motion # noqa: F401,E402 -from .urscript_commands import move_to_pose # noqa: F401,E402 from .urscript_commands import move_to_conf # noqa: F401,E402 -from .urscript_commands import set_tcp # noqa: F401,E402 -from .urscript_commands import set_DO # noqa: F401,E402 +from .urscript_commands import move_to_pose # noqa: F401,E402 +from .urscript_commands import popup # noqa: F401,E402 +from .urscript_commands import read_AO # noqa: F401,E402 from .urscript_commands import read_DO # noqa: F401,E402 from .urscript_commands import set_AO # noqa: F401,E402 -from .urscript_commands import read_AO # noqa: F401,E402 +from .urscript_commands import set_DO # noqa: F401,E402 +from .urscript_commands import set_tcp # noqa: F401,E402 from .urscript_commands import sleep # noqa: F401,E402 from .urscript_commands import text_msg # noqa: F401,E402 -from .urscript_commands import popup # noqa: F401,E402 -- GitLab