Skip to content

Commit

Permalink
Fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Feb 5, 2024
1 parent fc4e62e commit c5a345d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def make_doc(ctx):
ctx.run("touch apidoc/index.rst", warn=True)
ctx.run("rm pymatgen.*.rst", warn=True)
# ctx.run("rm pymatgen.*.md", warn=True)
ctx.run(
"sphinx-apidoc --implicit-namespaces -M -d 7 -o apidoc -f ../pymatgen ../**/tests/*"
)
ctx.run("sphinx-apidoc --implicit-namespaces -M -d 7 -o apidoc -f ../pymatgen ../**/tests/*")

# Note: we use HTML building for the API docs to preserve search functionality.
ctx.run("sphinx-build -b html apidoc html") # HTML building.
Expand Down Expand Up @@ -158,19 +156,15 @@ def update_changelog(ctx, version=None, dry_run=False):
:param ctx:
"""
version = version or f"{datetime.datetime.now():%Y.%-m.%-d}"
output = subprocess.check_output(
["git", "log", "--pretty=format:%s", f"v{__version__}..HEAD"]
)
output = subprocess.check_output(["git", "log", "--pretty=format:%s", f"v{__version__}..HEAD"])
lines = []
ignored_commits = []
for line in output.decode("utf-8").strip().split("\n"):
re_match = re.match(r"Merge pull request \#(\d+) from (.*)", line)
if re_match and "materialsproject/dependabot/pip" not in line:
pr_number = re_match.group(1)
contributor, pr_name = re_match.group(2).split("/", 1)
response = requests.get(
f"https://api.github.com/repos/materialsproject/pymatgen/pulls/{pr_number}"
)
response = requests.get(f"https://api.github.com/repos/materialsproject/pymatgen/pulls/{pr_number}")
lines.append(f"* PR #{pr_number} from @{contributor} {pr_name}")
json_resp = response.json()
if body := json_resp["body"]:
Expand Down Expand Up @@ -225,8 +219,6 @@ def release(ctx, version=None, nodoc=False):
def open_doc(ctx):
"""
Open local documentation in web browser.
:param ctx:
"""
pth = os.path.abspath("docs/_build/html/index.html")
webbrowser.open(f"file://{pth}")
Expand Down

0 comments on commit c5a345d

Please sign in to comment.