Skip to content

Commit

Permalink
chore: Run black + isort with string normalization (one time diff)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Feb 22, 2022
1 parent 07b7c81 commit 3782bac
Show file tree
Hide file tree
Showing 8 changed files with 400 additions and 400 deletions.
116 changes: 58 additions & 58 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,99 +17,99 @@


extensions = [
'sphinx.ext.autodoc',
'sphinx_autodoc_typehints',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.napoleon',
'alagitpull',
'myst_parser',
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.napoleon",
"alagitpull",
"myst_parser",
]

templates_path = ['_templates']
templates_path = ["_templates"]

source_suffix = {'.rst': 'restructuredtext', '.md': 'markdown'}
source_suffix = {".rst": "restructuredtext", ".md": "markdown"}

master_doc = 'index'
master_doc = "index"

project = about['__title__']
copyright = about['__copyright__']
project = about["__title__"]
copyright = about["__copyright__"]

version = '%s' % ('.'.join(about['__version__'].split('.'))[:2])
release = '%s' % (about['__version__'])
version = "%s" % (".".join(about["__version__"].split("."))[:2])
release = "%s" % (about["__version__"])

exclude_patterns = ['_build']
exclude_patterns = ["_build"]

pygments_style = 'sphinx'
pygments_style = "sphinx"

html_theme_path = [alagitpull.get_path()]
html_static_path = ['_static']
html_extra_path = ['manifest.json']
html_theme = 'alagitpull'
html_static_path = ["_static"]
html_extra_path = ["manifest.json"]
html_theme = "alagitpull"
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'more.html',
'searchbox.html',
"**": [
"about.html",
"navigation.html",
"relations.html",
"more.html",
"searchbox.html",
]
}

html_theme_options = {
'logo': 'img/cihai.svg',
'github_user': 'cihai',
'github_repo': 'unihan-db',
'github_type': 'star',
'github_banner': True,
'projects': alagitpull.projects,
'project_name': 'db',
'project_title': about['__title__'],
'project_description': about['__description__'],
'project_url': about['__docs__'],
'show_meta_manifest_tag': True,
'show_meta_og_tags': True,
'show_meta_app_icon_tags': True,
"logo": "img/cihai.svg",
"github_user": "cihai",
"github_repo": "unihan-db",
"github_type": "star",
"github_banner": True,
"projects": alagitpull.projects,
"project_name": "db",
"project_title": about["__title__"],
"project_description": about["__description__"],
"project_url": about["__docs__"],
"show_meta_manifest_tag": True,
"show_meta_og_tags": True,
"show_meta_app_icon_tags": True,
}

alagitpull_internal_hosts = ['unihan-db.git-pull.com', '0.0.0.0']
alagitpull_internal_hosts = ["unihan-db.git-pull.com", "0.0.0.0"]
alagitpull_external_hosts_new_window = True

htmlhelp_basename = '%sdoc' % about['__title__']
htmlhelp_basename = "%sdoc" % about["__title__"]

latex_documents = [
(
'index',
'{0}.tex'.format(about['__package_name__']),
'{0} Documentation'.format(about['__title__']),
about['__author__'],
'manual',
"index",
"{0}.tex".format(about["__package_name__"]),
"{0} Documentation".format(about["__title__"]),
about["__author__"],
"manual",
)
]

man_pages = [
(
'index',
about['__package_name__'],
'{0} Documentation'.format(about['__title__']),
about['__author__'],
"index",
about["__package_name__"],
"{0} Documentation".format(about["__title__"]),
about["__author__"],
1,
)
]

texinfo_documents = [
(
'index',
'{0}'.format(about['__package_name__']),
'{0} Documentation'.format(about['__title__']),
about['__author__'],
about['__package_name__'],
about['__description__'],
'Miscellaneous',
"index",
"{0}".format(about["__package_name__"]),
"{0} Documentation".format(about["__title__"]),
about["__author__"],
about["__package_name__"],
about["__description__"],
"Miscellaneous",
)
]

