Skip to content

Commit

Permalink
Merge pull request #105 from jwodder/move-url-tests
Browse files Browse the repository at this point in the history
Move "install from URL" tests from workflows to pytest code
  • Loading branch information
jwodder authored Jan 23, 2025
2 parents c9a107e + 900767a commit d38ab9b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 142 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/install-git-url.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/install-zip-url.yml

This file was deleted.

58 changes: 58 additions & 0 deletions test/test_end2end.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,64 @@ def test_setup_py(tmp_path: Path) -> None:
f.check(wheel_src, "wheel")


@needs_git
def test_install_from_git_url() -> None:
subprocess.run(
[
sys.executable,
"-m",
"pip",
"install",
"--no-build-isolation",
"--verbose",
"git+https://github.com/jwodder/versioningit-test",
],
check=True,
env={**os.environ, "VERSIONINGIT_LOG_LEVEL": "DEBUG"},
)
try:
info = readcmd(sys.executable, "-m", "pip", "show", "versioningit-test")
assert parse_version_from_metadata(info) == "0.1.0.post2+g0a4a58d"
finally:
subprocess.run(
[sys.executable, "-m", "pip", "uninstall", "--yes", "versioningit-test"],
check=True,
)


def test_install_from_zip_url() -> None:
subprocess.run(
[
sys.executable,
"-m",
"pip",
"install",
"--no-build-isolation",
"--verbose",
"https://github.com/jwodder/versioningit-git-archive-test/archive/master.zip",
],
check=True,
env={**os.environ, "VERSIONINGIT_LOG_LEVEL": "DEBUG"},
)
try:
info = readcmd(
sys.executable, "-m", "pip", "show", "versioningit-git-archive-test"
)
assert parse_version_from_metadata(info) == "0.2.0.post1+gfc89e73"
finally:
subprocess.run(
[
sys.executable,
"-m",
"pip",
"uninstall",
"--yes",
"versioningit-git-archive-test",
],
check=True,
)


def get_repo_status(repodir: Path) -> str:
if (repodir / ".git").exists():
return readcmd("git", "status", "--porcelain", cwd=str(repodir))
Expand Down

0 comments on commit d38ab9b

Please sign in to comment.