Skip to content

Commit c161663

Browse files
committed
Sort imports
1 parent d400791 commit c161663

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

docs/script/generate_social_card_previews.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
# %load_ext autoreload
77
# %autoreload 2
88

9+
import random
910
from pathlib import Path
1011
from textwrap import dedent
12+
1113
from sphinxext.opengraph.socialcards import (
12-
render_social_card,
13-
MAX_CHAR_PAGE_TITLE,
1414
MAX_CHAR_DESCRIPTION,
15+
MAX_CHAR_PAGE_TITLE,
16+
render_social_card,
1517
)
16-
import random
1718

1819
here = Path(__file__).parent
1920

noxfile.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
ref: https://nox.thea.codes/
1212
"""
1313

14-
import nox
1514
from shlex import split
1615

16+
import nox
17+
1718
nox.options.reuse_existing_virtualenvs = True
1819

1920

sphinxext/opengraph/__init__.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
import os
2+
from pathlib import Path
13
from typing import Any, Dict
24
from urllib.parse import urljoin, urlparse, urlsplit, urlunparse
3-
from pathlib import Path
45

56
import docutils.nodes as nodes
67
from sphinx.application import Sphinx
78

8-
from .descriptionparser import get_description
9-
from .metaparser import get_meta_description
10-
from .titleparser import get_title
9+
from sphinxext.opengraph.descriptionparser import get_description
10+
from sphinxext.opengraph.metaparser import get_meta_description
11+
from sphinxext.opengraph.titleparser import get_title
1112

1213
try:
1314
import matplotlib
@@ -16,9 +17,10 @@
1617
create_social_card = None
1718
DEFAULT_SOCIAL_CONFIG = {}
1819
else:
19-
from .socialcards import create_social_card, DEFAULT_SOCIAL_CONFIG
20-
21-
import os
20+
from sphinxext.opengraph.socialcards import (
21+
DEFAULT_SOCIAL_CONFIG,
22+
create_social_card,
23+
)
2224

2325
__version__ = "0.9.1"
2426
version_info = (0, 9, 1)

sphinxext/opengraph/socialcards.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
import hashlib
44
from pathlib import Path
5+
56
import matplotlib
6-
from matplotlib import pyplot as plt
77
import matplotlib.image as mpimg
8+
from matplotlib import pyplot as plt
89
from sphinx.util import logging
910

1011
matplotlib.use("agg")

tests/test_options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import conftest
12
import pytest
23
from sphinx.application import Sphinx
3-
import conftest
44

55

66
def get_tag(tags, tag_type, kind="property", prefix="og"):

0 commit comments

Comments
 (0)