diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 00000000..5c1ff791 --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index a1a5b79d..0da40b0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" # Configuration for Black. diff --git a/setup.py b/setup.py index 69f42ac4..2d09d5e0 100644 --- a/setup.py +++ b/setup.py @@ -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.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={ @@ -19,7 +34,7 @@ packages=["ogusa"], package_data={"ogusa": ["ogusa_default_parameters.json", "data/PSID/*"]}, include_packages=True, - python_requires=">=3.7.7, <3.11", + python_requires=">=3.7.7, <3.12", install_requires=[ "numpy", "psutil", @@ -37,21 +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", - "Topic :: Software Development :: Libraries :: Python Modules", - ], tests_require=["pytest"], )