From 2ac1b0d20e7a4f773414b39dec407f33a38a565d Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 12:57:48 -0400 Subject: [PATCH 01/80] Test draft --- .github/workflows/schemacode_ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index c7cfea5ab7..4aceccceda 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -51,6 +51,11 @@ jobs: run: | python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools + - name: "Test upload" + shell: bash {0} + run: | + if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi + - name: Upload artifacts uses: actions/upload-artifact@v3 with: From b3a3fb0a6ab3d9c5ebf6f8fbb6c5bde16baba41b Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:08:18 -0400 Subject: [PATCH 02/80] triggering on tag --- .github/workflows/schemacode_ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 4aceccceda..0c9e824481 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -7,12 +7,16 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" + tag: + - "refs/tags/schema-*" pull_request: branches: - "*" paths: - "tools/schemacode/**" - "src/schema/**" + tag: + - "refs/tags/schema-*" jobs: From 7244ecf46e81b39f1076be949104ff7095853819 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:10:31 -0400 Subject: [PATCH 03/80] debug --- .github/workflows/schemacode_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 0c9e824481..8b3b287289 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -7,7 +7,7 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" - tag: + tags: - "refs/tags/schema-*" pull_request: branches: @@ -15,7 +15,7 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" - tag: + tags: - "refs/tags/schema-*" jobs: From 1f5c52f14af22c24e4cb401fe52e3dbced02438f Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:12:40 -0400 Subject: [PATCH 04/80] debug --- .github/workflows/schemacode_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 8b3b287289..b0601bbf65 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -8,7 +8,7 @@ on: - "tools/schemacode/**" - "src/schema/**" tags: - - "refs/tags/schema-*" + - "schema-*" pull_request: branches: - "*" @@ -16,7 +16,7 @@ on: - "tools/schemacode/**" - "src/schema/**" tags: - - "refs/tags/schema-*" + - "schema-*" jobs: From 599b2acdb9b6285da2882856a94bf0ca414337f8 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:15:48 -0400 Subject: [PATCH 05/80] debug --- .github/workflows/schemacode_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index b0601bbf65..6b6cfa2199 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -17,6 +17,7 @@ on: - "src/schema/**" tags: - "schema-*" + workflow_dispatch: jobs: From 2e62662772bbdf496b3a0518fad82f4ab54467db Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:19:20 -0400 Subject: [PATCH 06/80] debug --- .github/workflows/schemacode_ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 6b6cfa2199..6b6f817d0d 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -18,6 +18,9 @@ on: tags: - "schema-*" workflow_dispatch: + branches: + - "*" + jobs: From 208a143c1cd47c899f7d65f5d91702fccd088738 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:21:26 -0400 Subject: [PATCH 07/80] debug --- .github/workflows/schemacode_ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 6b6f817d0d..3d43451498 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -17,9 +17,7 @@ on: - "src/schema/**" tags: - "schema-*" - workflow_dispatch: - branches: - - "*" + workflow_dispatch jobs: From 688bfe0976f04fd761d3aa1eea8b4ced8411de4b Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:23:01 -0400 Subject: [PATCH 08/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 3d43451498..0eaa75e787 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -1,6 +1,7 @@ name: "schemacode_ci" on: + workflow_dispatch push: branches: - "master" @@ -17,7 +18,6 @@ on: - "src/schema/**" tags: - "schema-*" - workflow_dispatch jobs: From 4f7a0a197749c98870ef6e102199983240083049 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:24:09 -0400 Subject: [PATCH 09/80] debug --- .github/workflows/schemacode_ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 0eaa75e787..7067239542 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -1,7 +1,6 @@ name: "schemacode_ci" on: - workflow_dispatch push: branches: - "master" @@ -9,7 +8,7 @@ on: - "tools/schemacode/**" - "src/schema/**" tags: - - "schema-*" + - "*" pull_request: branches: - "*" @@ -17,7 +16,7 @@ on: - "tools/schemacode/**" - "src/schema/**" tags: - - "schema-*" + - "*" jobs: From 4e3ab043fef75811e74fc5c1c832de2af980bc9c Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:24:45 -0400 Subject: [PATCH 10/80] debug --- .github/workflows/schemacode_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 7067239542..d51b89fa8f 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -9,6 +9,7 @@ on: - "src/schema/**" tags: - "*" + - "**" pull_request: branches: - "*" @@ -17,6 +18,7 @@ on: - "src/schema/**" tags: - "*" + - "**" jobs: From 3e592eb5ec995798031af0992335614d3ce19fca Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:26:25 -0400 Subject: [PATCH 11/80] debug --- .github/workflows/schemacode_ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index d51b89fa8f..cfe243e568 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -13,9 +13,6 @@ on: pull_request: branches: - "*" - paths: - - "tools/schemacode/**" - - "src/schema/**" tags: - "*" - "**" From 7b17e52d5f0c54e2c696f32ed62a717c545705ce Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:29:08 -0400 Subject: [PATCH 12/80] debug --- .github/workflows/schemacode_ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index cfe243e568..a24ae90cc3 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -13,6 +13,10 @@ on: pull_request: branches: - "*" + paths: + - "tools/schemacode/**" + - "src/schema/**" + - ".github/workflows*" tags: - "*" - "**" From 36b5c39482cc4f4183c645fd8eae7b56d0a208ac Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:30:50 -0400 Subject: [PATCH 13/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index a24ae90cc3..2a3ca840e0 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -16,7 +16,7 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" - - ".github/workflows*" + - ".github/workflows/*" tags: - "*" - "**" From 4fa3d51a2b76535b4b1eb645f5bc5eb2567fec6e Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:34:51 -0400 Subject: [PATCH 14/80] debug --- .github/workflows/schemacode_ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 2a3ca840e0..a611128671 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -54,6 +54,11 @@ jobs: python -m pip install --progress-bar off --upgrade pip python -m pip install ./tools/schemacode[all] + - name: "Collect tags" + shell: bash {0} + run: | + python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools + - name: "Run tests" shell: bash {0} run: | From 17e50716cccba87de7333f5a7ec795903e576053 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:35:46 -0400 Subject: [PATCH 15/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index a611128671..6651ed6404 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -54,7 +54,7 @@ jobs: python -m pip install --progress-bar off --upgrade pip python -m pip install ./tools/schemacode[all] - - name: "Collect tags" + - name: "Collect tags!" shell: bash {0} run: | python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools From 41d58eddacc939874451fc6392ed7e605d1eaf18 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:36:03 -0400 Subject: [PATCH 16/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 6651ed6404..6ed3d03926 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -54,7 +54,7 @@ jobs: python -m pip install --progress-bar off --upgrade pip python -m pip install ./tools/schemacode[all] - - name: "Collect tags!" + - name: "Collect tags!!" shell: bash {0} run: | python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools From 409d2b82dd105991475969533fd5cb3de16ed540 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:37:28 -0400 Subject: [PATCH 17/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 6ed3d03926..3cb80faf1b 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -54,7 +54,7 @@ jobs: python -m pip install --progress-bar off --upgrade pip python -m pip install ./tools/schemacode[all] - - name: "Collect tags!!" + - name: "Collect tags!!!" shell: bash {0} run: | python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools From ebe109a956ab57933b23323e2978b90191f943e8 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:38:12 -0400 Subject: [PATCH 18/80] debug --- .github/workflows/schemacode_ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 3cb80faf1b..01349af4da 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -16,7 +16,6 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" - - ".github/workflows/*" tags: - "*" - "**" From 8dd2b04b9bd2b1dfb3981e843fc5cb79d0f11f15 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:44:01 -0400 Subject: [PATCH 19/80] debug --- .github/workflows/schemacode_ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 01349af4da..acbf1bfada 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -16,6 +16,7 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" + - ".github/workflows/*" tags: - "*" - "**" @@ -53,10 +54,10 @@ jobs: python -m pip install --progress-bar off --upgrade pip python -m pip install ./tools/schemacode[all] - - name: "Collect tags!!!" + - name: "DO WITH tags!!!" shell: bash {0} run: | - python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools + echo ${{ github.GITHUB_REF }} - name: "Run tests" shell: bash {0} From 265ce16d539fb0f055fb6078656033e5b4431bef Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:46:39 -0400 Subject: [PATCH 20/80] debug --- .github/workflows/schemacode_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index acbf1bfada..718996aad9 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -58,6 +58,7 @@ jobs: shell: bash {0} run: | echo ${{ github.GITHUB_REF }} + echo ${{ github.CI }} - name: "Run tests" shell: bash {0} From 429c82aaf0045e8931b4e77007329c6899974cd6 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:53:10 -0400 Subject: [PATCH 21/80] debug --- .github/workflows/schemacode_ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 718996aad9..4b809d4e62 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -59,6 +59,12 @@ jobs: run: | echo ${{ github.GITHUB_REF }} echo ${{ github.CI }} + echo ${{ github.workspace.GITHUB_REF }} + echo ${{ github.workspace.CI }} + echo ${{ env.GITHUB_REF }} + echo ${{ env.CI }} + echo $GITHUB_REF + echo $CI - name: "Run tests" shell: bash {0} From dd30771dd842fb5cc4bec7acf5302b88cdfef915 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 13:55:22 -0400 Subject: [PATCH 22/80] debug --- .github/workflows/schemacode_ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 4b809d4e62..99957cf0ec 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -65,6 +65,10 @@ jobs: echo ${{ env.CI }} echo $GITHUB_REF echo $CI + echo "$GITHUB_REF" + echo "$CI" + echo ${GITHUB_REF} + echo ${CI} - name: "Run tests" shell: bash {0} From 07bb8617fbcaf45ffee5db486878728f6a37cfd9 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:00:41 -0400 Subject: [PATCH 23/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 99957cf0ec..51a933ef3e 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -4,6 +4,7 @@ on: push: branches: - "master" + - "autodata" paths: - "tools/schemacode/**" - "src/schema/**" @@ -16,7 +17,6 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" - - ".github/workflows/*" tags: - "*" - "**" From da5712eb22fe21b82c8823dbc118a4a2311c0cc6 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:03:29 -0400 Subject: [PATCH 24/80] debug --- .github/workflows/schemacode_ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 51a933ef3e..69df3602af 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -17,6 +17,7 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" + - ".github/workflows/*" tags: - "*" - "**" @@ -69,6 +70,11 @@ jobs: echo "$CI" echo ${GITHUB_REF} echo ${CI} + git describe + git describe + git describe + git describe + git describe - name: "Run tests" shell: bash {0} From 74cedb6b9176344c45f7c80c143a127243f7b781 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:06:24 -0400 Subject: [PATCH 25/80] debug --- .github/workflows/schemacode_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 69df3602af..359c918f24 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -70,6 +70,8 @@ jobs: echo "$CI" echo ${GITHUB_REF} echo ${CI} + cwd + ls -lah git describe git describe git describe From 1401b0fca67b380909ee519a0d081a35d85c395e Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:08:32 -0400 Subject: [PATCH 26/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 359c918f24..2fb8a0c492 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -70,7 +70,7 @@ jobs: echo "$CI" echo ${GITHUB_REF} echo ${CI} - cwd + pwd ls -lah git describe git describe From 3162add3a4d56f3ec351f9ca1bdc15182fb1a4d1 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:09:31 -0400 Subject: [PATCH 27/80] debug --- .github/workflows/schemacode_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 2fb8a0c492..3f068a2832 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -72,6 +72,8 @@ jobs: echo ${CI} pwd ls -lah + ls -lah .git/ + which git git describe git describe git describe From 88f4d8a42a0d55c70cef73315f358c7ce05b4770 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:13:01 -0400 Subject: [PATCH 28/80] debug --- .github/workflows/schemacode_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 3f068a2832..b4c7fee13b 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -74,6 +74,7 @@ jobs: ls -lah ls -lah .git/ which git + git ls-remote --tags git describe git describe git describe From 4dc141673d0206813f3e571fd28363527bb73450 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:13:57 -0400 Subject: [PATCH 29/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index b4c7fee13b..4af79c80ba 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -72,7 +72,7 @@ jobs: echo ${CI} pwd ls -lah - ls -lah .git/ + cat .git/COMMIT_EDITMSG which git git ls-remote --tags git describe From bcd2a8e508927f552ace738623b69a8f2e56a809 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:16:23 -0400 Subject: [PATCH 30/80] debug --- .github/workflows/schemacode_ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 4af79c80ba..76bca91d00 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -49,12 +49,6 @@ jobs: shell: bash {0} run: python -c "import sys; print(sys.version)" - - name: "Install the schemacode package" - shell: bash {0} - run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install ./tools/schemacode[all] - - name: "DO WITH tags!!!" shell: bash {0} run: | @@ -73,6 +67,7 @@ jobs: pwd ls -lah cat .git/COMMIT_EDITMSG + tree .git which git git ls-remote --tags git describe @@ -91,6 +86,12 @@ jobs: run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi + - name: "Install the schemacode package" + shell: bash {0} + run: | + python -m pip install --progress-bar off --upgrade pip + python -m pip install ./tools/schemacode[all] + - name: Upload artifacts uses: actions/upload-artifact@v3 with: From 3e053852293e73ff89b2597b641fc006b2d36c96 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:20:40 -0400 Subject: [PATCH 31/80] debug --- .github/workflows/schemacode_ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 76bca91d00..39b367043a 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -70,9 +70,9 @@ jobs: tree .git which git git ls-remote --tags - git describe - git describe - git describe + git describe --tags + git describe --tags + git describe --tags git describe git describe From 682110e245d07045491f3d92d07904369ce7f7e6 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:22:31 -0400 Subject: [PATCH 32/80] debug --- .github/workflows/schemacode_ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 39b367043a..d871f628d4 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -17,7 +17,6 @@ on: paths: - "tools/schemacode/**" - "src/schema/**" - - ".github/workflows/*" tags: - "*" - "**" From 06c18dde3fe9877303ad8c9f0d10c390b6d0be46 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:25:43 -0400 Subject: [PATCH 33/80] debug --- .github/workflows/schemacode_ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index d871f628d4..b34232ddad 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -9,17 +9,13 @@ on: - "tools/schemacode/**" - "src/schema/**" tags: - - "*" - - "**" + - "schema-*" pull_request: branches: - "*" paths: - "tools/schemacode/**" - "src/schema/**" - tags: - - "*" - - "**" jobs: @@ -72,8 +68,6 @@ jobs: git describe --tags git describe --tags git describe --tags - git describe - git describe - name: "Run tests" shell: bash {0} From c03e0478ed92e36dc991181768f7dfae4ae52635 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:43:12 -0400 Subject: [PATCH 34/80] debug --- .github/workflows/schemacode_ci.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index b34232ddad..7e6cb13948 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -17,7 +17,6 @@ on: - "tools/schemacode/**" - "src/schema/**" - jobs: run_tests: @@ -68,6 +67,13 @@ jobs: git describe --tags git describe --tags git describe --tags + echo "MY_TAG=$(git describe --tags)" >> $GITHUB_ENV + + - name: "Install the schemacode package" + shell: bash {0} + run: | + python -m pip install --progress-bar off --upgrade pip + python -m pip install ./tools/schemacode[all] - name: "Run tests" shell: bash {0} @@ -78,12 +84,7 @@ jobs: shell: bash {0} run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi - - - name: "Install the schemacode package" - shell: bash {0} - run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install ./tools/schemacode[all] + echo $GITHUB_ENV - name: Upload artifacts uses: actions/upload-artifact@v3 From 50734232b7657faf1ad1e6310064459fa9d306e2 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:45:12 -0400 Subject: [PATCH 35/80] debug --- .github/workflows/schemacode_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 7e6cb13948..f3f69389a8 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -68,6 +68,7 @@ jobs: git describe --tags git describe --tags echo "MY_TAG=$(git describe --tags)" >> $GITHUB_ENV + export BIDSSCHEMATOOLS_RELEASE=1 - name: "Install the schemacode package" shell: bash {0} @@ -85,6 +86,7 @@ jobs: run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi echo $GITHUB_ENV + echo $MY_TAG - name: Upload artifacts uses: actions/upload-artifact@v3 From bd2ae758487db729731ccad52633f7945fd589d0 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:49:21 -0400 Subject: [PATCH 36/80] debug --- .github/workflows/schemacode_ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index f3f69389a8..457d6ec8b0 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -67,8 +67,10 @@ jobs: git describe --tags git describe --tags git describe --tags - echo "MY_TAG=$(git describe --tags)" >> $GITHUB_ENV - export BIDSSCHEMATOOLS_RELEASE=1 + MY_TAG="$(git describe --tags)" + if [ "${MY_TAG:0:7}" = "schema-" ]; then + echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV + fi - name: "Install the schemacode package" shell: bash {0} @@ -85,8 +87,7 @@ jobs: shell: bash {0} run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi - echo $GITHUB_ENV - echo $MY_TAG + echo $BIDSSCHEMATOOLS_RELEASE - name: Upload artifacts uses: actions/upload-artifact@v3 From 0d281f23d86dce19f36a0410f82e4016e329275a Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 14:51:56 -0400 Subject: [PATCH 37/80] debug --- .github/workflows/schemacode_ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 457d6ec8b0..d45e9a2057 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -88,6 +88,9 @@ jobs: run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi echo $BIDSSCHEMATOOLS_RELEASE + ls /tmp/bidsschematools* -lah + cd / + find -name "*bidsschematools-testdata*" - name: Upload artifacts uses: actions/upload-artifact@v3 From 31db5e2737955c2a78e08e9cdaa7105141feeb05 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 15:16:29 -0400 Subject: [PATCH 38/80] debug --- .github/workflows/schemacode_ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index d45e9a2057..3da76485da 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -87,10 +87,12 @@ jobs: shell: bash {0} run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi - echo $BIDSSCHEMATOOLS_RELEASE - ls /tmp/bidsschematools* -lah - cd / - find -name "*bidsschematools-testdata*" + if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then + echo $BIDSSCHEMATOOLS_RELEASE + ls /tmp/bidsschematools* -lah + python -m build + twine upload -u __token__ -p ${{secrets.PYPI_TEST}} --repository testpypi dist/* + fi - name: Upload artifacts uses: actions/upload-artifact@v3 From 581d0f7e2a7a99ad18d735298399617f71f40275 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:06:13 -0400 Subject: [PATCH 39/80] Test upload to test.pypi before doing the real thing --- .github/workflows/schemacode_ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 3da76485da..02a730ab6b 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -85,13 +85,22 @@ jobs: - name: "Test upload" shell: bash {0} + id: testpypi_upload run: | - if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is unset"; else echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'"; fi if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then - echo $BIDSSCHEMATOOLS_RELEASE + echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'" ls /tmp/bidsschematools* -lah python -m build - twine upload -u __token__ -p ${{secrets.PYPI_TEST}} --repository testpypi dist/* + twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* + fi + + - name: "Real upload" + shell: bash {0} + if: ${{ success(testpypi_upload) }} + run: | + if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then + echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'" + twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository dist/* fi - name: Upload artifacts From 257564158e44e8c27ca327c1c86fd1f5df133250 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:11:50 -0400 Subject: [PATCH 40/80] debug --- src/schema/SCHEMA_VERSION | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 25a5afd80b..e476e12e42 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1,2 @@ 0.4.0-dev +0.0.1660943510-dev From f81010effee2da49439c6b0ad4536a9886873e71 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:17:42 -0400 Subject: [PATCH 41/80] debug --- src/schema/SCHEMA_VERSION | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index e476e12e42..41711623b7 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1,2 +1,3 @@ 0.4.0-dev 0.0.1660943510-dev +0.0.1660943862-dev From 3646a1cdc516a9302bcacec10020660e205a0638 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:18:12 -0400 Subject: [PATCH 42/80] utility script for testing tag hooks --- scripts/test_tag | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/test_tag diff --git a/scripts/test_tag b/scripts/test_tag new file mode 100755 index 0000000000..fb506d3785 --- /dev/null +++ b/scripts/test_tag @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +pushd .. + export MY_BIDS_DATE="$(date +%s)" + echo "0.0.${MY_BIDS_DATE}-dev" >> src/schema/SCHEMA_VERSION + git commit -a -m "debug" + git tag -a "schema-$MY_BIDS_DATE" -m "debug" + git push origin + git push origin "schema-$MY_BIDS_DATE" +popd +unset MY_BIDS_DATE + From be9e6387f3b4bbe678194a436cb2a7f90443e8da Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:50:24 -0400 Subject: [PATCH 43/80] Generating testdata inside repo as opposed to in separate archive --- .../bidsschematools/tests/conftest.py | 11 ++++++----- .../bidsschematools/tests/test_make_testdata.py | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/tools/schemacode/bidsschematools/tests/conftest.py b/tools/schemacode/bidsschematools/tests/conftest.py index 08cac5e6a6..afd7e5f8c8 100644 --- a/tools/schemacode/bidsschematools/tests/conftest.py +++ b/tools/schemacode/bidsschematools/tests/conftest.py @@ -35,19 +35,20 @@ def get_gitrepo_fixture(url, whitelist): @pytest.fixture(scope="session") def fixture(): archive_name = url.rsplit("/", 1)[-1] - testdata_archive = os.path.join(os.getcwd(), "testdata", archive_name) - if os.path.isdir(testdata_archive): + testdata_dir = os.path.join(os.path.dirname(__file__),"data","bundled",archive_name) + testdata_dir = os.path.abspath(testdata_dir) + if os.path.isdir(testdata_dir): lgr.info( "Found static testdata archive under `%s`. " "Not downloading latest data from version control.", - testdata_archive, + testdata_dir, ) - yield testdata_archive + yield testdata_dir else: lgr.info( "No static testdata available under `%s`. " "Attempting to fetch live data from version control.", - testdata_archive, + testdata_dir, ) with tempfile.TemporaryDirectory() as path: assert os.path.exists(path) diff --git a/tools/schemacode/bidsschematools/tests/test_make_testdata.py b/tools/schemacode/bidsschematools/tests/test_make_testdata.py index 11524f9b5a..22c4859a4e 100644 --- a/tools/schemacode/bidsschematools/tests/test_make_testdata.py +++ b/tools/schemacode/bidsschematools/tests/test_make_testdata.py @@ -1,5 +1,6 @@ import os import tarfile +import shutil import pytest @@ -30,9 +31,15 @@ def test_make_archive(bids_examples, bids_error_examples): * Archives will be generated under `/tmp/bidsschematools-testdata-SCHEMA_VERSION.tar.gz` """ - archive_name = f"bidsschematools-testdata-{__version__}" - archive_path = f"/tmp/{archive_name}.tar.gz" + target_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),"data","bundled")) + os.makedirs(target_dir, exist_ok = True) + shutil.copytree(bids_examples, f"{target_dir}/bids-examples") + shutil.copytree(bids_error_examples, f"{target_dir}/bids-error-examples") - with tarfile.open(archive_path, "w:gz") as tar: - tar.add(bids_examples, arcname=f"{archive_name}/bids-examples") - tar.add(bids_error_examples, arcname=f"{archive_name}/bids-error-examples") + # Keeping this for now, it would be really nice to have a separate archive someday. + # archive_name = f"bidsschematools-testdata-{__version__}" + # archive_path = f"/tmp/{archive_name}.tar.gz" + + # with tarfile.open(archive_path, "w:gz") as tar: + # tar.add(bids_examples, arcname=f"{archive_name}/bids-examples") + # tar.add(bids_error_examples, arcname=f"{archive_name}/bids-error-examples") From 9d4a7494284f7a63ce7787806c556681b45995bc Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:53:18 -0400 Subject: [PATCH 44/80] overwrite version file --- scripts/test_tag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test_tag b/scripts/test_tag index fb506d3785..27f9ffaf7f 100755 --- a/scripts/test_tag +++ b/scripts/test_tag @@ -2,7 +2,7 @@ pushd .. export MY_BIDS_DATE="$(date +%s)" - echo "0.0.${MY_BIDS_DATE}-dev" >> src/schema/SCHEMA_VERSION + echo "0.0.${MY_BIDS_DATE}-dev" > src/schema/SCHEMA_VERSION git commit -a -m "debug" git tag -a "schema-$MY_BIDS_DATE" -m "debug" git push origin From fca0ce856fb8659553abd3f62b5fd6ad67a18fe6 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:58:18 -0400 Subject: [PATCH 45/80] Preserve version --- scripts/test_tag | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/test_tag b/scripts/test_tag index 27f9ffaf7f..1a7a0227d0 100755 --- a/scripts/test_tag +++ b/scripts/test_tag @@ -1,12 +1,17 @@ #!/usr/bin/env bash +VERSION_FILE="src/schema/SCHEMA_VERSION" + pushd .. export MY_BIDS_DATE="$(date +%s)" - echo "0.0.${MY_BIDS_DATE}-dev" > src/schema/SCHEMA_VERSION + REAL_VERSION=$(cat "${VERSION_FILE}") + DUMMY_VERSION="0.0.${MY_BIDS_DATE}-dev" + echo "${DUMMY_VERSION}" > "${VERSION_FILE}" git commit -a -m "debug" - git tag -a "schema-$MY_BIDS_DATE" -m "debug" + git tag -a "schema-$DUMMY_VERSION" -m "debug" git push origin - git push origin "schema-$MY_BIDS_DATE" + git push origin "schema-$DUMMY_VERSION" + echo "${REAL_VERSION}" > "${VERSION_FILE}" popd unset MY_BIDS_DATE From c4e003599e84a0f4cc57c4392439dcd0cb3dc826 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:58:48 -0400 Subject: [PATCH 46/80] Fixing broken version file --- src/schema/SCHEMA_VERSION | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 41711623b7..25a5afd80b 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1,3 +1 @@ 0.4.0-dev -0.0.1660943510-dev -0.0.1660943862-dev From d21b15757afdbc89ccb16651061652ffd99ee4dd Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:59:03 -0400 Subject: [PATCH 47/80] Including testdata if present --- tools/schemacode/setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/schemacode/setup.cfg b/tools/schemacode/setup.cfg index 56da3eb0df..60fb75b007 100644 --- a/tools/schemacode/setup.cfg +++ b/tools/schemacode/setup.cfg @@ -49,6 +49,7 @@ all = [options.package_data] bidsschematools = + data/schema/bundled data/schema/BIDS_VERSION data/schema/SCHEMA_VERSION data/schema/**/*.yaml From 11d55b39f9e268bc0a11cc1e508b0a8606f630bb Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 17:59:16 -0400 Subject: [PATCH 48/80] debug --- src/schema/SCHEMA_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 25a5afd80b..8a5bcb6c79 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.4.0-dev +0.0.1660946356-dev From bca2a68ec645968563d97a69844a855003f07b41 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 18:05:03 -0400 Subject: [PATCH 49/80] Including testdata in sdist if existent --- tools/schemacode/setup.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/schemacode/setup.cfg b/tools/schemacode/setup.cfg index 60fb75b007..eb55393ddd 100644 --- a/tools/schemacode/setup.cfg +++ b/tools/schemacode/setup.cfg @@ -49,11 +49,10 @@ all = [options.package_data] bidsschematools = - data/schema/bundled data/schema/BIDS_VERSION data/schema/SCHEMA_VERSION data/schema/**/*.yaml - tests/data/* + tests/data/**/* [options.entry_points] console_scripts = From 89f2b0b5610efdc0d9b8b03b90b48e439142c79c Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Aug 2022 18:06:26 -0400 Subject: [PATCH 50/80] debug --- src/schema/SCHEMA_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 8a5bcb6c79..fddd69f3c0 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1660946356-dev +0.0.1660946786-dev From 554a31113709358ce559f1e34d1e1b9c1b9bcf32 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 12:24:36 -0400 Subject: [PATCH 51/80] debug --- .github/workflows/schemacode_ci.yml | 23 +---------------------- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 02a730ab6b..198696fabf 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -43,30 +43,9 @@ jobs: shell: bash {0} run: python -c "import sys; print(sys.version)" - - name: "DO WITH tags!!!" + - name: "Set release environment variable" shell: bash {0} run: | - echo ${{ github.GITHUB_REF }} - echo ${{ github.CI }} - echo ${{ github.workspace.GITHUB_REF }} - echo ${{ github.workspace.CI }} - echo ${{ env.GITHUB_REF }} - echo ${{ env.CI }} - echo $GITHUB_REF - echo $CI - echo "$GITHUB_REF" - echo "$CI" - echo ${GITHUB_REF} - echo ${CI} - pwd - ls -lah - cat .git/COMMIT_EDITMSG - tree .git - which git - git ls-remote --tags - git describe --tags - git describe --tags - git describe --tags MY_TAG="$(git describe --tags)" if [ "${MY_TAG:0:7}" = "schema-" ]; then echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index fddd69f3c0..a44cf886fc 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1660946786-dev +0.0.1661358276-dev From cb60df788d9a69f4233f4ede11f2f6963d8c0584 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 12:33:28 -0400 Subject: [PATCH 52/80] debug --- .github/workflows/schemacode_ci.yml | 23 ++++++++++++++++++++++- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 198696fabf..02a730ab6b 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -43,9 +43,30 @@ jobs: shell: bash {0} run: python -c "import sys; print(sys.version)" - - name: "Set release environment variable" + - name: "DO WITH tags!!!" shell: bash {0} run: | + echo ${{ github.GITHUB_REF }} + echo ${{ github.CI }} + echo ${{ github.workspace.GITHUB_REF }} + echo ${{ github.workspace.CI }} + echo ${{ env.GITHUB_REF }} + echo ${{ env.CI }} + echo $GITHUB_REF + echo $CI + echo "$GITHUB_REF" + echo "$CI" + echo ${GITHUB_REF} + echo ${CI} + pwd + ls -lah + cat .git/COMMIT_EDITMSG + tree .git + which git + git ls-remote --tags + git describe --tags + git describe --tags + git describe --tags MY_TAG="$(git describe --tags)" if [ "${MY_TAG:0:7}" = "schema-" ]; then echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index a44cf886fc..2b304e0d74 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661358276-dev +0.0.1661358808-dev From d7ea69f73bf1a3155f04a8ebe659f4ee83663ba6 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 12:43:01 -0400 Subject: [PATCH 53/80] debug --- .github/workflows/schemacode_ci.yml | 1 + src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 02a730ab6b..fb26e0d024 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -5,6 +5,7 @@ on: branches: - "master" - "autodata" + - "autodata2" paths: - "tools/schemacode/**" - "src/schema/**" diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 2b304e0d74..f5a009ac6a 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661358808-dev +0.0.1661359381-dev From 6cf62dd47f7d545b285573aa3e75c9e675f724bd Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 12:52:39 -0400 Subject: [PATCH 54/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index fb26e0d024..b862a9117e 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -97,7 +97,7 @@ jobs: - name: "Real upload" shell: bash {0} - if: ${{ success(testpypi_upload) }} + if: steps.testpypi_upload.outputs.exit_code == 0 run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'" diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index f5a009ac6a..ad3735d769 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661359381-dev +0.0.1661359959-dev From ff957d293a60e5739d7a270786b908d4142b1f93 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:07:26 -0400 Subject: [PATCH 55/80] debug --- .github/workflows/schemacode_ci.yml | 24 ++---------------------- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index b862a9117e..e452da1394 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -44,33 +44,13 @@ jobs: shell: bash {0} run: python -c "import sys; print(sys.version)" - - name: "DO WITH tags!!!" + - name: "Set Release Variable based on tag" shell: bash {0} run: | - echo ${{ github.GITHUB_REF }} - echo ${{ github.CI }} - echo ${{ github.workspace.GITHUB_REF }} - echo ${{ github.workspace.CI }} - echo ${{ env.GITHUB_REF }} - echo ${{ env.CI }} - echo $GITHUB_REF - echo $CI - echo "$GITHUB_REF" - echo "$CI" - echo ${GITHUB_REF} - echo ${CI} - pwd - ls -lah - cat .git/COMMIT_EDITMSG - tree .git - which git - git ls-remote --tags - git describe --tags - git describe --tags - git describe --tags MY_TAG="$(git describe --tags)" if [ "${MY_TAG:0:7}" = "schema-" ]; then echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV + echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" fi - name: "Install the schemacode package" diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index ad3735d769..cd1121f8e0 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661359959-dev +0.0.1661360846-dev From 19736c421e93ba9364732d20482f01c3a3495c2d Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:10:20 -0400 Subject: [PATCH 56/80] debug --- .github/workflows/schemacode_ci.yml | 4 ++-- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index e452da1394..4e06b9227b 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -69,7 +69,7 @@ jobs: id: testpypi_upload run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then - echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'" + echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" ls /tmp/bidsschematools* -lah python -m build twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* @@ -80,7 +80,7 @@ jobs: if: steps.testpypi_upload.outputs.exit_code == 0 run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then - echo "BIDSSCHEMATOOLS_RELEASE is set to '$BIDSSCHEMATOOLS_RELEASE'" + echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository dist/* fi diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index cd1121f8e0..2274188d32 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661360846-dev +0.0.1661361020-dev From 7c6525a87e5d14854a1abfcf4fca61e771864c87 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:14:15 -0400 Subject: [PATCH 57/80] debug --- .github/workflows/schemacode_ci.yml | 5 ++++- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 4e06b9227b..d85c90a39e 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -50,7 +50,8 @@ jobs: MY_TAG="$(git describe --tags)" if [ "${MY_TAG:0:7}" = "schema-" ]; then echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV - echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" + export BIDSSCHEMATOOLS_RELEASE=1 + echo "BIDSSCHEMATOOLS_RELEASE has been set to `$BIDSSCHEMATOOLS_RELEASE`" fi - name: "Install the schemacode package" @@ -79,6 +80,8 @@ jobs: shell: bash {0} if: steps.testpypi_upload.outputs.exit_code == 0 run: | + echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" + echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository dist/* diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 2274188d32..d3b14443e6 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661361020-dev +0.0.1661361255-dev From b0df7652b3c060809f79b3d31d8f640770cc0920 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:17:11 -0400 Subject: [PATCH 58/80] debug --- .github/workflows/schemacode_ci.yml | 8 +++----- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index d85c90a39e..721ac93839 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -50,8 +50,7 @@ jobs: MY_TAG="$(git describe --tags)" if [ "${MY_TAG:0:7}" = "schema-" ]; then echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV - export BIDSSCHEMATOOLS_RELEASE=1 - echo "BIDSSCHEMATOOLS_RELEASE has been set to `$BIDSSCHEMATOOLS_RELEASE`" + echo "BIDSSCHEMATOOLS_RELEASE has been set to $BIDSSCHEMATOOLS_RELEASE" fi - name: "Install the schemacode package" @@ -70,7 +69,7 @@ jobs: id: testpypi_upload run: | if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then - echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" + echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" ls /tmp/bidsschematools* -lah python -m build twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* @@ -81,9 +80,8 @@ jobs: if: steps.testpypi_upload.outputs.exit_code == 0 run: | echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then - echo "BIDSSCHEMATOOLS_RELEASE is set to `$BIDSSCHEMATOOLS_RELEASE`" + echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository dist/* fi diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index d3b14443e6..41302c2f9f 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661361255-dev +0.0.1661361431-dev From ab57c67149f1ad81269ba034ca4ffc7f2049e23c Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:24:46 -0400 Subject: [PATCH 59/80] debug --- .github/workflows/schemacode_ci.yml | 5 ++--- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 721ac93839..e7aa2aee90 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -50,7 +50,6 @@ jobs: MY_TAG="$(git describe --tags)" if [ "${MY_TAG:0:7}" = "schema-" ]; then echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV - echo "BIDSSCHEMATOOLS_RELEASE has been set to $BIDSSCHEMATOOLS_RELEASE" fi - name: "Install the schemacode package" @@ -68,7 +67,7 @@ jobs: shell: bash {0} id: testpypi_upload run: | - if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then + if [ -v BIDSSCHEMATOOLS_RELEASE ]; then echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" ls /tmp/bidsschematools* -lah python -m build @@ -80,7 +79,7 @@ jobs: if: steps.testpypi_upload.outputs.exit_code == 0 run: | echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - if [ -z "$BIDSSCHEMATOOLS_RELEASE" ]; then + if [ -v BIDSSCHEMATOOLS_RELEASE ]; then echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository dist/* fi diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 41302c2f9f..389cf12d4a 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661361431-dev +0.0.1661361886-dev From 8a99bade758c0cedaba1d29888c41e4f69e2c3a7 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:27:19 -0400 Subject: [PATCH 60/80] Added documentation --- scripts/test_tag | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/test_tag b/scripts/test_tag index 1a7a0227d0..0356654100 100755 --- a/scripts/test_tag +++ b/scripts/test_tag @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# This is a script which automates creation and pushing of unique tags for github actions. +# It is particularly useful when debugging the upload hooks for pypi. +# The workflow for that is to edit `.github/workflows/schemacode_ci.yml` and add a secondary branch name to the `on` section right after master. +# This will allow you to keep pushing to the branch as if it were master and unix-time tagged archives being uploaded to test.pypi. + VERSION_FILE="src/schema/SCHEMA_VERSION" pushd .. From bc14b913e6cbc46b52a84b178dc6e675f4ece0f1 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:29:11 -0400 Subject: [PATCH 61/80] debug --- .github/workflows/schemacode_ci.yml | 1 + src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index e7aa2aee90..1740344c8a 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -68,6 +68,7 @@ jobs: id: testpypi_upload run: | if [ -v BIDSSCHEMATOOLS_RELEASE ]; then + python -m pip install twine echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" ls /tmp/bidsschematools* -lah python -m build diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 389cf12d4a..fe4968068a 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661361886-dev +0.0.1661362151-dev From 3a85de1db5525b89f05e1007cbac64e21d273f59 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:31:18 -0400 Subject: [PATCH 62/80] debug --- .github/workflows/schemacode_ci.yml | 3 ++- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 1740344c8a..e54584205d 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -70,8 +70,9 @@ jobs: if [ -v BIDSSCHEMATOOLS_RELEASE ]; then python -m pip install twine echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - ls /tmp/bidsschematools* -lah python -m build + ls -lah + tree twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* fi diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index fe4968068a..5d4ecd6dbe 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661362151-dev +0.0.1661362278-dev From 9e9c788e9609db02fd3339c90a7403707737f525 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:33:36 -0400 Subject: [PATCH 63/80] debug --- .github/workflows/schemacode_ci.yml | 8 ++++---- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index e54584205d..2fc8fc93be 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -70,10 +70,10 @@ jobs: if [ -v BIDSSCHEMATOOLS_RELEASE ]; then python -m pip install twine echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - python -m build - ls -lah - tree - twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* + pushd tools/schemacode + python -m build + twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* + popd fi - name: "Real upload" diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 5d4ecd6dbe..0af7497c10 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661362278-dev +0.0.1661362416-dev From f69c8594bc45efa04bd166e972717ca371198dad Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:38:11 -0400 Subject: [PATCH 64/80] debug --- .github/workflows/schemacode_ci.yml | 2 +- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 2fc8fc93be..59d4455eb9 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -71,7 +71,7 @@ jobs: python -m pip install twine echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" pushd tools/schemacode - python -m build + python -m build . twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* popd fi diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 0af7497c10..a1aaa3efb7 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661362416-dev +0.0.1661362691-dev From 1522b5ab16390aecd662cea4d6d768f78ae988c0 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:40:29 -0400 Subject: [PATCH 65/80] debug --- .github/workflows/schemacode_ci.yml | 4 ++-- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 59d4455eb9..5f49c35047 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -68,10 +68,10 @@ jobs: id: testpypi_upload run: | if [ -v BIDSSCHEMATOOLS_RELEASE ]; then - python -m pip install twine + python -m pip install twine wheel echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" pushd tools/schemacode - python -m build . + python -m build twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* popd fi diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index a1aaa3efb7..bc30b08156 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661362691-dev +0.0.1661362829-dev From 447b69dbc69096675fd22ede3977f87e98b41434 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:45:51 -0400 Subject: [PATCH 66/80] debug --- .github/workflows/schemacode_ci.yml | 8 +++++--- scripts/test_tag | 1 + src/schema/SCHEMA_VERSION | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 5f49c35047..c635527cf6 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -68,7 +68,7 @@ jobs: id: testpypi_upload run: | if [ -v BIDSSCHEMATOOLS_RELEASE ]; then - python -m pip install twine wheel + python -m pip install build twine wheel echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" pushd tools/schemacode python -m build @@ -82,8 +82,10 @@ jobs: run: | echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" if [ -v BIDSSCHEMATOOLS_RELEASE ]; then - echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository dist/* + pushd tools/schemacode + echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" + twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} dist/* + popd fi - name: Upload artifacts diff --git a/scripts/test_tag b/scripts/test_tag index 0356654100..295f191854 100755 --- a/scripts/test_tag +++ b/scripts/test_tag @@ -1,5 +1,6 @@ #!/usr/bin/env bash +# Execute this script from its containing directory to push to a new unique testing tag. # This is a script which automates creation and pushing of unique tags for github actions. # It is particularly useful when debugging the upload hooks for pypi. # The workflow for that is to edit `.github/workflows/schemacode_ci.yml` and add a secondary branch name to the `on` section right after master. diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index bc30b08156..402e879072 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661362829-dev +0.0.1661363151-dev From 3d1f1b2647dbe62c835d0398b9f0cca993506e44 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:51:24 -0400 Subject: [PATCH 67/80] debug --- .github/workflows/schemacode_ci.yml | 5 +++-- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index c635527cf6..cc077b1266 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -4,7 +4,6 @@ on: push: branches: - "master" - - "autodata" - "autodata2" paths: - "tools/schemacode/**" @@ -61,7 +60,10 @@ jobs: - name: "Run tests" shell: bash {0} run: | + echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools + ls -lah + tree - name: "Test upload" shell: bash {0} @@ -80,7 +82,6 @@ jobs: shell: bash {0} if: steps.testpypi_upload.outputs.exit_code == 0 run: | - echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" if [ -v BIDSSCHEMATOOLS_RELEASE ]; then pushd tools/schemacode echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 402e879072..c21ca705c2 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661363151-dev +0.0.1661363484-dev From 9bf983d9bf0b0d7d878b6daa54f6a5b59c21ff92 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:53:38 -0400 Subject: [PATCH 68/80] black fixes --- tools/schemacode/bidsschematools/tests/conftest.py | 2 +- tools/schemacode/bidsschematools/tests/test_make_testdata.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/schemacode/bidsschematools/tests/conftest.py b/tools/schemacode/bidsschematools/tests/conftest.py index afd7e5f8c8..47898551f3 100644 --- a/tools/schemacode/bidsschematools/tests/conftest.py +++ b/tools/schemacode/bidsschematools/tests/conftest.py @@ -35,7 +35,7 @@ def get_gitrepo_fixture(url, whitelist): @pytest.fixture(scope="session") def fixture(): archive_name = url.rsplit("/", 1)[-1] - testdata_dir = os.path.join(os.path.dirname(__file__),"data","bundled",archive_name) + testdata_dir = os.path.join(os.path.dirname(__file__), "data", "bundled", archive_name) testdata_dir = os.path.abspath(testdata_dir) if os.path.isdir(testdata_dir): lgr.info( diff --git a/tools/schemacode/bidsschematools/tests/test_make_testdata.py b/tools/schemacode/bidsschematools/tests/test_make_testdata.py index 22c4859a4e..b9279024da 100644 --- a/tools/schemacode/bidsschematools/tests/test_make_testdata.py +++ b/tools/schemacode/bidsschematools/tests/test_make_testdata.py @@ -31,8 +31,8 @@ def test_make_archive(bids_examples, bids_error_examples): * Archives will be generated under `/tmp/bidsschematools-testdata-SCHEMA_VERSION.tar.gz` """ - target_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),"data","bundled")) - os.makedirs(target_dir, exist_ok = True) + target_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data", "bundled")) + os.makedirs(target_dir, exist_ok=True) shutil.copytree(bids_examples, f"{target_dir}/bids-examples") shutil.copytree(bids_error_examples, f"{target_dir}/bids-error-examples") From 61febefbacde0a7edca21dcf3d2dd3abd4dd7154 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 13:57:39 -0400 Subject: [PATCH 69/80] debug --- src/schema/SCHEMA_VERSION | 2 +- tools/schemacode/bidsschematools/tests/test_make_testdata.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index c21ca705c2..14507bb6d8 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661363484-dev +0.0.1661363859-dev diff --git a/tools/schemacode/bidsschematools/tests/test_make_testdata.py b/tools/schemacode/bidsschematools/tests/test_make_testdata.py index b9279024da..e9003ffaf2 100644 --- a/tools/schemacode/bidsschematools/tests/test_make_testdata.py +++ b/tools/schemacode/bidsschematools/tests/test_make_testdata.py @@ -35,6 +35,7 @@ def test_make_archive(bids_examples, bids_error_examples): os.makedirs(target_dir, exist_ok=True) shutil.copytree(bids_examples, f"{target_dir}/bids-examples") shutil.copytree(bids_error_examples, f"{target_dir}/bids-error-examples") + print("TEST DATA IS BEING MADE in f{target_dir}") # Keeping this for now, it would be really nice to have a separate archive someday. # archive_name = f"bidsschematools-testdata-{__version__}" From 9b17668b32bf9a234626fb294f4eaa6f3bb46186 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 14:01:54 -0400 Subject: [PATCH 70/80] black and isort fixes --- tools/schemacode/bidsschematools/tests/test_make_testdata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/schemacode/bidsschematools/tests/test_make_testdata.py b/tools/schemacode/bidsschematools/tests/test_make_testdata.py index e9003ffaf2..4a8a18bc9a 100644 --- a/tools/schemacode/bidsschematools/tests/test_make_testdata.py +++ b/tools/schemacode/bidsschematools/tests/test_make_testdata.py @@ -1,10 +1,11 @@ import os -import tarfile + +# import tarfile import shutil import pytest -from .. import __version__ +# from .. import __version__ def require_env(var): From 17a7d1d50f7316baf6c355f8595dfcffa37fcdec Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 14:02:01 -0400 Subject: [PATCH 71/80] debug --- .github/workflows/schemacode_ci.yml | 4 +++- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index cc077b1266..dcfdc0b22b 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -61,7 +61,9 @@ jobs: shell: bash {0} run: | echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - python -m pytest --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools + pushd tools/schemacode + python -m pytest -vvs --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools + popd ls -lah tree diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index 14507bb6d8..b8e1aa8bc7 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661363859-dev +0.0.1661364121-dev From 69af7a524ef2f9470b0f00632e859b36c6d9739a Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 14:11:35 -0400 Subject: [PATCH 72/80] debug --- src/schema/SCHEMA_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index b8e1aa8bc7..d91ae43b34 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661364121-dev +0.0.1661364695-dev From bf15f9dc0ee5d3d36947ea22f5a266366b731bd5 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 14:41:24 -0400 Subject: [PATCH 73/80] debug --- .github/workflows/schemacode_ci.yml | 9 +++++---- src/schema/SCHEMA_VERSION | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index dcfdc0b22b..8d1eff9a2d 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -60,19 +60,20 @@ jobs: - name: "Run tests" shell: bash {0} run: | - echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" + echo "Running test suite with BIDSSCHEMATOOLS_RELEASE set to $BIDSSCHEMATOOLS_RELEASE" + if [ -v BIDSSCHEMATOOLS_RELEASE ]; then + echo "This will save bundled data into test/data/bundled ." + fi pushd tools/schemacode python -m pytest -vvs --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools popd - ls -lah - tree - name: "Test upload" shell: bash {0} id: testpypi_upload run: | if [ -v BIDSSCHEMATOOLS_RELEASE ]; then - python -m pip install build twine wheel + python -m pip install --upgrade build twine wheel echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" pushd tools/schemacode python -m build diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index d91ae43b34..df8c6768ad 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661364695-dev +0.0.1661366484-dev From 9c7a8775385ea3d7965cfcee15966943117b9f03 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 24 Aug 2022 14:46:47 -0400 Subject: [PATCH 74/80] Reverted schema version and removed debugging print call. --- src/schema/SCHEMA_VERSION | 2 +- tools/schemacode/bidsschematools/tests/test_make_testdata.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/schema/SCHEMA_VERSION b/src/schema/SCHEMA_VERSION index df8c6768ad..25a5afd80b 100644 --- a/src/schema/SCHEMA_VERSION +++ b/src/schema/SCHEMA_VERSION @@ -1 +1 @@ -0.0.1661366484-dev +0.4.0-dev diff --git a/tools/schemacode/bidsschematools/tests/test_make_testdata.py b/tools/schemacode/bidsschematools/tests/test_make_testdata.py index 4a8a18bc9a..7cfc8136f2 100644 --- a/tools/schemacode/bidsschematools/tests/test_make_testdata.py +++ b/tools/schemacode/bidsschematools/tests/test_make_testdata.py @@ -36,7 +36,6 @@ def test_make_archive(bids_examples, bids_error_examples): os.makedirs(target_dir, exist_ok=True) shutil.copytree(bids_examples, f"{target_dir}/bids-examples") shutil.copytree(bids_error_examples, f"{target_dir}/bids-error-examples") - print("TEST DATA IS BEING MADE in f{target_dir}") # Keeping this for now, it would be really nice to have a separate archive someday. # archive_name = f"bidsschematools-testdata-{__version__}" From 084ade75006c3b19e2ea9f7aa7d15c662d450491 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Wed, 24 Aug 2022 22:54:19 -0400 Subject: [PATCH 75/80] RF: Use importlib-resources, reduce path depth TEST: Delay imports to avoid full installation --- .../bidsschematools/tests/conftest.py | 30 +++++++++++-------- .../bidsschematools/tests/data/__init__.py | 0 .../tests/test_make_testdata.py | 17 ++++++----- 3 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 tools/schemacode/bidsschematools/tests/data/__init__.py diff --git a/tools/schemacode/bidsschematools/tests/conftest.py b/tools/schemacode/bidsschematools/tests/conftest.py index 47898551f3..955e12c5dc 100644 --- a/tools/schemacode/bidsschematools/tests/conftest.py +++ b/tools/schemacode/bidsschematools/tests/conftest.py @@ -1,11 +1,13 @@ import logging -import os import tempfile from subprocess import run -import pytest +try: + from importlib.resources import as_file, files +except ImportError: # PY<3.9 + from importlib_resources import as_file, files -from bidsschematools import schema, utils +import pytest lgr = logging.getLogger() @@ -35,15 +37,14 @@ def get_gitrepo_fixture(url, whitelist): @pytest.fixture(scope="session") def fixture(): archive_name = url.rsplit("/", 1)[-1] - testdata_dir = os.path.join(os.path.dirname(__file__), "data", "bundled", archive_name) - testdata_dir = os.path.abspath(testdata_dir) - if os.path.isdir(testdata_dir): + testdata_dir = files("bidsschematools.tests.data") / archive_name + if testdata_dir.is_dir(): lgr.info( - "Found static testdata archive under `%s`. " - "Not downloading latest data from version control.", - testdata_dir, + f"Found static testdata archive under `{testdata_dir}`. " + "Not downloading latest data from version control." ) - yield testdata_dir + with as_file(testdata_dir) as path: + yield path else: lgr.info( "No static testdata available under `%s`. " @@ -51,7 +52,6 @@ def fixture(): testdata_dir, ) with tempfile.TemporaryDirectory() as path: - assert os.path.exists(path) lgr.debug("Cloning %r into %r", url, path) runout = run( [ @@ -80,14 +80,18 @@ def fixture(): @pytest.fixture(scope="session") def schema_dir(): """Path to the schema housed in the bids-specification repo.""" + from bidsschematools import utils + bids_schema = utils.get_schema_path() return bids_schema @pytest.fixture(scope="session") -def schema_obj(schema_dir): +def schema_obj(): """Schema object.""" - return schema.load_schema(schema_dir) + from bidsschematools import schema + + return schema.load_schema() bids_examples = get_gitrepo_fixture( diff --git a/tools/schemacode/bidsschematools/tests/data/__init__.py b/tools/schemacode/bidsschematools/tests/data/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/schemacode/bidsschematools/tests/test_make_testdata.py b/tools/schemacode/bidsschematools/tests/test_make_testdata.py index 7cfc8136f2..537ef6c07b 100644 --- a/tools/schemacode/bidsschematools/tests/test_make_testdata.py +++ b/tools/schemacode/bidsschematools/tests/test_make_testdata.py @@ -1,11 +1,12 @@ import os - -# import tarfile import shutil -import pytest +try: + from importlib.resources import files +except ImportError: # PY<3.9 + from importlib_resources import files -# from .. import __version__ +import pytest def require_env(var): @@ -32,10 +33,10 @@ def test_make_archive(bids_examples, bids_error_examples): * Archives will be generated under `/tmp/bidsschematools-testdata-SCHEMA_VERSION.tar.gz` """ - target_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data", "bundled")) - os.makedirs(target_dir, exist_ok=True) - shutil.copytree(bids_examples, f"{target_dir}/bids-examples") - shutil.copytree(bids_error_examples, f"{target_dir}/bids-error-examples") + testdata_dir = files("bidsschematools.tests.data") + ignore_git = shutil.ignore_patterns(".git*") + shutil.copytree(bids_examples, testdata_dir / "bids-examples", ignore=ignore_git) + shutil.copytree(bids_error_examples, testdata_dir / "bids-error-examples", ignore=ignore_git) # Keeping this for now, it would be really nice to have a separate archive someday. # archive_name = f"bidsschematools-testdata-{__version__}" From 1993e895242ad83ad38d720e98c386495a2b27d5 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Wed, 24 Aug 2022 22:55:00 -0400 Subject: [PATCH 76/80] CI: Add separate build and publish steps --- .github/workflows/schemacode_ci.yml | 124 ++++++++++++++++------------ 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 8d1eff9a2d..3bf0c21ffe 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -5,23 +5,49 @@ on: branches: - "master" - "autodata2" - paths: - - "tools/schemacode/**" - - "src/schema/**" tags: - "schema-*" pull_request: branches: - "*" - paths: - - "tools/schemacode/**" - - "src/schema/**" jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["ubuntu-latest"] + python-version: ["3.10"] + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: "Install build dependencies" + run: pip install --upgrade build twine + - name: "Install test dependencies on tag" + run: pip install --upgrade pytest pyyaml pandas tabulate + if: ${{ startsWith(github.ref, 'refs/tags/schema-') }} + - name: "Build archive on tag" + run: pytest tools/schemacode/bidsschematools -k make_archive + env: + BIDSSCHEMATOOLS_RELEASE: 1 + if: ${{ startsWith(github.ref, 'refs/tags/schema-') }} + - name: "Build source distribution and wheel" + run: python -m build tools/schemacode + - name: "Check distribution metadata" + run: twine check tools/schemacode/dist/* + - uses: actions/upload-artifact@v3 + with: + name: dist + path: tools/schemacode/dist/ - run_tests: - + test: runs-on: ${{ matrix.os }} + needs: [build] strategy: fail-fast: false matrix: @@ -43,54 +69,20 @@ jobs: shell: bash {0} run: python -c "import sys; print(sys.version)" - - name: "Set Release Variable based on tag" - shell: bash {0} - run: | - MY_TAG="$(git describe --tags)" - if [ "${MY_TAG:0:7}" = "schema-" ]; then - echo "BIDSSCHEMATOOLS_RELEASE=1" >> $GITHUB_ENV - fi + - name: "Fetch packages" + uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ - - name: "Install the schemacode package" - shell: bash {0} + - name: "Install package" run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install ./tools/schemacode[all] + pip install $( ls dist/*.whl )[all] - name: "Run tests" - shell: bash {0} - run: | - echo "Running test suite with BIDSSCHEMATOOLS_RELEASE set to $BIDSSCHEMATOOLS_RELEASE" - if [ -v BIDSSCHEMATOOLS_RELEASE ]; then - echo "This will save bundled data into test/data/bundled ." - fi - pushd tools/schemacode - python -m pytest -vvs --pyargs bidsschematools -m "not validate_schema" --cov-append --cov-report=xml --cov=bidsschematools - popd - - - name: "Test upload" - shell: bash {0} - id: testpypi_upload run: | - if [ -v BIDSSCHEMATOOLS_RELEASE ]; then - python -m pip install --upgrade build twine wheel - echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - pushd tools/schemacode - python -m build - twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} --repository testpypi dist/* - popd - fi - - - name: "Real upload" - shell: bash {0} - if: steps.testpypi_upload.outputs.exit_code == 0 - run: | - if [ -v BIDSSCHEMATOOLS_RELEASE ]; then - pushd tools/schemacode - echo "BIDSSCHEMATOOLS_RELEASE is set to $BIDSSCHEMATOOLS_RELEASE" - twine upload -u __token__ -p ${{secrets.BIDS_TOKEN_TEST}} dist/* - popd - fi + python -m pytest -vs --pyargs bidsschematools -m "not validate_schema" \ + --cov-append --cov-report=xml --cov=bidsschematools - name: Upload artifacts uses: actions/upload-artifact@v3 @@ -99,6 +91,34 @@ jobs: path: coverage.xml if: success() + publish: + runs-on: ${{ matrix.os }} + name: Publish Python Package + needs: [test] + strategy: + matrix: + os: ["ubuntu-latest"] + python-version: ["3.10"] + steps: + - name: "Fetch packages" + uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + - name: "Test PyPI upload" + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + skip_existing: true + - name: "Upload to PyPI (on tags)" + if: ${{ startsWith(github.ref, 'refs/tags/schema-') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + flake8-lint: runs-on: ubuntu-latest name: Lint schemacode @@ -153,7 +173,7 @@ jobs: upload_to_codecov: runs-on: "ubuntu-latest" name: Upload coverage - needs: [run_tests,validate_schema] + needs: [test,validate_schema] steps: - name: Checkout uses: actions/checkout@v2 From 593f047c21be568f6812135409298ca8941c2cbf Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Wed, 24 Aug 2022 23:41:09 -0400 Subject: [PATCH 77/80] CI: Set global default shell --- .github/workflows/schemacode_ci.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 3bf0c21ffe..8ff59d3bb7 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -11,6 +11,10 @@ on: branches: - "*" +defaults: + run: + shell: bash + jobs: build: runs-on: ${{ matrix.os }} @@ -18,9 +22,6 @@ jobs: matrix: os: ["ubuntu-latest"] python-version: ["3.10"] - defaults: - run: - shell: bash steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -54,9 +55,6 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.7", "3.8", "3.9", "3.10"] name: ${{ matrix.os }} with Python ${{ matrix.python-version }} - defaults: - run: - shell: bash steps: - uses: actions/checkout@v3 @@ -66,7 +64,6 @@ jobs: python-version: ${{ matrix.python-version }} - name: "Display Python version" - shell: bash {0} run: python -c "import sys; print(sys.version)" - name: "Fetch packages" @@ -132,14 +129,12 @@ jobs: python-version: "3.7" - name: Install the schemacode package - shell: bash {0} run: | python -m pip install --progress-bar off --upgrade pip setuptools wheel python -m pip install -e ./tools/schemacode[all] - name: Run flake8 working-directory: ./tools/schemacode/ - shell: bash {0} run: | flake8 . @@ -155,7 +150,6 @@ jobs: python-version: "3.9" - name: Install the schemacode package - shell: bash {0} run: | python -m pip install --progress-bar off --upgrade pip setuptools wheel python -m pip install -e ./tools/schemacode[all] From 4ad77daac6f94b5dd3bf7ad42eed62fe40e5c259 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Wed, 24 Aug 2022 23:52:10 -0400 Subject: [PATCH 78/80] STY: Prettier CI file --- .github/workflows/schemacode_ci.yml | 76 ++++++++++++++--------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 8ff59d3bb7..4f03517e42 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -19,14 +19,14 @@ jobs: build: runs-on: ${{ matrix.os }} strategy: - matrix: - os: ["ubuntu-latest"] - python-version: ["3.10"] + matrix: + os: ["ubuntu-latest"] + python-version: ["3.10"] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-version }} - name: "Install build dependencies" run: pip install --upgrade build twine - name: "Install test dependencies on tag" @@ -50,10 +50,10 @@ jobs: runs-on: ${{ matrix.os }} needs: [build] strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - python-version: ["3.7", "3.8", "3.9", "3.10"] + fail-fast: false + matrix: + os: ["ubuntu-latest"] + python-version: ["3.7", "3.8", "3.9", "3.10"] name: ${{ matrix.os }} with Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 @@ -61,7 +61,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-version }} - name: "Display Python version" run: python -c "import sys; print(sys.version)" @@ -93,9 +93,9 @@ jobs: name: Publish Python Package needs: [test] strategy: - matrix: - os: ["ubuntu-latest"] - python-version: ["3.10"] + matrix: + os: ["ubuntu-latest"] + python-version: ["3.10"] steps: - name: "Fetch packages" uses: actions/download-artifact@v3 @@ -142,40 +142,40 @@ jobs: runs-on: ubuntu-latest name: Validate schema steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Set Up Python environment - uses: actions/setup-python@v4 - with: - python-version: "3.9" + - name: Set Up Python environment + uses: actions/setup-python@v4 + with: + python-version: "3.9" - - name: Install the schemacode package - run: | - python -m pip install --progress-bar off --upgrade pip setuptools wheel - python -m pip install -e ./tools/schemacode[all] + - name: Install the schemacode package + run: | + python -m pip install --progress-bar off --upgrade pip setuptools wheel + python -m pip install -e ./tools/schemacode[all] - - name: Run schema validation tests - run: python -m pytest --pyargs bidsschematools -m "validate_schema" --cov-append --cov-report=xml --cov=bidsschematools + - name: Run schema validation tests + run: python -m pytest --pyargs bidsschematools -m "validate_schema" --cov-append --cov-report=xml --cov=bidsschematools - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: schema_validation - path: coverage.xml - if: success() + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: schema_validation + path: coverage.xml + if: success() upload_to_codecov: runs-on: "ubuntu-latest" name: Upload coverage - needs: [test,validate_schema] + needs: [test, validate_schema] steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v3 + - name: Download artifacts + uses: actions/download-artifact@v3 - - name: Upload to CodeCov - uses: codecov/codecov-action@v3 - with: - fail_ci_if_error: true + - name: Upload to CodeCov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true From b9e526f6711b4278ecbb84c6cf11e3c84e4b0dbe Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 25 Aug 2022 08:37:37 -0400 Subject: [PATCH 79/80] MNT: Update test_tag Run from anywhere, use meaningful commit/tag messages, do not push automatically --- scripts/test_tag | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/test_tag b/scripts/test_tag index 295f191854..f11ef697dd 100755 --- a/scripts/test_tag +++ b/scripts/test_tag @@ -1,23 +1,23 @@ #!/usr/bin/env bash -# Execute this script from its containing directory to push to a new unique testing tag. +# Execute this script from anywhere in the repository to push to a new unique testing tag. # This is a script which automates creation and pushing of unique tags for github actions. # It is particularly useful when debugging the upload hooks for pypi. # The workflow for that is to edit `.github/workflows/schemacode_ci.yml` and add a secondary branch name to the `on` section right after master. # This will allow you to keep pushing to the branch as if it were master and unix-time tagged archives being uploaded to test.pypi. -VERSION_FILE="src/schema/SCHEMA_VERSION" +EPOCH="$(date +%s)" -pushd .. - export MY_BIDS_DATE="$(date +%s)" - REAL_VERSION=$(cat "${VERSION_FILE}") - DUMMY_VERSION="0.0.${MY_BIDS_DATE}-dev" - echo "${DUMMY_VERSION}" > "${VERSION_FILE}" - git commit -a -m "debug" - git tag -a "schema-$DUMMY_VERSION" -m "debug" - git push origin - git push origin "schema-$DUMMY_VERSION" - echo "${REAL_VERSION}" > "${VERSION_FILE}" -popd -unset MY_BIDS_DATE +GIT_DIR=$( git rev-parse --git-dir ) +REPO_ROOT=$( ls -d ${GIT_DIR%.git} ) +VERSION_FILE="$REPO_ROOT/src/schema/SCHEMA_VERSION" + +REAL_VERSION=$(cat "${VERSION_FILE}") +DUMMY_VERSION="0.0.${EPOCH}-dev" + +echo "${DUMMY_VERSION}" > "${VERSION_FILE}" +git commit -a -m "Test release $DUMMY_VERSION" +git tag -a "schema-$DUMMY_VERSION" -m "Test release $DUMMY_VERSION" + +echo "${REAL_VERSION}" > "${VERSION_FILE}" From 2e55307eeaa8bafa41b75fc53e605e94abf6dcdc Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 25 Aug 2022 14:38:10 -0400 Subject: [PATCH 80/80] Update .github/workflows/schemacode_ci.yml --- .github/workflows/schemacode_ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml index 4f03517e42..596809d9e2 100644 --- a/.github/workflows/schemacode_ci.yml +++ b/.github/workflows/schemacode_ci.yml @@ -4,7 +4,6 @@ on: push: branches: - "master" - - "autodata2" tags: - "schema-*" pull_request: