Skip to content

Commit

Permalink
Release v0.1 (blackjax-devs#22)
Browse files Browse the repository at this point in the history
* add release github workflow
* relax JAX version
* add multiple chains example
  • Loading branch information
rlouf authored May 23, 2021
1 parent a25b032 commit 8209172
Show file tree
Hide file tree
Showing 5 changed files with 382 additions and 30 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: release

on:
release:
types:
- created

jobs:
release-job:
runs-on: ubuntu-latest
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install release tooling
run: |
pip install twine wheel
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Check version number match
run: |
echo "GITHUB_REF: ${GITHUB_REF}"
# The GITHUB_REF should be something like "refs/tags/v3.x.x"
# Make sure the package version is the same as the tag
grep -Rq "^Version: ${GITHUB_REF:11}$" blackjax.egg-info/PKG-INFO
- name: Publish to PyPI
run: |
twine check dist/*
twine upload --repository pypi --username __token__ --password ${PYPI_TOKEN} dist/*
test-install-job:
needs: release-job
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Give PyPI some time to update the index
run: sleep 240
- name: Install from PyPI
run: |
pip install blackjax==${GITHUB_REF:11}
4 changes: 2 additions & 2 deletions blackjax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from . import hmc, inference

__version__ = "0.0.1"
__version__ = "0.1"

__all__ = ["hmc", "inference"]
__all__ = ["hmc", "nuts", "inference"]
333 changes: 312 additions & 21 deletions notebooks/Introduction.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jax==0.2.13
jaxlib==0.1.67
jax>=0.2.13
jaxlib>=0.1.67
24 changes: 19 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import codecs
import os.path
import sys

import setuptools


# READ README.md for long description on PyPi.
try:
long_description = open("README.md", encoding="utf-8").read()
except Exception as e:
sys.stderr.write("Failed to read README.md:\n {}\n".format(e))
sys.stderr.flush()
long_description = ""


# Get the package's version number of the __init__.py file
def read(rel_path):
"""Read the file located at the provided relative path."""
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), "r") as fp:
return fp.read()


INSTALL_REQS = read("requirements.txt").splitlines()


def get_version(rel_path):
"""Get the package's version number.
Expand All @@ -30,11 +38,17 @@ def get_version(rel_path):
raise RuntimeError("Unable to find version string.")


INSTALL_REQS = read("requirements.txt").splitlines()

setuptools.setup(
name="blackjax",
author="The BlackJAX team",
version=get_version("blackjax/__init__.py"),
description="Flexible and fast inference in Python",
long_description=long_description,
packages=setuptools.find_packages(),
install_requires=INSTALL_REQS
,
install_requires=INSTALL_REQS,
long_description_content_type="text/markdown",
keywords="probabilistic machine learning bayesian statistics sampling algorithms",
license="Apache License 2.0",
)

0 comments on commit 8209172

Please sign in to comment.