Skip to content

Commit

Permalink
style(config): string normalization, double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ibressler committed Mar 27, 2023
1 parent 1beedd7 commit e8edbc4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
18 changes: 9 additions & 9 deletions ci/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def exec_in_env():
check_call([bin_path / "pip", "install", "jinja2", "tox"])
python_executable = bin_path / "python"
if not python_executable.exists():
python_executable = python_executable.with_suffix('.exe')
python_executable = python_executable.with_suffix(".exe")

print("Re-executing with: {0}".format(python_executable))
print("+ exec", python_executable, __file__, "--no-env")
Expand All @@ -51,7 +51,7 @@ def main():
import jinja2

print("Project path: {0}".format(base_path))
project_meta = toml.load(base_path / 'pyproject.toml')
project_meta = toml.load(base_path / "pyproject.toml")

jinja = jinja2.Environment(
loader=jinja2.FileSystemLoader(str(templates_path)),
Expand All @@ -65,28 +65,28 @@ def main():
# 'tox' need not be installed globally, but must be importable
# by the Python that is running this script.
for line in subprocess.check_output(
[sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True
[sys.executable, "-m", "tox", "--listenvs"], universal_newlines=True
).splitlines()
]
# add a version number to the generic Python3 name (just 'py') for templates to build ok
tox_environments = [
(line if len(line) > 2 else line + ''.join(sys.version.split('.')[:2]))
(line if len(line) > 2 else line + "".join(sys.version.split(".")[:2]))
for line in tox_environments
if line.startswith('py')
if line.startswith("py")
]

for template in templates_path.rglob('*'):
for template in templates_path.rglob("*"):
if template.is_file() and template.name != ".DS_Store":
template_path = str(template.relative_to(templates_path))
destination = base_path / template_path
destination.parent.mkdir(parents=True, exist_ok=True)
destination.write_text(
jinja.get_template(template_path).render(
tox_environments=tox_environments,
docs_url=project_meta['project']['urls']['documentation'],
cov_report_path=project_meta['tool']['coverage']['report']['path'],
docs_url=project_meta["project"]["urls"]["documentation"],
cov_report_path=project_meta["tool"]["coverage"]["report"]["path"],
# Python version to use for general tasks: docs (when tox did not set one)
py_ver='.'.join(sys.version.split('.')[:2]),
py_ver=".".join(sys.version.split(".")[:2]),
)
)
print("Wrote {}".format(template_path))
Expand Down
35 changes: 18 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import toml

base_path = dirname(dirname(abspath(__file__)))
project_meta = toml.load(join(base_path, 'pyproject.toml'))
project_meta = toml.load(join(base_path, "pyproject.toml"))

extensions = [
"sphinx.ext.autodoc",
Expand All @@ -21,17 +21,17 @@
"sphinx.ext.viewcode",
"myst_parser",
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Jupyter Analysis Tools'
year = '2018-2023'
author = 'Ingo Breßler'
copyright = '{0}, {1}'.format(year, author)
version = '0.1.4'
autosummary_generate = True # Turn on sphinx.ext.autosummary
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "Jupyter Analysis Tools"
year = "2018-2023"
author = "Ingo Breßler"
copyright = "{0}, {1}".format(year, author)
version = "0.1.4"
release = version
commit_id = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode('ascii')
commit_id = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).strip().decode("ascii")

autodoc_mock_imports = [
"ipykernel",
Expand All @@ -47,24 +47,25 @@

pygments_style = "trac"
extlinks = {
'issue': (join(project_meta['project']['urls']['repository'], 'issues', '%s'), '#%s'),
'pr': (join(project_meta['project']['urls']['repository'], 'pull', '%s'), 'PR #%s'),
"issue": (join(project_meta["project"]["urls"]["repository"], "issues", "%s"), "#%s"),
"pr": (join(project_meta["project"]["urls"]["repository"], "pull", "%s"), "PR #%s"),
}
html_theme = 'furo'
html_theme = "furo"

html_use_smartypants = True
html_last_updated_fmt = f'%b %d, %Y (git {commit_id})'
html_last_updated_fmt = f"%b %d, %Y (git {commit_id})"
html_split_index = False
html_short_title = '%s-%s' % (project, version)

html_short_title = "%s-%s" % (project, version)

napoleon_use_ivar = True
napoleon_use_rtype = False
napoleon_use_param = False

linkcheck_ignore = [
join(
project_meta['project']['urls']['documentation'],
project_meta['tool']['coverage']['report']['path'],
project_meta["project"]["urls"]["documentation"],
project_meta["tool"]["coverage"]["report"]["path"],
)
+ r'.*',
+ r".*",
]

0 comments on commit e8edbc4

Please sign in to comment.