Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/update_api.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import argparse
import tomllib
import os


def main():
# First, find the current package version number from the setup.py file
with open("pyproject.toml", "r") as f:
setup = f.read()
version = setup.split("version = ")[1].split(",")[0].strip('"')
with open("pyproject.toml", "rb") as f:
data = tomllib.load(f)
version = data["project"]["version"]
# Then, clone the https://github.com/policyengine/policyengine-api repo using the GitHub CLI
pat = os.environ["GITHUB_TOKEN"]
os.system(
Expand All @@ -18,7 +19,7 @@ def main():
)
# Repeat the above for https://github.com/policyengine/policyengine-household-api
os.system(
f"git clone https://nikhilwodruff:{pat}@github.com/policyengine/policyengine-household-api"
f"git clone https://nikhilwoodruff:{pat}@github.com/policyengine/policyengine-household-api"
)

# Then, cd inside and run gcp/bump_country_package.py --country policyengine-uk --version {version}
Expand Down
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
changed:
- Updated script to open automated API update PRs
Loading