Skip to content

Commit

Permalink
Merge pull request #92 from bswck/sort-imports
Browse files Browse the repository at this point in the history
Rearrange imports
  • Loading branch information
jaraco committed Dec 18, 2023
2 parents 491c6f9 + 5370494 commit 9d7c9ee
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 38 deletions.
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import pip_run.retention.persist


collect_ignore = ['examples']


Expand Down
3 changes: 2 additions & 1 deletion examples/pydragon
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env pip-run
__requires__ = ['requests', 'beautifulsoup4', 'cowsay']
import cowsay
import requests
from bs4 import BeautifulSoup as BS
import cowsay

res = requests.get('https://python.org')
b = BS(res.text, 'html.parser')
cowsay.dragon(b.find("div", class_="introduction").get_text())
5 changes: 3 additions & 2 deletions examples/test-mongodb-covered-query.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@

if __name__ == '__main__':
# invoke pytest on this script
import pytest
import sys

import pytest

sys.exit(pytest.main(['--noconftest'] + sys.argv))

import random
import itertools
import random

import pytest
from jaraco.mongodb.testing import assert_covered
Expand Down
1 change: 0 additions & 1 deletion pip-run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from pip_run import run


__name__ == '__main__' and run()
5 changes: 1 addition & 4 deletions pip_run/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import sys

from . import deps
from . import commands
from . import launch
from . import scripts
from . import commands, deps, launch, scripts


def run(args=sys.argv[1:]):
Expand Down
1 change: 0 additions & 1 deletion pip_run/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from . import run


__name__ == '__main__' and run()
3 changes: 2 additions & 1 deletion pip_run/_py38compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import platform
import sys

from jaraco.functools import identity

subprocess_path = (
Expand Down
8 changes: 4 additions & 4 deletions pip_run/commands.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pathlib
import contextlib
import argparse
import contextlib
import pathlib

from more_itertools import locate, split_at
from jaraco.functools import bypass_when
from jaraco import env # type: ignore # (python/mypy#15970)
from jaraco.context import suppress
from jaraco.functools import bypass_when
from more_itertools import locate, split_at

from ._py38compat import files

Expand Down
12 changes: 6 additions & 6 deletions pip_run/deps.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os
import sys
import argparse
import contextlib
import subprocess
import itertools
import functools
import argparse
import importlib
import itertools
import os
import pathlib
import subprocess
import sys
import types
import importlib
import warnings
from importlib import metadata

Expand Down
8 changes: 4 additions & 4 deletions pip_run/launch.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import textwrap
import itertools
import os
import pathlib
import signal
import subprocess
import sys
import signal
import itertools
import pathlib
import textwrap

from jaraco.context import suppress

Expand Down
2 changes: 1 addition & 1 deletion pip_run/retention/destroy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import contextlib
import tempfile
import pathlib
import tempfile


@contextlib.contextmanager
Expand Down
3 changes: 1 addition & 2 deletions pip_run/retention/persist.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import hashlib
import contextlib
import hashlib

import platformdirs

from .. import deps


paths = platformdirs.PlatformDirs(appname='pip run', appauthor=False)


Expand Down
9 changes: 4 additions & 5 deletions pip_run/scripts.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import ast
import json
import pathlib
import abc
import ast
import contextlib
import itertools
import json
import pathlib
import re

import packaging.requirements
import jaraco.text
import packaging.requirements
from jaraco.context import suppress
from jaraco.functools import compose


ValidRequirementString = compose(str, packaging.requirements.Requirement)


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

from pip_run import commands


valid_shebangs = [
'#!/usr/bin/env python',
'#!/usr/bin/env -S pip-run',
Expand Down
8 changes: 4 additions & 4 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import itertools
import textwrap
import sys
import subprocess
import sys
import textwrap

import pytest
import nbformat
import jaraco.path
import nbformat
import pytest

from pip_run import scripts

Expand Down

0 comments on commit 9d7c9ee

Please sign in to comment.