Skip to content

Commit

Permalink
Lint and make sure we install pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Feb 9, 2024
1 parent 6abb935 commit 5213b93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
// Mount the parent as /workspaces so we can pip install peers as editable
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
// After the container is created, install the python project in editable form
"postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]'"
"postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]' && pre-commit install"
}
13 changes: 6 additions & 7 deletions tests/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,23 @@ def make_venv(project_path: Path) -> callable:
venv_path = project_path / "venv"
run_pipe(f"python -m venv {venv_path}")
run = functools.partial(run_pipe, cwd=str(project_path))
run(f"./venv/bin/pip install -e .[dev]")
run("./venv/bin/pip install -e .[dev]")
return run


def test_template(tmp_path: Path):
copy_project(tmp_path)
run = make_venv(tmp_path)
run(f"./venv/bin/tox -p")
run(f"./venv/bin/pip install build twine")
run(f"./venv/bin/python -m build")
run(f"./venv/bin/twine check --strict dist/*")
run("./venv/bin/tox -p")
run("./venv/bin/pip install build twine")
run("./venv/bin/python -m build")
run("./venv/bin/twine check --strict dist/*")


def test_template_no_docs(tmp_path: Path):
copy_project(tmp_path, docs_type="README")
run = make_venv(tmp_path)
run(f"./venv/bin/tox -p")

run("./venv/bin/tox -p")


def test_bad_repo_name(tmp_path: Path):
Expand Down

0 comments on commit 5213b93

Please sign in to comment.