Skip to content

Commit

Permalink
Merge pull request #74 from rickecon/package
Browse files Browse the repository at this point in the history
Update GitHub Actions and package deployment
  • Loading branch information
jdebacker authored Oct 26, 2023
2 parents d6aaba5 + ed5c028 commit 6e42207
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Check Black formatting
name: Check code formatting

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: psf/black@stable
with:
args: ". -l 79 --check"
options: "-l 79 --check"
src: "."
7 changes: 3 additions & 4 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand All @@ -29,11 +29,10 @@ jobs:
pip install sphinxcontrib-bibtex>=2.0.0
pip install -e .
python -m ipykernel install --user --name=ogusa-dev
cd docs
jb build ./book
jb build ./docs/book
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand All @@ -26,5 +26,4 @@ jobs:
pip install sphinxcontrib-bibtex>=2.0.0
pip install -e .
python -m ipykernel install --user --name=ogusa-dev
cd docs
jb build ./book
jb build ./docs/book
30 changes: 30 additions & 0 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish package to PyPI

on:
push:
branches:
- master

jobs:
deploy:
name: Publish to PyPI
if: github.repository == 'PSLmodels/OG-USA'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Build package
shell: bash -l {0}
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip_existing: true
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.1] - 2023-10-25 17:00:00

### Added

