From d0c009d23df93b43e572b9853138b48933d657f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Louf?= Date: Mon, 21 Nov 2022 12:13:48 +0100 Subject: [PATCH] Add support for nightly builds --- .github/workflows/nightly.yml | 28 ++++++++++++++++++++++++++++ setup.cfg | 6 +++++- setup.py | 24 +++++++++++++++++++++++- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..48685309 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -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 }} diff --git a/setup.cfg b/setup.cfg index d17af617..18f19783 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -77,4 +81,4 @@ ignore_errors = True check_untyped_defs = False [mypy-aeppl.printing.*] -ignore_errors = True \ No newline at end of file +ignore_errors = True diff --git a/setup.py b/setup.py index fbfa4ae1..40f48110 100644 --- a/setup.py +++ b/setup.py @@ -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", @@ -39,4 +60,5 @@ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], + keywords=["aeppl", "math", "probability", "symbolic", "probabilistic programming"], )