From 6b1714e9bbaacd1150cdf3c11493c0a49d7fa261 Mon Sep 17 00:00:00 2001 From: James Montgomery Date: Wed, 16 Apr 2025 10:53:44 -0700 Subject: [PATCH 1/4] Changed backend build to hatch; added workflow to test building the package --- .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++++++++++ pyproject.toml | 14 ++++++------ 2 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..46d236b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: Test + +on: + push: + branches: ["dev", "main"] + pull_request: + branches: ["dev", "main"] + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + + # Test building the package + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + shell: bash + run: | + python -m pip install --upgrade pip build + + - name: Build package + shell: bash + run: | + python -m build --sdist --wheel + + - name: Install tarball + shell: bash + run: | + python -m pip install dist/*.gz + + - name: Test installation + shell: bash + run: | + spectral_util diff --git a/pyproject.toml b/pyproject.toml index 096e0d1..bacaa29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,3 @@ -[build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - -[tool.setuptools.packages.find] -include = ["timefed"] - [project] name = "timefed" version = "2.2.0" @@ -56,3 +49,10 @@ repository = "https://github.jpl.nasa.gov/jamesmo/TimeFED" [project.scripts] timefed = "timefed.__main__:cli" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.version] +path = "timefed/__init__.py" From 3d52c3ea7709cb1038590c4c053b7e99b268dfb7 Mon Sep 17 00:00:00 2001 From: James Montgomery Date: Wed, 16 Apr 2025 10:55:43 -0700 Subject: [PATCH 2/4] Fixed bad file extension --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bacaa29..b7595fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "timefed" version = "2.2.0" description = "Timeseries Forecasting, Evaluation, and Deployment" -readme = "README.rst" +readme = "README.md" requires-python = ">=3.10" license = {file = "LICENSE"} keywords = ["timefed", "TimeFED", "Time-FED"] From 0204eb1d5e4002317b4dbd1f4adf7740aae598af Mon Sep 17 00:00:00 2001 From: James Montgomery Date: Wed, 16 Apr 2025 11:03:49 -0700 Subject: [PATCH 3/4] Added mkdocs workflow --- .github/workflows/build.yml | 2 +- .github/workflows/mkdocs.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/mkdocs.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46d236b..ee2a3bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,4 +41,4 @@ jobs: - name: Test installation shell: bash run: | - spectral_util + timefed diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml new file mode 100644 index 0000000..d8361ec --- /dev/null +++ b/.github/workflows/mkdocs.yml @@ -0,0 +1,33 @@ +name: MkDocs + +on: + push: + branches: + - main + pull_request: + branches: ["dev", "main"] + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs- + - run: pip install mkdocs mkapi + - run: mkdocs gh-deploy --force From 8792f901ce045d09f4e2563b2de8dd008570e0d6 Mon Sep 17 00:00:00 2001 From: James Montgomery Date: Wed, 16 Apr 2025 11:08:29 -0700 Subject: [PATCH 4/4] Remove build docs on PR --- .github/workflows/mkdocs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index d8361ec..ecd21a2 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -4,8 +4,6 @@ on: push: branches: - main - pull_request: - branches: ["dev", "main"] permissions: contents: write