Skip to content

Commit 5b34300

Browse files
authored
Merge pull request #1300 from PolicyEngine/fix/modify-uk-api-script
Update script to open automated API update PRs
2 parents 3c630e6 + 18b63cf commit 5b34300

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/update_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import argparse
2+
import tomllib
23
import os
34

45

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

2425
# Then, cd inside and run gcp/bump_country_package.py --country policyengine-uk --version {version}

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
changed:
4+
- Updated script to open automated API update PRs

0 commit comments

Comments
 (0)