From ec853533f3d628f743c79241fae916d3cbbf0e54 Mon Sep 17 00:00:00 2001 From: delucchi-cmu Date: Mon, 6 Nov 2023 10:21:34 -0500 Subject: [PATCH] Update copier version and better readme links. --- .copier-answers.yml | 3 +- .github/workflows/asv-main.yml | 4 +-- .github/workflows/asv-nightly.yml | 9 +++--- .github/workflows/asv-pr.yml | 42 ++++++++++++--------------- .github/workflows/linting.yml | 2 +- .github/workflows/publish-to-pypi.yml | 10 +++---- .github/workflows/smoke-test.yml | 2 ++ README.md | 8 +++-- pyproject.toml | 7 ++++- 9 files changed, 45 insertions(+), 42 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index dd0a191f..110cb26c 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v1.4.3 +_commit: v1.4.4 _src_path: gh:lincc-frameworks/python-project-template author_email: lincc-frameworks-team@lists.lsst.org author_name: LINCC Frameworks @@ -13,5 +13,6 @@ package_name: hipscat preferred_linter: pylint project_license: BSD project_name: hipscat +project_organization: astronomy-commons use_gitlfs: none use_isort: true diff --git a/.github/workflows/asv-main.yml b/.github/workflows/asv-main.yml index 0cc09df0..e280bd0a 100644 --- a/.github/workflows/asv-main.yml +++ b/.github/workflows/asv-main.yml @@ -66,7 +66,7 @@ jobs: run: | sudo apt-get update python -m pip install --upgrade pip - pip install asv==0.5.1 virtualenv tabulate + pip install asv==0.6.1 virtualenv tabulate - name: Configure git run: | @@ -86,7 +86,7 @@ jobs: fi - name: Run ASV for the main branch - run: asv run ALL --skip-existing + run: asv run ALL --skip-existing --verbose - name: Submit new results to the "benchmarks" branch uses: JamesIves/github-pages-deploy-action@v4 diff --git a/.github/workflows/asv-nightly.yml b/.github/workflows/asv-nightly.yml index ea42823f..fa04f450 100644 --- a/.github/workflows/asv-nightly.yml +++ b/.github/workflows/asv-nightly.yml @@ -7,7 +7,8 @@ name: Run benchmarks nightly job on: schedule: - cron: 45 6 * * * - + workflow_dispatch: + env: PYTHON_VERSION: "3.10" WORKING_DIR: ${{ github.workspace }}/benchmarks @@ -43,7 +44,7 @@ jobs: run: | sudo apt-get update python -m pip install --upgrade pip - pip install asv==0.5.1 virtualenv + pip install asv==0.6.1 virtualenv - name: Create ASV machine config file run: asv machine --machine gh-runner --yes @@ -67,8 +68,8 @@ jobs: if [ -f $HASH_FILE ]; then PREV_HASH=$(cat $HASH_FILE) - asv continuous $PREV_HASH $CURRENT_HASH || true - asv compare $PREV_HASH $CURRENT_HASH --sort ratio + asv continuous $PREV_HASH $CURRENT_HASH --verbose || true + asv compare $PREV_HASH $CURRENT_HASH --sort ratio --verbose fi echo $CURRENT_HASH > $HASH_FILE diff --git a/.github/workflows/asv-pr.yml b/.github/workflows/asv-pr.yml index cfbbd2cc..bef22084 100644 --- a/.github/workflows/asv-pr.yml +++ b/.github/workflows/asv-pr.yml @@ -61,7 +61,7 @@ jobs: run: | sudo apt-get update python -m pip install --upgrade pip - pip install asv==0.5.1 virtualenv tabulate lf-asv-formatter + pip install asv==0.6.1 virtualenv tabulate lf-asv-formatter - name: Get current job logs URL uses: Tiryoh/gha-jobid-action@v0 @@ -77,31 +77,25 @@ jobs: run: | git remote add upstream https://github.com/${{ github.repository }}.git git fetch upstream - asv continuous upstream/main HEAD || true - asv compare upstream/main HEAD --sort ratio | tee output - python -m lf_asv_formatter + asv continuous upstream/main HEAD --verbose || true + asv compare upstream/main HEAD --sort ratio --verbose | tee output + python -m lf_asv_formatter --asv_version "$(echo asv --version)" printf "\n\nClick [here]($STEP_URL) to view all benchmarks." >> output env: STEP_URL: "${{ steps.jobs.outputs.html_url }}#step:8:1" - - name: Publish comment to PR - uses: actions/github-script@v6 + - name: Find benchmarks comment + uses: peter-evans/find-comment@v2 + id: find-comment with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const fs = require('fs'); - const path = require('path'); - - const workingDir = process.env.WORKING_DIR; - try { - process.chdir(workingDir); - const comment = fs.readFileSync('output', 'utf-8'); - const { data } = await github.rest.issues.createComment({ - ...context.repo, - issue_number: context.issue.number, - body: comment, - }); - console.log('Comment published:', data.html_url); - } catch (err) { - console.error(err); - } \ No newline at end of file + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: view all benchmarks + + - name: Create or update benchmarks comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.find-comment.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body-path: ${{ env.WORKING_DIR }}/output + edit-mode: replace \ No newline at end of file diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 0826130a..68169e69 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -33,4 +33,4 @@ jobs: run: | pylint -rn -sn --recursive=y ./src --rcfile=./src/.pylintrc pylint -rn -sn --recursive=y ./tests --rcfile=./tests/.pylintrc - + pylint -rn -sn --recursive=y ./benchmarks --rcfile=./tests/.pylintrc diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index a0754794..3147bde9 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,5 +1,5 @@ # This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries +# For more information see: https://github.com/pypa/gh-action-pypi-publish#trusted-publishing # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by @@ -19,7 +19,8 @@ jobs: deploy: runs-on: ubuntu-latest - + permissions: + id-token: write steps: - uses: actions/checkout@v3 - name: Set up Python @@ -33,7 +34,4 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index df093f48..a704ccfd 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -6,6 +6,8 @@ name: Unit test smoke test on: + + # Runs this workflow automatically schedule: - cron: 45 6 * * * # Allows you to run this workflow manually from the Actions tab diff --git a/README.md b/README.md index 9ab1832f..94c49bb1 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ [![Template](https://img.shields.io/badge/Template-LINCC%20Frameworks%20Python%20Project%20Template-brightgreen)](https://lincc-ppt.readthedocs.io/en/latest/) -![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/astronomy-commons/hipscat) -![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/astronomy-commons/hipscat/testing-and-coverage.yml) -![Read the Docs](https://img.shields.io/readthedocs/hipscat) +[![PyPI](https://img.shields.io/pypi/v/hipscat?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/hipscat/) +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/astronomy-commons/hipscat/smoke-test.yml)](https://github.com/astronomy-commons/hipscat/actions/workflows/smoke-test.yml) +[![codecov](https://codecov.io/gh/astronomy-commons/hipscat/branch/main/graph/badge.svg)](https://codecov.io/gh/astronomy-commons/hipscat) +[![Read the Docs](https://img.shields.io/readthedocs/hipscat)](https://hipscat.readthedocs.io/) +[![benchmarks](https://img.shields.io/github/actions/workflow/status/astronomy-commons/hipscat/asv-main.yml?label=benchmarks)](https://astronomy-commons.github.io/hipscat/) ## Hierarchical Progressive Survey Catalog diff --git a/pyproject.toml b/pyproject.toml index ad751cc8..31c194b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "adlfs", # abfs filesytem support - "asv==0.5.1", # Used to compute performance benchmarks + "asv==0.6.1", # Used to compute performance benchmarks "ipykernel", # Support for Jupyter notebooks "ipython", # Also used in building notebooks into Sphinx "matplotlib", # Used in sample notebook intro_notebook.ipynb @@ -49,6 +49,11 @@ dev = [ "sphinx-autoapi", # Used to automatically generate api documentation "sphinx-rtd-theme" # Used to render documentation ] + +[metadata] +long_description = { file = "README.md" } +url = "https://github.com/astronomy-commons/hipscat" + [build-system] requires = [ "setuptools>=62", # Used to build and package the Python project