Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace flake8 sorter with isort #242

Merged
merged 7 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions nox/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@

import pkg_resources

from nox import _options
from nox import tasks
from nox import workflow
from nox import _options, tasks, workflow
from nox.logger import setup_logging


Expand Down
1 change: 0 additions & 1 deletion nox/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import sys

import py # type: ignore

from nox.logger import logger
from nox.popen import popen

Expand Down
3 changes: 1 addition & 2 deletions nox/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import sys
import unicodedata

import py # type: ignore

import nox.command
import py # type: ignore
from nox.logger import logger
from nox.virtualenv import CondaEnv, ProcessEnv, VirtualEnv

Expand Down
6 changes: 2 additions & 4 deletions nox/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
import json
import os

from colorlog.escape_codes import parse_colors # type: ignore

import nox
from nox import _options
from nox import registry
from colorlog.escape_codes import parse_colors # type: ignore
from nox import _options, registry
from nox.logger import logger
from nox.manifest import Manifest

Expand Down
3 changes: 1 addition & 2 deletions nox/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import shutil
import sys

import py # type: ignore

import nox.command
import py # type: ignore
from nox.logger import logger

# Problematic environment variables that are stripped from all commands inside
Expand Down
14 changes: 8 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import nox


ON_APPVEYOR = os.environ.get("APPVEYOR") == "True"


Expand Down Expand Up @@ -59,16 +58,19 @@ def cover(session):
@nox.session(python="3.7")
def blacken(session):
"""Run black code formater."""
session.install("black")
session.run("black", "nox", "tests", "noxfile.py", "setup.py")
session.install("black==19.3b0", "isort==4.3.21")
files = ["nox", "tests", "noxfile.py", "setup.py"]
session.run("black", *files)
session.run("isort", "--recursive", *files)


@nox.session(python="3.7")
def lint(session):
session.install("flake8", "flake8-import-order", "black", "mypy")
session.install("flake8==3.7.8", "black==19.3b0", "mypy==0.720")
session.run("mypy", "nox")
session.run("black", "--check", "nox", "tests", "noxfile.py", "setup.py")
session.run("flake8", "nox", "tests")
files = ["nox", "tests", "noxfile.py", "setup.py"]
session.run("black", "--check", *files)
session.run("flake8", "nox", *files)


@nox.session(python="3.7")
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from setuptools import setup


long_description = open("README.rst", "r", encoding="utf-8").read()


Expand Down
5 changes: 1 addition & 4 deletions tests/test__option_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
from unittest import mock

import pytest

from nox import _option_set
from nox import _options

from nox import _option_set, _options

# The vast majority of _option_set is tested by test_main, but the test helper
# :func:`OptionSet.namespace` needs a bit of help to get to full coverage.
Expand Down
1 change: 0 additions & 1 deletion tests/test__parametrize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from unittest import mock

import pytest

from nox import _parametrize


Expand Down
3 changes: 1 addition & 2 deletions tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
import sys
from unittest import mock

import pytest

import nox.command
import pytest

PYTHON = sys.executable

Expand Down
5 changes: 2 additions & 3 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
import sys
from unittest import mock

import contexter
import pkg_resources
import pytest

import contexter
import nox
import nox.__main__
import nox._options
import nox.registry
import nox.sessions

import pytest

RESOURCES = os.path.join(os.path.dirname(__file__), "resources")
VERSION = pkg_resources.get_distribution("nox").version
Expand Down
6 changes: 2 additions & 4 deletions tests/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
import collections
from unittest import mock

import pytest

import nox
from nox.manifest import _null_session_func
from nox.manifest import Manifest
import pytest
from nox.manifest import Manifest, _null_session_func


def create_mock_sessions():
Expand Down
1 change: 0 additions & 1 deletion tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import pytest

from nox import registry


Expand Down
7 changes: 3 additions & 4 deletions tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
import sys
from unittest import mock

import pytest

from nox import _options
import nox.command
from nox.logger import logger
import nox.manifest
import nox.registry
import nox.sessions
import nox.virtualenv
import pytest
from nox import _options
from nox.logger import logger


def test__normalize_path():
Expand Down
8 changes: 2 additions & 6 deletions tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@
import platform
from unittest import mock

import pytest

import nox
from nox import _options
from nox import sessions
from nox import tasks
import pytest
from nox import _options, sessions, tasks
from nox.manifest import Manifest


RESOURCES = os.path.join(os.path.dirname(__file__), "resources")


Expand Down
1 change: 0 additions & 1 deletion tests/test_tox_to_nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import textwrap

import pytest

from nox import tox_to_nox


Expand Down
4 changes: 1 addition & 3 deletions tests/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
import sys
from unittest import mock

import nox.virtualenv
import py
import pytest

import nox.virtualenv


IS_WINDOWS = nox.virtualenv._SYSTEM == "Windows"
HAS_CONDA = shutil.which("conda") is not None
RAISE_ERROR = "RAISE_ERROR"
Expand Down