github-rest-api 0.47.0__tar.gz → 0.47.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/PKG-INFO +1 -1
  2. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/create_github_repo.py +15 -5
  3. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/pyproject.toml +1 -1
  4. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/uv.lock +1 -1
  5. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.devcontainer/devcontainer.json +0 -0
  6. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.github/workflows/claude-code-review.yml +0 -0
  7. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.github/workflows/claude.yml +0 -0
  8. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.github/workflows/create_pr_to_main.yaml +0 -0
  9. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.github/workflows/lint.yaml +0 -0
  10. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.github/workflows/release.yaml +0 -0
  11. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.github/workflows/remove_branch.yaml +0 -0
  12. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.github/workflows/test.yaml +0 -0
  13. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/.gitignore +0 -0
  14. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/GEMINI.md +0 -0
  15. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/README.md +0 -0
  16. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/__init__.py +0 -0
  17. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/github.py +0 -0
  18. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/pr_content.py +0 -0
  19. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/__init__.py +0 -0
  20. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/__init__.py +0 -0
  21. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/benchmark.py +0 -0
  22. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/profiling.py +0 -0
  23. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/utils.py +0 -0
  24. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/__init__.py +0 -0
  25. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/build_container_images.py +0 -0
  26. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/config_container.py +0 -0
  27. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/update_version_containerfile.py +0 -0
  28. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/__init__.py +0 -0
  29. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/auto_merge_pull_request.py +0 -0
  30. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/create_pull_request.py +0 -0
  31. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/release_on_github.py +0 -0
  32. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/remove_branch.py +0 -0
  33. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/create_pr_dev_to_main.yaml +0 -0
  34. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/create_pr_to_dev.yaml +0 -0
  35. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/create_pr_to_main.yaml +0 -0
  36. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/python/lint.yaml +0 -0
  37. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/python/test.yaml +0 -0
  38. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/remove_branch.yaml +0 -0
  39. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/scripts/utils.py +0 -0
  40. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/github_rest_api/utils.py +0 -0
  41. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/memory/MEMORY.md +0 -0
  42. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/memory/feedback_test_runner.md +0 -0
  43. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/tests/__init__.py +0 -0
  44. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/tests/test_build_container_images.py +0 -0
  45. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/tests/test_create_pull_request.py +0 -0
  46. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/tests/test_github.py +0 -0
  47. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/tests/test_pr_content.py +0 -0
  48. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/tests/test_release_on_github.py +0 -0
  49. {github_rest_api-0.47.0 → github_rest_api-0.47.1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-rest-api
3
- Version: 0.47.0
3
+ Version: 0.47.1
4
4
  Summary: Simple wrapper of GitHub REST APIs.
5
5
  Author-email: Ben Du <longendu@yahoo.com>
6
6
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -45,6 +45,17 @@ def _ensure_remote(path: Path, repo: str, protocol: str) -> None:
45
45
  pass
46
46
 
47
47
 
48
+ def _active_branch(path: Path) -> str:
49
+ try:
50
+ return porcelain.active_branch(path).decode()
51
+ except (IndexError, ValueError) as e:
52
+ raise ValueError(
53
+ f"HEAD of the local repo at '{path}' is detached (not on any branch), "
54
+ "which is unsupported (this happens, e.g., with a colocated Jujutsu repo). "
55
+ "Check out a branch (e.g. `git switch -c main`) before running this command."
56
+ ) from e
57
+
58
+
48
59
  def _init_local_repo(
49
60
  repo: str,
50
61
  language: str,
@@ -61,10 +72,9 @@ def _init_local_repo(
61
72
  readme.write_text(f"# {repo_name}\n")
62
73
  if not (path / ".git").exists():
63
74
  porcelain.init(path=path)
64
- initial_branch = (
65
- (path / ".git" / "HEAD").read_text().strip().partition("refs/heads/")[-1]
66
- )
67
- porcelain.add(repo=path)
75
+ if not porcelain.branch_list(path):
76
+ initial_branch = _active_branch(path)
77
+ porcelain.add(repo=path, paths=["README.md"])
68
78
  porcelain.commit(repo=path, message="first commit")
69
79
  for branch in branches:
70
80
  if branch != initial_branch:
@@ -76,7 +86,7 @@ def _init_local_repo(
76
86
  local_branches = {b.decode() for b in porcelain.branch_list(path)}
77
87
  branches_to_push = [branch for branch in branches if branch in local_branches]
78
88
  if not branches_to_push:
79
- branches_to_push = [porcelain.active_branch(path).decode()]
89
+ branches_to_push = [_active_branch(path)]
80
90
  for branch in branches_to_push:
81
91
  porcelain.push(
82
92
  repo=path,
@@ -4,7 +4,7 @@ requires = [ "hatchling" ]
4
4
 
5
5
  [project]
6
6
  name = "github-rest-api"
7
- version = "0.47.0"
7
+ version = "0.47.1"
8
8
  description = "Simple wrapper of GitHub REST APIs."
9
9
  readme = "README.md"
10
10
  authors = [ { name = "Ben Du", email = "longendu@yahoo.com" } ]
@@ -542,7 +542,7 @@ wheels = [
542
542
 
543
543
  [[package]]
544
544
  name = "github-rest-api"
545
- version = "0.47.0"
545
+ version = "0.47.1"
546
546
  source = { editable = "." }
547
547
  dependencies = [
548
548
  { name = "dulwich" },