Skip to content

Commit

Permalink
Remove strict boost dependency and auto-publish to pypi
Browse files Browse the repository at this point in the history
Removal of boost dependency was handled in gostevehoward/confseq#16
  • Loading branch information
WannabeSmith authored Jan 12, 2022
1 parent aa60dff commit 2d51731
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 26 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lint-and-format.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linting+formatting
name: Linting and formatting

on: [push, pull_request]

Expand All @@ -7,11 +7,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Check formatting with black
- uses: psf/black@stable

- name: Lint with flake8
run: |
pip install flake8 pytype
pip install --upgrade flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and publish package

on:
pull_request:
branches: [ main ]
release:
types: [ prereleased, released ]

jobs:
build_and_publish:
name: Build and publish rilacs on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: Build dist
run: |
pip install --upgrade build
python -m build ./
- uses: actions/upload-artifact@v2
with:
name: rilacs_dist
path: ./dist/*

- name: Publish distribution to Test PyPI (if prereleased)
if: github.event_name == 'release' && github.event.action == 'prereleased'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution to PyPI (if officially released)
if: github.event_name == 'release' && github.event.action == 'released'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# This workflow will check type consistency and run unit tests for Ubuntu & macOS with Python 3.7--3.10.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Test RiLACS

on:
push:
Expand All @@ -10,7 +10,7 @@ on:
branches: [ main ]

jobs:
build:
test-rilacs:

runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -28,17 +28,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Install testing dependencies
run: |
# Install boost library to OS
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update
sudo apt-get install -y libboost-all-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install boost
fi
python -m pip install --upgrade pip
python -m pip install pytest pytype wheel
python -m pip install --upgrade pytest pytype
- name: Install package
run: |
Expand All @@ -58,12 +50,3 @@ jobs:
- name: Run unit tests with pytest
run: |
pytest -m "not random"
- name: Build and upload wheels
run: |
pip wheel --no-deps ./
- uses: actions/upload-artifact@v2
with:
name: rilacs_wheels
path: ./*.whl
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
markers = [
"random: marks tests as random (deselect with '-m \"not random\"')"
]

[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

setup(
name="rilacs",
version="0.0.1",
version="1.0.0",
description="Risk limiting audits via confidence sequences",
url="http://github.com/WannabeSmith/RiLACS",
author="Ian Waudby-Smith",
author_email="ianws@cmu.edu",
license="BSD 3-Clause",
packages=["rilacs"],
install_requires=[
"confseq @ https://github.com/WannabeSmith/confseq/tarball/master#egg=confseq",
"confseq",
"numpy",
"scipy",
],
Expand Down

0 comments on commit 2d51731

Please sign in to comment.