Skip to content

Commit

Permalink
Fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
goerz committed Jun 3, 2024
1 parent 367e00f commit e9754de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ clean-docs: ## remove documentation artifacts

distclean: clean ## Restore to a clean checkout state
rm -f .git/hooks/pre-commit
rm -f docs/notebooks/*.log
hatch env prune

test: init ## Run the tests (with coverage)
hatch run cov -- $(TESTS)
hatch run default:cov -- $(TESTS)

coverage: ## Generate coverage report in ./htmlcov (after `make test`)
hatch run cov-html
hatch run default:cov-html
@echo "open htmlcov/index.html"

black-check: ## Check all src and test files for complience to "black" code style
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ dev = [
"pytest-cov<=2.6.1",
"pytest-xdist",
"nbval==0.11.0",
"watermark~=2.4",
"weylchamber>=0.3.2",
"ipython",
]
Expand All @@ -70,6 +69,7 @@ docs = [
"Jinja2==3.0.3",
"docutils<=0.17",
"matplotlib==3.7.5",
"watermark~=2.4",
"zip-files==0.4.1",
"ipython",
]
Expand Down Expand Up @@ -103,6 +103,7 @@ cov-html = [
description = "Generate the docs (Python 3.8)"
template = "docs"
features = [
"dev",
"docs",
]
python = "3.8"
Expand Down
10 changes: 5 additions & 5 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def make_release(package_name, fast_test=False):
'README.md',
join('docs', '09_examples.rst'),
join('docs', 'index.rst'),
join('docs', 'overview.rst'),
join('docs', '01_overview.rst'),
]
for filename in files_with_binder_links:
set_binder_branch(filename, "v" + str(new_version))
Expand All @@ -92,7 +92,7 @@ def make_release(package_name, fast_test=False):
files_with_released_binder_links = [
'README.md',
join('docs', 'index.rst'),
join('docs', 'overview.rst'),
join('docs', '01_overview.rst'),
]
for filename in files_with_binder_links:
if filename in files_with_released_binder_links:
Expand Down Expand Up @@ -173,13 +173,13 @@ def run_tests():
success = False
while not success:
try:
run(['make', 'test'], check=True)
run(['hatch', 'run', 'default:test'], check=True)
except CalledProcessError as exc_info:
print("Failed tests: %s\n" % exc_info)
print("Fix the tests and ammend the release commit.")
print("Then continue.\n")
click.confirm("Continue?", default=True, abort=True)
if not click.confirm("Retry?", default=True):
if not click.confirm("Retry? If 'no', wil continue without testing", default=True):
break
else:
success = True
Expand Down Expand Up @@ -437,7 +437,7 @@ def make_notebooks(fast_test=False):
def check_documentation():
"""Verify the documentation (interactively)."""
click.echo("Making the documentation....")
run(['make', 'docs-artifacts'], check=True, stdout=DEVNULL)
run(['make', 'docs'], check=True, stdout=DEVNULL)
click.echo(
"Check documentation in file://"
+ os.getcwd()
Expand Down

0 comments on commit e9754de

Please sign in to comment.