intersphinx_mapping = {
'python': ('http://docs.python.org/', None),
'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),
"python": ("http://docs.python.org/", None),
"sqlalchemy": ("http://docs.sqlalchemy.org/en/latest/", None),
}
24 changes: 12 additions & 12 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@

@pytest.fixture
def fixture_path():
return os.path.abspath(os.path.join(os.path.dirname(__file__), 'fixtures'))
return os.path.abspath(os.path.join(os.path.dirname(__file__), "fixtures"))


@pytest.fixture
def test_config_file(fixture_path):
return os.path.join(fixture_path, 'test_config.yml')
return os.path.join(fixture_path, "test_config.yml")


@pytest.fixture
def zip_path(tmpdir):
return tmpdir.join('Unihan.zip')
return tmpdir.join("Unihan.zip")


@pytest.fixture
def zip_file(zip_path, fixture_path):
_files = []
for f in UNIHAN_FILES:
_files += [os.path.join(fixture_path, f)]
zf = zipfile.ZipFile(str(zip_path), 'a')
zf = zipfile.ZipFile(str(zip_path), "a")
for f in _files:
zf.write(f, os.path.basename(f))
zf.close()
Expand All @@ -39,24 +39,24 @@ def zip_file(zip_path, fixture_path):
@pytest.fixture
def unihan_options(zip_file, zip_path, tmpdir):
return {
'source': str(zip_path),
'work_dir': str(tmpdir),
'zip_path': str(tmpdir.join('downloads').join('Moo.zip')),
'expand': True,
"source": str(zip_path),
"work_dir": str(tmpdir),
"zip_path": str(tmpdir.join("downloads").join("Moo.zip")),
"expand": True,
}


@pytest.fixture(scope='function')
@pytest.fixture(scope="function")
def tmpdb_file(tmpdir):
return tmpdir.join('test.db')
return tmpdir.join("test.db")


@pytest.fixture
def engine():
return create_engine('sqlite:///:memory:')
return create_engine("sqlite:///:memory:")


@pytest.fixture(scope='function')
@pytest.fixture(scope="function")
def session(engine, request):
connection = engine.connect()
transaction = connection.begin()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_reflect_db(tmpdb_file, unihan_options, metadata):

def test_import_object(session, engine):
Base.metadata.create_all(engine)
session.add(Unhn(char=u'好', ucn='U+4E09'))
session.add(Unhn(char="好", ucn="U+4E09"))
session.commit()

assert session.query(Unhn)
Expand Down
24 changes: 12 additions & 12 deletions unihan_db/__about__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
__title__ = 'unihan-db'
__package_name__ = 'unihan_db'
__description__ = 'SQLAlchemy models for UNIHAN database'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/cihai/unihan-db'
__docs__ = 'https://unihan-db.git-pull.com'
__tracker__ = 'https://github.com/cihai/unihan-db/issues'
__pypi__ = 'https://pypi.org/project/unihan-db/'
__email__ = 'cihai@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2017- cihai software foundation (Tony Narlock)'
__title__ = "unihan-db"
__package_name__ = "unihan_db"
__description__ = "SQLAlchemy models for UNIHAN database"
__version__ = "0.3.0"
__author__ = "Tony Narlock"
__github__ = "https://github.com/cihai/unihan-db"
__docs__ = "https://unihan-db.git-pull.com"
__tracker__ = "https://github.com/cihai/unihan-db/issues"
__pypi__ = "https://pypi.org/project/unihan-db/"
__email__ = "cihai@git-pull.com"
__license__ = "MIT"
__copyright__ = "Copyright 2017- cihai software foundation (Tony Narlock)"
6 changes: 3 additions & 3 deletions unihan_db/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from StringIO import StringIO

def console_to_str(s):
return s.decode('utf_8')
return s.decode("utf_8")

exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
exec("def reraise(tp, value, tb=None):\n raise tp, value, tb")

else:
unichr = chr
Expand All @@ -41,7 +41,7 @@ def console_to_str(s):
try:
return s.decode(console_encoding)
except UnicodeDecodeError:
return s.decode('utf_8')
return s.decode("utf_8")

def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
Expand Down

0 comments on commit 3782bac

Please sign in to comment.