changes to workflow

This commit is contained in:
Rajat Sen
2025-10-07 21:38:22 +00:00
parent dc35e580d9
commit 018b2557ab
6 changed files with 171 additions and 39 deletions
+10 -14
View File
@@ -1,4 +1,4 @@
name: Poetry publish name: Python package build
on: on:
push: push:
@@ -7,24 +7,20 @@ on:
branches: [ "master" ] branches: [ "master" ]
jobs: jobs:
buildPush: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: '3.10' python-version: '3.11'
- name: Install Poetry - name: Install uv
run: | run: |
python -m pip install --upgrade pip curl -LsSf https://astral.sh/uv/install.sh | sh
pip install poetry echo "$HOME/.cargo/bin" >> $GITHUB_PATH
# use the hardcoded version number for now. if this is merged to the main repo, you can uncomment these lines to automatically tag the version number with the github run number - name: Install build dependencies
# e.g. poetry version 0.1.${{ github.run_number }}
- name: Set Version number
run: | run: |
poetry version 1.3.0 uv pip install build
- name: Build and Publish to PyPI - name: Build package
run: | run: python -m build
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish --build
+25
View File
@@ -0,0 +1,25 @@
name: Manual PyPI Publish
on:
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Poetry
run: |
uv pip install poetry
- name: Build and Publish to PyPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish --build
+1
View File
@@ -6,3 +6,4 @@ wandb/
datasets/ datasets/
results/ results/
timesfm_jax.egg-info/ timesfm_jax.egg-info/
development_setup.md
+20 -7
View File
@@ -44,15 +44,28 @@ will be under construction over the next few weeks to
### Install ### Install
TODO(siriuz42): Package timesfm==2.0.0 and upload to PyPI . 1. Clone the repository:
```shell
git clone https://github.com/google-research/timesfm.git
cd timesfm
```
Run 2. Create a virtual environment and install dependencies using `uv`:
```shell
# Create a virtual environment
uv venv
```shell # Activate the environment
git clone https://github.com/google-research/timesfm.git source .venv/bin/activate
cd timesfm
pip install -e . # Install the dependencies
``` uv pip install -r requirements.txt
```
3. (Optional) If you plan to modify the source code, install the package in editable mode:
```shell
uv pip install -e .
```
### Code Example ### Code Example
+16 -18
View File
@@ -1,31 +1,29 @@
[tool.poetry] [project]
name = "timesfm" name = "timesfm"
version = "2.0.0" version = "2.0.0"
description = "A time series foundation model." description = "A time series foundation model."
authors = [ authors = [
"Rajat Sen <senrajat@google.com>", {name = "Rajat Sen", email = "senrajat@google.com"},
"Yichen Zhou <yichenzhou@google.com>", {name = "Yichen Zhou", email = "yichenzhou@google.com"},
"Abhimanyu Das <abhidas@google.com>", {name = "Abhimanyu Das", email = "abhidas@google.com"},
"Petros Mol <pmol@google.com>", {name = "Petros Mol", email = "pmol@google.com"},
"Michael Chertushkin <chertushkinmichael@gmail.com>" {name = "Michael Chertushkin", email = "chertushkinmichael@gmail.com"},
] ]
license = "Apache-2.0" license = {text = "Apache-2.0"}
readme = "README.md" readme = "README.md"
packages = [{include = "timesfm", from = "src"}] requires-python = ">=3.11"
dependencies = [
[tool.poetry.dependencies] "numpy>=1.26.4",
python = ">=3.11" "huggingface_hub[cli]>=0.23.0",
numpy = ">=1.26.4" "safetensors>=0.5.3",
huggingface_hub = { version = ">=0.23.0", extras = ["cli"] } "torch>=2.0.0",
safetensors = ">=0.5.3" ]
torch = { version = ">=2.0.0", extras = ["cuda"] }
[tool.ruff] [tool.ruff]
line-length = 88 line-length = 88
indent-width = 2 indent-width = 2
[build-system] [build-system]
requires = ["poetry-core"] requires = ["setuptools>=61.0"]
build-backend = "poetry.core.masonry.api" build-backend = "setuptools.build_meta"
+99
View File
@@ -0,0 +1,99 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml -o requirements.txt
certifi==2025.10.5
# via requests
charset-normalizer==3.4.3
# via requests
filelock==3.19.1
# via
# huggingface-hub
# torch
fsspec==2025.9.0
# via
# huggingface-hub
# torch
hf-xet==1.1.10
# via huggingface-hub
huggingface-hub==0.35.3
# via timesfm (pyproject.toml)
idna==3.10
# via requests
inquirerpy==0.3.4
# via huggingface-hub
jinja2==3.1.6
# via torch
markupsafe==3.0.3
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.5
# via torch
numpy==2.3.3
# via timesfm (pyproject.toml)
nvidia-cublas-cu12==12.8.4.1
# via
# nvidia-cudnn-cu12
# nvidia-cusolver-cu12
# torch
nvidia-cuda-cupti-cu12==12.8.90
# via torch
nvidia-cuda-nvrtc-cu12==12.8.93
# via torch
nvidia-cuda-runtime-cu12==12.8.90
# via torch
nvidia-cudnn-cu12==9.10.2.21
# via torch
nvidia-cufft-cu12==11.3.3.83
# via torch
nvidia-cufile-cu12==1.13.1.3
# via torch
nvidia-curand-cu12==10.3.9.90
# via torch
nvidia-cusolver-cu12==11.7.3.90
# via torch
nvidia-cusparse-cu12==12.5.8.93
# via
# nvidia-cusolver-cu12
# torch
nvidia-cusparselt-cu12==0.7.1
# via torch
nvidia-nccl-cu12==2.27.3
# via torch
nvidia-nvjitlink-cu12==12.8.93
# via
# nvidia-cufft-cu12
# nvidia-cusolver-cu12
# nvidia-cusparse-cu12
# torch
nvidia-nvtx-cu12==12.8.90
# via torch
packaging==25.0
# via huggingface-hub
pfzy==0.3.4
# via inquirerpy
prompt-toolkit==3.0.52
# via inquirerpy
pyyaml==6.0.3
# via huggingface-hub
requests==2.32.5
# via huggingface-hub
safetensors==0.6.2
# via timesfm (pyproject.toml)
setuptools==80.9.0
# via triton
sympy==1.14.0
# via torch
torch==2.8.0
# via timesfm (pyproject.toml)
tqdm==4.67.1
# via huggingface-hub
triton==3.4.0
# via torch
typing-extensions==4.15.0
# via
# huggingface-hub
# torch
urllib3==2.5.0
# via requests
wcwidth==0.2.14
# via prompt-toolkit