Skip to content

Commit

Permalink
Added scripts for PyPI publication.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmberg committed Aug 14, 2024
1 parent 9e1120d commit ea5169f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 24 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish to PyPI.org
on:
release:
types: [published]
jobs:
pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install package
run: make install
- name: Build package
run: make
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip-existing: true
24 changes: 0 additions & 24 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/_build/html
Publish:
runs-on: ubuntu-latest
if: |
(github.repository == 'PolicyEngine/reweight')
&& (github.event.head_commit.message == 'Update reweight')
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Publish a git tag
run: ".github/publish-git-tag.sh || true"
- name: Install package
run: make install
- name: Build package
run: make
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip-existing: true
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[project]
name = "policyengine-reweight"
authors = [
{ name="Peter Berggren", email="[email protected]" },
]
description = "Reweighting package for survey weights in PolicyEngine"
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
License :: OSI Approved :: GNU Affero General Public License v3
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/PolicyEngine/reweight"
Issues = "https://github.com/PolicyEngine/reweight/issues"

[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"dev": [
"black",
"yaml-changelog",
"setuptools",
"setuptools_scm",
],
},
# Windows CI requires Python 3.9.
Expand Down

0 comments on commit ea5169f

Please sign in to comment.