Skip to content

Commit

Permalink
Merge pull request #51 from PolicyEngine/fix/rename_repo
Browse files Browse the repository at this point in the history
Update repo name
  • Loading branch information
anth-volk authored Jan 15, 2024
2 parents 661eb5a + b69d6b1 commit 4702b5b
Show file tree
Hide file tree
Showing 24 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: policyengine-api-light
project_id: policyengine-household-api
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
versioning:
name: Update versioning
if: |
(github.repository == 'PolicyEngine/policyengine-api-light')
(github.repository == 'PolicyEngine/policyengine-household-api')
&& !(github.event.head_commit.message == 'Update PolicyEngine API')
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
name: Deploy API
runs-on: ubuntu-latest
if: |
(github.repository == 'PolicyEngine/policyengine-api-light')
(github.repository == 'PolicyEngine/policyengine-household-api')
&& (github.event.head_commit.message == 'Update PolicyEngine API')
steps:
- name: Checkout repo
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"type": "python",
"request": "launch",
"stopOnEntry": false,
"program": "${workspaceRoot}/policyengine_api_light/debug.py",
"program": "${workspaceRoot}/policyengine_household_api/debug.py",
"env": {
"FLASK_APP": "${workspaceRoot}/policyengine_api_light/debug.py"
"FLASK_APP": "${workspaceRoot}/policyengine_household_api/debug.py"
},
"args": [
"run"
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ install:
pip install -e .[dev]

debug:
FLASK_APP=policyengine_api_light.api FLASK_DEBUG=1 flask run --without-threads
FLASK_APP=policyengine_household_api.api FLASK_DEBUG=1 flask run --without-threads

test:
pytest -vv --timeout=150 -rP tests
Expand All @@ -16,15 +16,15 @@ format:
deploy:
python gcp/export.py
gcloud config set app/cloud_build_timeout 1800
cp gcp/policyengine_api_light/* .
cp gcp/policyengine_household_api/* .
y | gcloud app deploy --service-account=github-deployment@policyengine-api-light.iam.gserviceaccount.com
rm app.yaml
rm Dockerfile
rm .gac.json

changelog:
build-changelog changelog.yaml --output changelog.yaml --update-last-date --start-from 0.1.0 --append-file changelog_entry.yaml
build-changelog changelog.yaml --org PolicyEngine --repo policyengine-api-light --output CHANGELOG.md --template .github/changelog_template.md
bump-version changelog.yaml setup.py policyengine_api_light/constants.py
build-changelog changelog.yaml --org PolicyEngine --repo policyengine-household-api --output CHANGELOG.md --template .github/changelog_template.md
bump-version changelog.yaml setup.py policyengine_household_api/constants.py
rm changelog_entry.yaml || true
touch changelog_entry.yaml
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:
- Correct repo name and updated references (except GCP)
2 changes: 1 addition & 1 deletion gcp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ RUN cd Python-3.9.7 && ./configure --enable-optimizations
RUN cd Python-3.9.7 && make altinstall
RUN python3.9 -m pip install --upgrade pip
RUN apt-get update && apt-get install -y redis-server
RUN pip install git+https://github.com/policyengine/policyengine-api-light
RUN pip install git+https://github.com/policyengine/policyengine-household-api
6 changes: 3 additions & 3 deletions gcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ The deployment actions build Docker images and deploy them to Google App Engine.

To update the starter image:
* `python setup.py sdist` to build the python package
* `twine upload dist/*` to upload the package to pypi as `policyengine-api-light`
* `twine upload dist/*` to upload the package to pypi as `policyengine-household-api`
* `cd gcp`
* `docker build .`
* `docker images` to get the image id (the most recent one should be the one you just built)
* `docker tag <image id> nikhilwoodruff/policyengine-api-light`
* `docker push nikhilwoodruff/policyengine-api-light`
* `docker tag <image id> anthvolk/policyengine-household-api`
* `docker push anthvolk/policyengine-household-api`
4 changes: 2 additions & 2 deletions gcp/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
with open(".gac.json", "w") as f:
f.write(GAE)

# in gcp/policyengine_api_light/Dockerfile, replace env variables
# in gcp/policyengine_household_api/Dockerfile, replace env variables
for dockerfile_location in [
"gcp/policyengine_api_light/Dockerfile",
"gcp/policyengine_household_api/Dockerfile",
]:
with open(dockerfile_location, "r") as f:
dockerfile = f.read()
Expand Down
2 changes: 1 addition & 1 deletion gcp/policyengine_api_light/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM anthvolk/policyengine-api-light:latest
FROM anthvolk/policyengine-household-api:latest
ENV GOOGLE_APPLICATION_CREDENTIALS .gac.json
ENV AUTH0_ADDRESS_NO_DOMAIN .address
ENV AUTH0_AUDIENCE_NO_DOMAIN .audience
Expand Down
2 changes: 1 addition & 1 deletion gcp/policyengine_api_light/start.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Start the API
gunicorn -b :$PORT policyengine_api_light.api --timeout 300 --workers 2
gunicorn -b :$PORT policyengine_household_api.api --timeout 300 --workers 2
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
from policyengine_core.taxbenefitsystems import TaxBenefitSystem
from typing import Union
from policyengine_api_light.utils import get_safe_json
from policyengine_household_api.utils import get_safe_json
from policyengine_core.parameters import (
ParameterNode,
Parameter,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from policyengine_api_light.country import (
from policyengine_household_api.country import (
COUNTRIES,
validate_country,
)
import json
from flask import Response, request
from policyengine_api_light.country import COUNTRIES
from policyengine_household_api.country import COUNTRIES
import json
import logging

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from setuptools import setup, find_packages
from policyengine_api_light.constants import __version__
from policyengine_household_api.constants import __version__

setup(
name="policyengine-api-light",
name="policyengine-household-api",
version=__version__,
author="PolicyEngine",
author_email="[email protected]",
description="PolicyEngine API Light",
description="PolicyEngine Household API",
packages=find_packages(),
install_requires=[
"Authlib<1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import pytest
from pathlib import Path
from policyengine_api_light.api import app
from policyengine_household_api.api import app


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_calculate_sync(client):
API_URL + "/" + country_id + "/calculate", json=input_data
).json()

# Mock a POST request to API-light
# Mock a POST request to household-API
resLight = client.post(
"/" + country_id + "/calculate",
headers={
Expand Down
2 changes: 1 addition & 1 deletion tests/python/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import json
import requests
from policyengine_api_light.api import app
from policyengine_household_api.api import app


@pytest.fixture
Expand Down

0 comments on commit 4702b5b

Please sign in to comment.