-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from figsoda/diff
Add diff feature
- Loading branch information
Showing
10 changed files
with
130 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import subprocess | ||
|
||
import conftest | ||
|
||
from nix_update import main | ||
|
||
|
||
def test_main(helpers: conftest.Helpers) -> None: | ||
with helpers.testpkgs(init_git=True) as path: | ||
main(["--file", str(path), "--commit", "github"]) | ||
version = subprocess.run( | ||
[ | ||
"nix", | ||
"eval", | ||
"--raw", | ||
"--extra-experimental-features", | ||
"nix-command", | ||
"-f", | ||
path, | ||
"github.version", | ||
], | ||
check=True, | ||
text=True, | ||
stdout=subprocess.PIPE, | ||
).stdout.strip() | ||
assert version >= "8.5.2" | ||
commit = subprocess.run( | ||
["git", "-C", path, "log", "-1"], | ||
text=True, | ||
stdout=subprocess.PIPE, | ||
check=True, | ||
).stdout.strip() | ||
print(commit) | ||
assert version in commit | ||
assert "github" in commit | ||
assert "https://github.com/sharkdp/fd/compare/v8.0.0...v" in commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import subprocess | ||
|
||
import conftest | ||
|
||
from nix_update import main | ||
|
||
|
||
def test_main(helpers: conftest.Helpers) -> None: | ||
with helpers.testpkgs(init_git=True) as path: | ||
main(["--file", str(path), "--commit", "gitlab"]) | ||
version = subprocess.run( | ||
[ | ||
"nix", | ||
"eval", | ||
"--raw", | ||
"--extra-experimental-features", | ||
"nix-command", | ||
"-f", | ||
path, | ||
"gitlab.version", | ||
], | ||
check=True, | ||
text=True, | ||
stdout=subprocess.PIPE, | ||
).stdout.strip() | ||
assert version >= "0.22.0" | ||
commit = subprocess.run( | ||
["git", "-C", path, "log", "-1"], | ||
text=True, | ||
stdout=subprocess.PIPE, | ||
check=True, | ||
).stdout.strip() | ||
print(commit) | ||
assert version in commit | ||
assert "gitlab" in commit | ||
assert ( | ||
"https://gitlab.gnome.org/world/phosh/phosh/-/compare/v0.20.0...v" in commit | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ stdenv, fetchFromGitHub }: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "fd"; | ||
version = "8.0.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "sharkdp"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ stdenv, fetchFromGitLab }: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "phosh"; | ||
version = "0.20.0"; | ||
|
||
src = fetchFromGitLab { | ||
domain = "gitlab.gnome.org"; | ||
group = "world"; | ||
owner = "phosh"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; | ||
}; | ||
} |