- Updates `README.md`
- Changes `check_black.yml` to `check_format.yml`
- Updates other GH Action files: `build_and_test.yml`, `docs_check.yml`, and `deploy_docs.yml`
- Updates `publish_to_pypi.yml`
- Adds changes from PRs [#73](https://github.com/PSLmodels/OG-USA/pull/73) and [#67](https://github.com/PSLmodels/OG-USA/pull/67)

## [0.1.0] - 2023-07-19 12:00:00

### Added

- Restarts the release numbering to follow semantic versioning and the OG-USA version numbering as separate from the OG-Core version numbering.
- Adds restriction `python<3.11` to `environment.yml` and `setup.py`.
- Changes the format of `setup.py`.
- Updates `build_and_test.yml` to test Python 3.9 and 3.10.
- Updates some GH Action script versions in `check_black.yml`.
- Updates the Python version to 3.10 in `docs_check.yml` and `deploy_docs.yml`.
- Updated the `LICENSE` file to one that GitHub recognizes.
- Updates the `run_og_usa.py` run script.
- Updates some tests and associated data.
- Pins the version of `rpy2` package in `environment.yml` and `setup.py`


## Previous versions

### Summary

- Version [0.7.0] on August 30, 2021 was the first time that the OG-USA repository was detached from all of the core model logic, which was named OG-Core. Before this version, OG-USA was part of what is now the [`OG-Core`](https://github.com/PSLmodels/OG-Core) repository. In the next version of OG-USA, we adjusted the version numbering to begin with 0.1.0. This initial version of 0.7.0, was sequential from what OG-USA used to be when the OG-Core project was called OG-USA.
- Any earlier versions of OG-USA can be found in the [`OG-Core`](https://github.com/PSLmodels/OG-Core) repository [release history](https://github.com/PSLmodels/OG-Core/releases) from [v.0.6.4](https://github.com/PSLmodels/OG-Core/releases/tag/v0.6.4) (Jul. 20, 2021) or earlier.



[0.1.1]: https://github.com/PSLmodels/OG-USA/compare/v0.1.0...v0.1.1
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
[![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org)
[![Python 3.7+](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://www.python.org/downloads/release/python-377/)
[![Codecov](https://codecov.io/gh/PSLmodels/OG-USA/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/OG-USA)

# OG-USA

| | |
| --- | --- |
| Org | [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) [![OS License: CC0-1.0](https://img.shields.io/badge/OS%20License-CC0%201.0-yellow)](https://github.com/PSLmodels/OG-USA/blob/master/LICENSE) |
| Package | [![Python 3.9](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3917/) [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31013/) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3116/) [![PyPI Latest Release](https://img.shields.io/pypi/v/ogusa.svg)](https://pypi.org/project/ogusa/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogusa.svg?label=PyPI%20downloads)](https://pypi.org/project/fiscalsim-us/) |
| Testing | ![example event parameter](https://github.com/PSLmodels/OG-USA/actions/workflows/build_and_test.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-USA/actions/workflows/deploy_docs.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-USA/actions/workflows/check_format.yml/badge.svg?branch=master) [![Codecov](https://codecov.io/gh/PSLmodels/OG-USA/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/OG-USA) |

OG-USA is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for the United States. OG-USA is built on the [OG-Core](https://github.com/PSLmodels/OG-Core) framework. The model output includes changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and the stream of tax revenues over time. Regularly updated documentation of the model theory--its output, and solution method--and the Python API is available at [https://pslmodels.github.io/OG-Core](https://pslmodels.github.io/OG-Core) and documentation of the specific United States calibration of the model is available at [https://pslmodels.github.io/OG-USA](https://pslmodels.github.io/OG-USA).


## Disclaimer

The model is constantly under development, and model components could change significantly. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release!



## Using/contributing to OG-USA

Expand Down Expand Up @@ -47,16 +55,15 @@ c = Calibration(p)
updated_params = c.get_dict()
p.update_specifications({'initial_debt_ratio': updated_params['initial_debt_ratio']})
```
## Disclaimer
The organization of this repository will be changing rapidly, but the `OG-USA/examples/run_og_usa.py` script will be kept up to date to run with the master branch of this repo.


## Core Maintainers

The core maintainers of the OG-Core repository are:

* [Jason DeBacker](https://www.jasondebacker.com/) (GitHub handle: [jdebacker](https://github.com/jdebacker)), Associate Professor, Department of Economics, Darla Moore School of Business, University of South Carolina; President, PSL Foundation; Vice President of Research and Co-founder, Open Research Group, Inc.
* [Richard W. Evans](https://sites.google.com/site/rickecon/) (GitHub handle: [rickecon](https://github.com/rickecon)), Advisory Board Visiting Fellow, Center for Public Finance, Baker Institute for Public Policy at Rice University; President, Open Research Group, Inc.; Director, Open Source Economics Laboratory
* [Richard W. Evans](https://sites.google.com/site/rickecon/) (GitHub handle: [rickecon](https://github.com/rickecon)), Senior Research Fellow and Director of Open Policy, Center for Growth and Opportunity at Utah State University; President, Open Research Group, Inc.; Director, Open Source Economics Laboratory.

## Citing OG-USA

OG-USA (Version 0.0.0)[Source code], https://github.com/PSLmodels/OG-USA
OG-USA (Version #.#.#)[Source code], https://github.com/PSLmodels/OG-USA.
2 changes: 1 addition & 1 deletion cs-config/cs_config/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class MetaParams(paramtools.Parameters):


def get_version():
return "0.1.0"
return "0.1.1"


def get_inputs(meta_param_dict):
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

# Configuration for Black.

# NOTE: you have to use single-quoted strings in TOML for regular expressions.
Expand All @@ -7,5 +11,5 @@

[tool.black]
line-length = 79
target-version = ['py36', 'py37', 'py38']
target-version = ["py39", "py310", "py311"]
include = '\.pyi?$'
43 changes: 22 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
import setuptools
"""This file contains the OG-USA package's metadata and dependencies."""

with open("README.md", "r", encoding="utf-8") as fh:
longdesc = fh.read()
from setuptools import find_packages, setup

setuptools.setup(
with open("README.md", "r") as readme_file:
readme = readme_file.read()

setup(
name="ogusa",
version="0.1.0",
version="0.1.1",
author="Jason DeBacker and Richard W. Evans",
license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
description="USA calibration for OG-Core",
long_description=readme,
long_description_content_type="text/markdown",
long_description=longdesc,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: CC0 1.0 Universal public domain dedication",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Information Analysis",
],
keywords="USA calibration of large scale overlapping generations model of fiscal policy",
url="https://github.com/PSLmodels/OG-USA/",
download_url="https://github.com/PSLmodels/OG-USA/",
project_urls={
Expand All @@ -37,22 +52,8 @@
"openpyxl>=3.1.2",
"statsmodels",
"linearmodels",
"wheel",
"ogcore",
],
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: CC0 1.0 Universal public domain dedication",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
],
tests_require=["pytest"],
)

0 comments on commit 6e42207

Please sign in to comment.