From b3954d8bd42dfbb6698c669dfcba2831f771abe2 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 11:44:04 -0700 Subject: [PATCH 01/14] versioning --- crystal_toolkit/_version.py | 1 - pyproject.toml | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 crystal_toolkit/_version.py diff --git a/crystal_toolkit/_version.py b/crystal_toolkit/_version.py deleted file mode 100644 index 7c075029..00000000 --- a/crystal_toolkit/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "2023.11.4.dev18" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index bff09b6c..9c6c1423 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,3 +128,7 @@ ignore-words-list = "nd,te,ois" [tool.mypy] no_implicit_optional = false + +[tool.versioningit.vcs] +default-tag = "0.0.1" +method = "git" From 132a31a86571056708383d3de78d8e0c4b5a4230 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 14:29:34 -0700 Subject: [PATCH 02/14] wf --- .github/workflows/release.yml | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6446b174..317b4476 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,32 +21,6 @@ jobs: cache: "pip" cache-dependency-path: '**/pyproject.toml' - - name: bump version and create tag - env: - DATE_FORMAT: "%Y.%m.%d" - run: | - NEXT_RELEASE=$(date "+${DATE_FORMAT}") - LAST_RELEASE=$(git tag --sort=v:refname | grep "^20[^\-]*$" | tail -n 1) - echo "Last release : ${LAST_RELEASE}" - MAJOR_LAST_RELEASE=$(echo "${LAST_RELEASE}" | awk -v l=${#NEXT_RELEASE} '{ string=substr($0, 1, l); print string; }') - echo "Last major release : ${MAJOR_LAST_RELEASE}" - if [ "${MAJOR_LAST_RELEASE}" = "${NEXT_RELEASE}" ]; then - MINOR_LAST_RELEASE="$(echo "${LAST_RELEASE}" | awk -v l=$((${#NEXT_RELEASE} + 2)) '{ string=substr($0, l); print string; }')" - NEXT_RELEASE=${MAJOR_LAST_RELEASE}.$((MINOR_LAST_RELEASE + 1)) - fi - echo "Next release: ${NEXT_RELEASE}" - git config --local user.email "github-actions@github.com" - git config --local user.name "github-actions" - python -m pip install --upgrade pip - python -m pip install --user --upgrade pip build setuptools "setuptools_scm<8" wheel - SETUPTOOLS_SCM_PRETEND_VERSION=${NEXT_RELEASE} python -m setuptools_scm - git add crystal_toolkit/_version.py - git commit -m "version bump: ${NEXT_RELEASE}" - git push - git tag ${NEXT_RELEASE} - git push --tags - echo "NEXT_RELEASE=${NEXT_RELEASE}" >> $GITHUB_ENV - - name: Install dependencies run: | python -m pip install --upgrade pip @@ -56,7 +30,7 @@ jobs: python -m pip install --no-deps .[server] - name: Build package - run: SETUPTOOLS_SCM_PRETEND_VERSION=${{env.NEXT_RELEASE}} python -m build + run: pip install build - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1.5 From 503f378f10084e3045b6e61859ee38cf4e41bbc1 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 14:30:57 -0700 Subject: [PATCH 03/14] wf --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 317b4476..9b263a43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,9 @@ name: Release -on: workflow_dispatch +on: + pull_request: + branches: + - main jobs: deploy: From ad64d8354b7ec26d0cd72b442b34f25d768ee30f Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 14:34:38 -0700 Subject: [PATCH 04/14] wf --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b263a43..86743acb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,11 @@ name: Release on: - pull_request: - branches: - - main + release: + types: [published] + +permissions: + contents: read jobs: deploy: From caec1e77cb79bab12603b432852b04ec89148dd2 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 14:35:10 -0700 Subject: [PATCH 05/14] wf --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86743acb..dfe1ea08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,8 +37,8 @@ jobs: - name: Build package run: pip install build - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1.5 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + # - name: Publish package + # uses: pypa/gh-action-pypi-publish@release/v1.5 + # with: + # user: __token__ + # password: ${{ secrets.PYPI_API_TOKEN }} From 18b21d49910b9f3becc6d2ad50486adad2e36f81 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 14:38:48 -0700 Subject: [PATCH 06/14] wf --- .github/workflows/pytest-docs.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-docs.yml b/.github/workflows/pytest-docs.yml index a26ebfaa..6dac9f5a 100644 --- a/.github/workflows/pytest-docs.yml +++ b/.github/workflows/pytest-docs.yml @@ -1,6 +1,14 @@ name: Tests -on: [release, workflow_dispatch] +on: + push: + branches: + - main + tags: + - "v*" + pull_request: + branches: + - main jobs: build: @@ -20,7 +28,7 @@ jobs: cache: 'pip' cache-dependency-path: '**/pyproject.toml' - name: Install webdriver - run: sudo apt-get update && sudo apt-get install firefox-geckodriver + run: sudo apt-get update && sudo apt-get install firefox - name: Install dependencies run: | python${{ matrix.python-version }} -m pip install --upgrade pip packaging wheel From f49803a87180039a12a81b592d78a09f58eb611e Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 14:39:59 -0700 Subject: [PATCH 07/14] wf --- .github/workflows/pytest-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-docs.yml b/.github/workflows/pytest-docs.yml index 6dac9f5a..35e29709 100644 --- a/.github/workflows/pytest-docs.yml +++ b/.github/workflows/pytest-docs.yml @@ -1,4 +1,4 @@ -name: Tests +name: Test Docs on: push: From 26ba67ef299de4679a19a33a6667ff0d6c8329a3 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 14:53:18 -0700 Subject: [PATCH 08/14] wf --- .github/workflows/pytest-docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest-docs.yml b/.github/workflows/pytest-docs.yml index 35e29709..de7e8823 100644 --- a/.github/workflows/pytest-docs.yml +++ b/.github/workflows/pytest-docs.yml @@ -28,12 +28,13 @@ jobs: cache: 'pip' cache-dependency-path: '**/pyproject.toml' - name: Install webdriver - run: sudo apt-get update && sudo apt-get install firefox + run: sudo apt-get update && sudo apt-get install chromium-chromedriver - name: Install dependencies run: | python${{ matrix.python-version }} -m pip install --upgrade pip packaging wheel python${{ matrix.python-version }} -m pip install `grep numpy== requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt` python${{ matrix.python-version }} -m pip install -r requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt + python${{ matrix.python-version }} -m pip install --upgrade pip python${{ matrix.python-version }} -m pip install --no-deps . - name: Build new docs run: | From 20f88e563881bce00be7d4ac0e3229217e4bd0c3 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 15:02:40 -0700 Subject: [PATCH 09/14] wf --- .github/workflows/pytest-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest-docs.yml b/.github/workflows/pytest-docs.yml index de7e8823..1b398cb9 100644 --- a/.github/workflows/pytest-docs.yml +++ b/.github/workflows/pytest-docs.yml @@ -41,6 +41,7 @@ jobs: cd docs_rst make html - name: Detect changes + if: contains(github.ref, 'refs/heads/main') id: changes shell: bash run: | @@ -55,6 +56,7 @@ jobs: git commit -m "Automated doc build" git push - name: pytest + if: contains(github.ref, 'refs/heads/main') env: PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} run: pytest --color=yes --webdriver Firefox --headless crystal_toolkit/apps/examples/tests/ From fbe0c81c051abf560aa09833c6fbbbeb375e239d Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 15:07:51 -0700 Subject: [PATCH 10/14] wf --- .github/workflows/release.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfe1ea08..31782afd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,8 +37,9 @@ jobs: - name: Build package run: pip install build - # - name: Publish package - # uses: pypa/gh-action-pypi-publish@release/v1.5 - # with: - # user: __token__ - # password: ${{ secrets.PYPI_API_TOKEN }} + - name: Publish package + if: contains(github.ref, 'refs/heads/main') + uses: pypa/gh-action-pypi-publish@release/v1.5 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 46c9758764b1eb50c826e927cba1a62694dd4043 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 15:24:26 -0700 Subject: [PATCH 11/14] wf --- .github/workflows/pytest-docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest-docs.yml b/.github/workflows/pytest-docs.yml index 1b398cb9..6e9af083 100644 --- a/.github/workflows/pytest-docs.yml +++ b/.github/workflows/pytest-docs.yml @@ -56,7 +56,6 @@ jobs: git commit -m "Automated doc build" git push - name: pytest - if: contains(github.ref, 'refs/heads/main') env: PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} run: pytest --color=yes --webdriver Firefox --headless crystal_toolkit/apps/examples/tests/ From 40be858e3e1a8fffc1f03ba58d9d5e13ae72cd6e Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 15:27:46 -0700 Subject: [PATCH 12/14] wf --- .github/workflows/pytest-docs.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pytest-docs.yml b/.github/workflows/pytest-docs.yml index 6e9af083..4d0e5f97 100644 --- a/.github/workflows/pytest-docs.yml +++ b/.github/workflows/pytest-docs.yml @@ -55,7 +55,3 @@ jobs: git add -A git commit -m "Automated doc build" git push - - name: pytest - env: - PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} - run: pytest --color=yes --webdriver Firefox --headless crystal_toolkit/apps/examples/tests/ From bd84de6224e64cf353a03f1da62cc78900eb85f0 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 15:28:50 -0700 Subject: [PATCH 13/14] wf --- .github/workflows/pull-request.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 59f1ad7a..9c9d8b1f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,8 +1,14 @@ name: pytest on: + push: + branches: + - main + tags: + - "v*" pull_request: - branches: [main] + branches: + - main jobs: build: From 3b57f958ab086c227ff29b8eb2c774d945574459 Mon Sep 17 00:00:00 2001 From: "@jmmshn" Date: Thu, 16 May 2024 15:31:10 -0700 Subject: [PATCH 14/14] wf --- .github/workflows/pull-request.yml | 2 +- .github/workflows/pytest-docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9c9d8b1f..7b826502 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,4 +1,4 @@ -name: pytest +name: Testing on: push: diff --git a/.github/workflows/pytest-docs.yml b/.github/workflows/pytest-docs.yml index 4d0e5f97..290e0232 100644 --- a/.github/workflows/pytest-docs.yml +++ b/.github/workflows/pytest-docs.yml @@ -1,4 +1,4 @@ -name: Test Docs +name: Build Docs on: push: