diff --git a/.github/workflows/nightly-pypi.yml b/.github/workflows/nightly-pypi.yml new file mode 100644 index 00000000..8febd492 --- /dev/null +++ b/.github/workflows/nightly-pypi.yml @@ -0,0 +1,52 @@ +name: Nightly PyPI Publish +on: + schedule: + - cron: "8 7 * * *" # 07:08 UTC daily + workflow_dispatch: {} # allow manual runs (no publish) + +permissions: + contents: read + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # setuptools-scm requires full history/tags + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install build setuptools-scm + + - name: Compute nightly version from latest tag (per-second) + id: ver + run: | + TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo 0.1.0) + BASE=${TAG#v} + DATE=$(date -u +%Y%m%d%H%M%S) + echo "NVER=${BASE}.dev${DATE}" >> $GITHUB_OUTPUT + + - name: Build sdist/wheel with forced version + run: | + export SETUPTOOLS_SCM_PRETEND_VERSION=${{ steps.ver.outputs.NVER }} + python -m build + + - name: Check metadata + run: | + pip install twine + twine check dist/* + + - name: Publish to PyPI (API token) + if: github.event_name == 'schedule' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + skip-existing: true diff --git a/pyproject.toml b/pyproject.toml index 9f9da509..5e954104 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,27 @@ [build-system] -requires = ["setuptools>=40.8.0", "wheel"] +requires = ["setuptools>=64", "wheel", "setuptools-scm>=8.0.0"] build-backend = "setuptools.build_meta" [project] name = "tritonparse" -version = "0.1.1" +dynamic = ["version"] dependencies = [ "triton>3.3.1", ] requires-python = ">=3.10" +description = "TritonParse: A Compiler Tracer, Visualizer, and mini-Reproducer Generator for Triton Kernels" +readme = "README.md" +authors = [ + { name="Yueming Hao", email="yhao@meta.com" }, +] +license = { text = "BSD-3-Clause" } + [project.optional-dependencies] test = [ "coverage>=7.0.0", ] - [tool.setuptools.packages.find] include = ["tritonparse*"] @@ -30,5 +36,9 @@ sorter = "usort" [tool.usort] first_party_detection = false +[tool.setuptools_scm] +version_scheme = "guess-next-dev" +local_scheme = "no-local-version" + [project.urls] "Homepage" = "https://github.com/meta-pytorch/tritonparse"