-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #45 from vkottler/dev/2.2.0
Add initial GitHub dependency dev
- Loading branch information
Showing
45 changed files
with
804 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,9 @@ htmlcov | |
*-stubs | ||
coverage*.xml | ||
tags | ||
third-party | ||
|
||
ninja | ||
build.ninja | ||
.ninja* | ||
compile_commands.json |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[DESIGN] | ||
max-args=8 | ||
max-attributes=8 | ||
max-attributes=10 | ||
|
||
[MESSAGES CONTROL] | ||
disable=too-few-public-methods |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
major: 2 | ||
minor: 1 | ||
patch: 1 | ||
minor: 2 | ||
patch: 0 | ||
entry: mbs |
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 @@ | ||
*.json |
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,29 @@ | ||
#!/bin/bash | ||
|
||
CURL_ARGS=(curl -L) | ||
|
||
add_header() { | ||
CURL_ARGS+=(-H "$1: $2") | ||
} | ||
|
||
add_header Accept application/vnd.github+json | ||
|
||
API_VERSION=2022-11-28 | ||
add_header X-GitHub-Api-Version $API_VERSION | ||
|
||
if [ -n "$API_TOKEN" ]; then | ||
add_header Authorization "Bearer $API_TOKEN" | ||
fi | ||
|
||
run_curl() { | ||
echo "${CURL_ARGS[@]}" "$@" >&2 | ||
"${CURL_ARGS[@]}" "$@" | ||
} | ||
|
||
repo_api_url() { | ||
echo "https://api.github.com/repos/$OWNER/$REPO" | ||
} | ||
|
||
latest_release_url() { | ||
echo "$(repo_api_url "$1" "$2")/releases/latest" | ||
} |
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 @@ | ||
#!/bin/bash | ||
|
||
REPO=$(git rev-parse --show-toplevel) | ||
CWD=$REPO/scripts | ||
|
||
# Set API_TOKEN= to enable header argument. | ||
. "$CWD/common.sh" | ||
|
||
OWNER=vkottler | ||
REPO=yambs-sample | ||
|
||
run_curl "$(latest_release_url $OWNER $REPO)" > "$CWD/output.json" | ||
cat "$CWD/output.json" |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Empty file.
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 @@ | ||
""" | ||
Test the 'dependency.github' module. | ||
""" | ||
|
||
# internal | ||
from tests.resources import OWNER, REPO | ||
|
||
# module under test | ||
from yambs.dependency.github import GithubDependency | ||
|
||
|
||
def test_github_dependency_basic(): | ||
"""Test basic interactions with a GitHub dependency.""" | ||
|
||
assert GithubDependency(OWNER, REPO) |
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,17 @@ | ||
""" | ||
Test the 'dependency.manager' module. | ||
""" | ||
|
||
# built-in | ||
from pathlib import Path | ||
from tempfile import TemporaryDirectory | ||
|
||
# module under test | ||
from yambs.dependency.manager import DependencyManager | ||
|
||
|
||
def test_dependency_manager_basic(): | ||
"""Test basic interactions with a dependency manager.""" | ||
|
||
with TemporaryDirectory() as tmp: | ||
assert DependencyManager(Path(tmp)) |
Empty file.
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,25 @@ | ||
""" | ||
Test the 'github' module. | ||
""" | ||
|
||
# internal | ||
from tests.resources import OWNER, REPO | ||
|
||
# module under test | ||
from yambs.github import ( | ||
github_url, | ||
latest_release_data, | ||
latest_repo_release_api_url, | ||
) | ||
|
||
|
||
def test_github_url_basic(): | ||
"""Test URL encoding.""" | ||
|
||
assert github_url().geturl() == "https://github.com" | ||
assert github_url(netloc_prefix="api").geturl() == "https://api.github.com" | ||
assert ( | ||
latest_repo_release_api_url(OWNER, REPO) | ||
== "https://api.github.com/repos/vkottler/yambs-sample/releases/latest" | ||
) | ||
assert latest_release_data(OWNER, REPO) |
Oops, something went wrong.