Skip to content

Commit

Permalink
Add support for nightly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Nov 22, 2022
1 parent 9a1db19 commit d0c009d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Nightly
on:
schedule:
- cron: "0 0 * * *"

jobs:
build_and_publish:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install build
- name: Build the sdist
run: python -m build --sdist .
env:
BUILD_AEPPL_NIGHTLY: true
- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.nightly_pypi_secret }}
6 changes: 5 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ warn_redundant_casts = True
warn_unused_ignores = True
show_error_codes = True

[mypy-setup]
ignore_errors = True
check_untyped_defs = False

[mypy-versioneer]
check_untyped_defs = False

Expand All @@ -77,4 +81,4 @@ ignore_errors = True
check_untyped_defs = False

[mypy-aeppl.printing.*]
ignore_errors = True
ignore_errors = True
24 changes: 23 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
#!/usr/bin/env python
import os
from os.path import exists

from setuptools import setup

import versioneer

NAME = "aeppl"

# Handle builds of nightly release
if "BUILD_AEPPL_NIGHTLY" in os.environ:
nightly = True
NAME += "-nightly"

from versioneer import get_versions as original_get_versions

def get_versions():
from datetime import datetime, timezone

suffix = datetime.now(timezone.utc).strftime(r".dev%Y%m%d")
versions = original_get_versions()
versions["version"] = versions["version"].split("+")[0] + suffix
return versions

versioneer.get_versions = get_versions


setup(
name="aeppl",
name=NAME,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="PPL tools for Aesara",
Expand Down Expand Up @@ -39,4 +60,5 @@
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
keywords=["aeppl", "math", "probability", "symbolic", "probabilistic programming"],
)

0 comments on commit d0c009d

Please sign in to comment.