Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-publish to PyPI #795

Merged
merged 4 commits into from
Mar 31, 2022
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
1 change: 0 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: true
verbose: true

20 changes: 20 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,23 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/book/_build/html # The folder the action should deploy.
publish:
needs: build
name: Publish to PyPI
if: github.repository == 'PSLmodels/OG-Core'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikhilwoodruff and @jdebacker. Should we update the Python version in line 21 and line 50 from 3.7 to 3.9?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rickecon I don't think it matters - that's just the version of Python used to build the package - not the version of Python the package is compatible with.

- name: Build package
run: make pip-package
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip_existing: true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ git-sync:
.PHONY=git-pr
git-pr:
@./gitpr $(N)

pip-package:
pip install wheel
python setup.py sdist bdist_wheel
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
with open('README.md') as f:
longdesc = f.read()

version = '0.7.0'
version = '0.8.0'

config = {
'description': 'General equilibribum, overlapping generations model for the USA',
'description': 'A general equilibribum overlapping generations model for fiscal policy analysis',
'long_description_content_type': 'text/markdown',
'long_description': longdesc,
'url': 'https://github.com/PSLmodels/OG-Core/',
'download_url': 'https://github.com/PLSmodels/OG-Core/',
'version': version,
'license': 'CC0 1.0 Universal public domain dedication',
'license': 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
'packages': ['ogcore'],
'include_package_data': True,
'name': 'ogcore',
Expand All @@ -33,7 +34,7 @@
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: CC0 1.0 Universal public domain dedication',
'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
Expand Down