From 529f8d88f51e140b2be040feacb5e8f7f4bf1def Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 00:15:53 -0500 Subject: [PATCH 01/27] first stab at qcsk/qcel diff --- .github/workflows/QCSchema.yml | 68 ++++++++++++++++++++++++++++++++++ Makefile | 5 +++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/QCSchema.yml diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml new file mode 100644 index 00000000..e0b2994c --- /dev/null +++ b/.github/workflows/QCSchema.yml @@ -0,0 +1,68 @@ +name: QCSchema + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + conda-env: [base] + python-version: [3.7] + env: + PYVER: ${{ matrix.python-version }} + CONDA_ENV: ${{ matrix.conda-env }} + + steps: + - uses: actions/checkout@v1 + + - name: Python Setup + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Create Environment + shell: bash + run: | + eval "$(conda shell.bash hook)" && conda activate + python devtools/scripts/create_conda_env.py -n=test -p=$PYVER devtools/conda-envs/$CONDA_ENV.yaml + + - name: Install + shell: bash + run: | + eval "$(conda shell.bash hook)" && conda activate test + python -m pip install . --no-deps + + - name: Environment Information + shell: bash + run: | + eval "$(conda shell.bash hook)" && conda activate test + conda list --show-channel-urls + + - name: QCSchema + shell: bash + run: | + eval "$(conda shell.bash hook)" && conda activate test + make qcschema + cd .. + git clone https://github.com/loriab/QCSchema.git + cd QCSchema + git checkout py2json + cd qcschema_json + ls -l + pwd + cp -p ../../qcschema/* . + git diff + +# - name: CodeCov +# uses: codecov/codecov-action@v1 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: ./coverage.xml +# flags: unittests +# yml: ./.codecov.yml +# + +##### +# pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") +##### diff --git a/Makefile b/Makefile index 2bcb96c1..6bfdd33c 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,11 @@ data: cpu_data cpu_data: (cd raw_data/cpu_data; python build_cpu_data.py; mv cpu_data_blob.py ../../qcelemental/info/data/) +.PHONY: qcschema +qcschema: #install + mkdir -p qcschema + echo -e "import qcelemental as qcel\nfrom pathlib import Path\nfor md in [qcel.models.Provenance, qcel.models.AtomicResultProperties]:\n\tmfile = (Path('qcschema') / md.__name__).with_suffix('.json')\n\twith open(mfile, 'w') as fp:\n\t\tfp.write(md.schema_json(indent=4))" | python + .PHONY: clean clean: rm -rf `find . -name __pycache__` From 85b598de377509e45d726b0d1fd695089f6c6158 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 00:26:10 -0500 Subject: [PATCH 02/27] alt py cmd? --- .github/workflows/QCSchema.yml | 1 + Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index e0b2994c..23950d5b 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -38,6 +38,7 @@ jobs: run: | eval "$(conda shell.bash hook)" && conda activate test conda list --show-channel-urls + pwd - name: QCSchema shell: bash diff --git a/Makefile b/Makefile index 6bfdd33c..3b1844ce 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ cpu_data: .PHONY: qcschema qcschema: #install mkdir -p qcschema - echo -e "import qcelemental as qcel\nfrom pathlib import Path\nfor md in [qcel.models.Provenance, qcel.models.AtomicResultProperties]:\n\tmfile = (Path('qcschema') / md.__name__).with_suffix('.json')\n\twith open(mfile, 'w') as fp:\n\t\tfp.write(md.schema_json(indent=4))" | python + python -c "exec(\"import qcelemental as qcel\nfrom pathlib import Path\nfor md in [qcel.models.Provenance, qcel.models.AtomicResultProperties]:\n\tmfile = (Path('qcschema') / md.__name__).with_suffix('.json')\n\twith open(mfile, 'w') as fp:\n\t\tfp.write(md.schema_json(indent=4))\")" .PHONY: clean clean: From 8bb43a07358ec71218419183e8f4d85a1ea0ffb8 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 00:31:53 -0500 Subject: [PATCH 03/27] count directories --- .github/workflows/QCSchema.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 23950d5b..9007ff9e 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -45,6 +45,7 @@ jobs: run: | eval "$(conda shell.bash hook)" && conda activate test make qcschema + ls -l qcschema cd .. git clone https://github.com/loriab/QCSchema.git cd QCSchema @@ -52,7 +53,7 @@ jobs: cd qcschema_json ls -l pwd - cp -p ../../qcschema/* . + cp -p ../../QCElemental/qcschema/* . git diff # - name: CodeCov From adb33d2c393ce9bd39a6f15c35ddf4b2cbb34730 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 09:42:30 -0500 Subject: [PATCH 04/27] more actions --- .github/workflows/QCSchema.yml | 33 +++++++++++++++++++++++------ qcelemental/models/common_models.py | 2 +- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 9007ff9e..0bb02954 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -14,7 +14,19 @@ jobs: CONDA_ENV: ${{ matrix.conda-env }} steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + with: + path: qcel + + - name: Checkout schema repo + uses: actions/checkout@v2 + with: + repository: loriab/QCSchema + #repository: MolSSI/QCSchema + path: qcsk + ref: py2json + #ref: master - name: Python Setup uses: actions/setup-python@v1 @@ -39,23 +51,32 @@ jobs: eval "$(conda shell.bash hook)" && conda activate test conda list --show-channel-urls pwd + ls -l - name: QCSchema shell: bash run: | eval "$(conda shell.bash hook)" && conda activate test + pwd + ls -l + cd qcel make qcschema ls -l qcschema cd .. - git clone https://github.com/loriab/QCSchema.git - cd QCSchema - git checkout py2json - cd qcschema_json + #git clone https://github.com/loriab/QCSchema.git + #cd QCSchema + #git checkout py2json + #cd qcschema_json + #ls -l + #pwd + #cp -p ../../QCElemental/qcschema/* . + #git diff + cd qcsk ls -l - pwd cp -p ../../QCElemental/qcschema/* . git diff + # - name: CodeCov # uses: codecov/codecov-action@v1 # with: diff --git a/qcelemental/models/common_models.py b/qcelemental/models/common_models.py index 8c29df68..ad475409 100644 --- a/qcelemental/models/common_models.py +++ b/qcelemental/models/common_models.py @@ -20,7 +20,7 @@ class Provenance(ProtoModel): """ creator: str = Field(..., description="The creator of the object.") - version: Optional[str] = Field(None, description="The version of the creator.") + version: Optional[str] = Field(None, description="The version of the creator, which should be sortable by the very broad [PEP 440](https://www.python.org/dev/peps/pep-0440/).") routine: Optional[str] = Field(None, description="The routine of the creator.") class Config(ProtoModel.Config): From ee4d1864898fe241afcb301b23981c99bf8ba3a6 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 09:49:05 -0500 Subject: [PATCH 05/27] working-dir --- .github/workflows/QCSchema.yml | 2 ++ qcelemental/models/common_models.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 0bb02954..3a71a719 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -35,12 +35,14 @@ jobs: - name: Create Environment shell: bash + working-directory: ./qcel run: | eval "$(conda shell.bash hook)" && conda activate python devtools/scripts/create_conda_env.py -n=test -p=$PYVER devtools/conda-envs/$CONDA_ENV.yaml - name: Install shell: bash + working-directory: ./qcel run: | eval "$(conda shell.bash hook)" && conda activate test python -m pip install . --no-deps diff --git a/qcelemental/models/common_models.py b/qcelemental/models/common_models.py index ad475409..d52d8347 100644 --- a/qcelemental/models/common_models.py +++ b/qcelemental/models/common_models.py @@ -20,7 +20,10 @@ class Provenance(ProtoModel): """ creator: str = Field(..., description="The creator of the object.") - version: Optional[str] = Field(None, description="The version of the creator, which should be sortable by the very broad [PEP 440](https://www.python.org/dev/peps/pep-0440/).") + version: Optional[str] = Field( + None, + description="The version of the creator, which should be sortable by the very broad [PEP 440](https://www.python.org/dev/peps/pep-0440/).", + ) routine: Optional[str] = Field(None, description="The routine of the creator.") class Config(ProtoModel.Config): From 2e849211eb70d085c648569bc7130088f0ac5947 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 10:00:46 -0500 Subject: [PATCH 06/27] chdir --- .github/workflows/QCSchema.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 3a71a719..82645a85 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -64,7 +64,6 @@ jobs: cd qcel make qcschema ls -l qcschema - cd .. #git clone https://github.com/loriab/QCSchema.git #cd QCSchema #git checkout py2json @@ -73,10 +72,12 @@ jobs: #pwd #cp -p ../../QCElemental/qcschema/* . #git diff - cd qcsk + cd ../qcsk/qcschema_json ls -l - cp -p ../../QCElemental/qcschema/* . + cp -p ../../qcel/qcschema/* . git diff + # Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema, + # rather than the python module of the current repo # - name: CodeCov From 7f7167d3d55168d821a45c964c5691e1798f49b1 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 10:21:32 -0500 Subject: [PATCH 07/27] get PR number --- .github/workflows/QCSchema.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 82645a85..92392468 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -52,33 +52,30 @@ jobs: run: | eval "$(conda shell.bash hook)" && conda activate test conda list --show-channel-urls - pwd - ls -l - - name: QCSchema + - name: QCSchema from QCElemental shell: bash + working-directory: ./qcel run: | eval "$(conda shell.bash hook)" && conda activate test - pwd - ls -l - cd qcel + #cd qcel make qcschema ls -l qcschema - #git clone https://github.com/loriab/QCSchema.git - #cd QCSchema - #git checkout py2json - #cd qcschema_json - #ls -l - #pwd - #cp -p ../../QCElemental/qcschema/* . + cp -p qcschema/* ../qcsk/qcschema_json/ + #cd ../qcsk/qcschema_json + #cp -p ../../qcel/qcschema/* . #git diff - cd ../qcsk/qcschema_json - ls -l - cp -p ../../qcel/qcschema/* . - git diff # Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema, # rather than the python module of the current repo + - name ASDF + shell: bash + working-directory: ./qcsk + run: | + git diff + echo ${GITHUB_REF} + pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + echo ${pull_number} # - name: CodeCov # uses: codecov/codecov-action@v1 From 8057b3116f882986449d31dce5823590a23761c7 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 10:24:19 -0500 Subject: [PATCH 08/27] colon --- .github/workflows/QCSchema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 92392468..16c7a2c3 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -68,7 +68,7 @@ jobs: # Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema, # rather than the python module of the current repo - - name ASDF + - name: ASDF shell: bash working-directory: ./qcsk run: | From 6ea4b0e89dbec390477fdfe9dfc8c1bded6f8c2b Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 10:43:29 -0500 Subject: [PATCH 09/27] try a branch --- .github/workflows/QCSchema.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 16c7a2c3..5836bf1f 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -58,13 +58,9 @@ jobs: working-directory: ./qcel run: | eval "$(conda shell.bash hook)" && conda activate test - #cd qcel make qcschema ls -l qcschema cp -p qcschema/* ../qcsk/qcschema_json/ - #cd ../qcsk/qcschema_json - #cp -p ../../qcel/qcschema/* . - #git diff # Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema, # rather than the python module of the current repo @@ -72,10 +68,15 @@ jobs: shell: bash working-directory: ./qcsk run: | - git diff - echo ${GITHUB_REF} + git diff --color-words pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") echo ${pull_number} + branch=qcel-${pull_number} + echo ${branch} + git checkout -b ${branch} + git add -A + git commit -m "auto-generated from QCElemental" + git push origin ${branch} # - name: CodeCov # uses: codecov/codecov-action@v1 From 7565064bb0253bdbec461ba696e7a59db0a80f30 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 28 Jan 2020 10:48:34 -0500 Subject: [PATCH 10/27] name --- .github/workflows/QCSchema.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 5836bf1f..ccbf62be 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -74,6 +74,9 @@ jobs: branch=qcel-${pull_number} echo ${branch} git checkout -b ${branch} + git remote -v + git config --global user.email "lori.burns@gmail.com" + git config --global user.name "Lori A. Burns" git add -A git commit -m "auto-generated from QCElemental" git push origin ${branch} From b77a42c4b275c177c2c0fb64e676c13bb3077e36 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Sun, 9 Feb 2020 00:25:17 -0500 Subject: [PATCH 11/27] cleanup --- .github/workflows/QCSchema.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index ccbf62be..274a1827 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -1,6 +1,6 @@ name: QCSchema -on: [push, pull_request] +on: [pull_request] jobs: build: @@ -70,9 +70,7 @@ jobs: run: | git diff --color-words pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") - echo ${pull_number} branch=qcel-${pull_number} - echo ${branch} git checkout -b ${branch} git remote -v git config --global user.email "lori.burns@gmail.com" @@ -81,15 +79,3 @@ jobs: git commit -m "auto-generated from QCElemental" git push origin ${branch} -# - name: CodeCov -# uses: codecov/codecov-action@v1 -# with: -# token: ${{ secrets.CODECOV_TOKEN }} -# file: ./coverage.xml -# flags: unittests -# yml: ./.codecov.yml -# - -##### -# pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") -##### From b7334b89ea97dfaa552793940592a4ce59b677ba Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 12:22:47 -0500 Subject: [PATCH 12/27] try a helper action --- .github/workflows/QCSchema.yml | 35 +++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 274a1827..ac69dbae 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -77,5 +77,38 @@ jobs: git config --global user.name "Lori A. Burns" git add -A git commit -m "auto-generated from QCElemental" - git push origin ${branch} +# git push origin ${branch} + - name: Push changes + uses: ad-m/github-push-action@master + with: + directory: ./qcsk + repository: https://github.com/loriab/QCSchema.git + branch: ${branch} + github_token: ${{ secrets.GITHUB_TOKEN }} + +#github_token string Token for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }}. +#branch string 'master' Destination branch to push changes. +#force boolean false Determines if force push is used. +#tags boolean false Determines if --tags is used. +#directory string '.' Directory to change to before pushing. +#repository string '' Repository name. Default or empty repository name represents current github repository. If you want to push to other repository, you should make a personal access token and use it as the github_token input. + + +#jobs: +# build: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@master +# - name: Create local changes +# run: | +# ... +# - name: Commit files +# run: | +# git config --local user.email "action@github.com" +# git config --local user.name "GitHub Action" +# git commit -m "Add changes" -a +# - name: Push changes +# uses: ad-m/github-push-action@master +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} From 08a657daab934bca127b2e680b0934d2620a52fb Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 12:33:36 -0500 Subject: [PATCH 13/27] repo name --- .github/workflows/QCSchema.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index ac69dbae..e4ad35d7 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -83,10 +83,16 @@ jobs: uses: ad-m/github-push-action@master with: directory: ./qcsk - repository: https://github.com/loriab/QCSchema.git - branch: ${branch} + repository: loriab/QCSchema +# branch: ${branch} + branch: "qcel-204" github_token: ${{ secrets.GITHUB_TOKEN }} + +#Push to branch ${branch} +#remote: Not Found +#fatal: repository 'https://github.com/https://github.com/loriab/QCSchema.git.git/' not found + #github_token string Token for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }}. #branch string 'master' Destination branch to push changes. #force boolean false Determines if force push is used. From e64c8a830dc60fdc665c8ae18c6f6dab7934a695 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 13:01:10 -0500 Subject: [PATCH 14/27] token --- .github/workflows/QCSchema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index e4ad35d7..41e5c34a 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -86,7 +86,7 @@ jobs: repository: loriab/QCSchema # branch: ${branch} branch: "qcel-204" - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.QCSK_TOKEN }} #Push to branch ${branch} From 49dde7c2b55e0fe2f031e599bcfec259934e733d Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 13:15:35 -0500 Subject: [PATCH 15/27] persist --- .github/workflows/QCSchema.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 41e5c34a..e7804c4a 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -27,6 +27,8 @@ jobs: path: qcsk ref: py2json #ref: master + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - name: Python Setup uses: actions/setup-python@v1 From 51082f429c9b1ef39acc2645ea90f398a1c4847d Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 15:20:53 -0500 Subject: [PATCH 16/27] old way --- .github/workflows/QCSchema.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index e7804c4a..cf63dcae 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -79,17 +79,20 @@ jobs: git config --global user.name "Lori A. Burns" git add -A git commit -m "auto-generated from QCElemental" -# git push origin ${branch} + git push origin ${branch} - - name: Push changes - uses: ad-m/github-push-action@master - with: - directory: ./qcsk - repository: loriab/QCSchema -# branch: ${branch} - branch: "qcel-204" - github_token: ${{ secrets.QCSK_TOKEN }} + #- name: Push changes + # uses: ad-m/github-push-action@master + # with: + # directory: ./qcsk + # repository: loriab/QCSchema +# # branch: ${branch} + # branch: "qcel-204" + # github_token: ${{ secrets.QCSK_TOKEN }} + +#remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git" +#git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS; #Push to branch ${branch} #remote: Not Found From 17866b310015e8997448ad6b7bb790f9ee2cab18 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 17:25:01 -0500 Subject: [PATCH 17/27] checkout v1 --- .github/workflows/QCSchema.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index cf63dcae..db79b55f 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -15,12 +15,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + #uses: actions/checkout@v2 + uses: actions/checkout@v1 with: path: qcel - name: Checkout schema repo - uses: actions/checkout@v2 + #uses: actions/checkout@v2 + uses: actions/checkout@v1 with: repository: loriab/QCSchema #repository: MolSSI/QCSchema @@ -79,16 +81,25 @@ jobs: git config --global user.name "Lori A. Burns" git add -A git commit -m "auto-generated from QCElemental" - git push origin ${branch} +# git push origin ${branch} - #- name: Push changes - # uses: ad-m/github-push-action@master - # with: - # directory: ./qcsk - # repository: loriab/QCSchema + - name: Push changes + uses: ad-m/github-push-action@master + with: + directory: ./qcsk + repository: loriab/QCSchema # # branch: ${branch} - # branch: "qcel-204" - # github_token: ${{ secrets.QCSK_TOKEN }} + branch: "qcel-204" + github_token: ${{ secrets.QCSK_TOKEN }} + + +# git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" +#git pull github ${GITHUB_REF} --ff-only +# +#git add ... +# +#git commit -m "Update native model" +#git push github HEAD:${GITHUB_REF} #remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git" From a38f8cabe4c541b8f30ca1be853c9e2a9679e1c1 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 17:30:48 -0500 Subject: [PATCH 18/27] v1v2 --- .github/workflows/QCSchema.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index db79b55f..4a690b0a 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -15,8 +15,7 @@ jobs: steps: - name: Checkout - #uses: actions/checkout@v2 - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: path: qcel From 5307ec6f18d84919f29533c323f18281cad5357e Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 17:45:12 -0500 Subject: [PATCH 19/27] alt token --- .github/workflows/QCSchema.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 4a690b0a..f369cc23 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -20,16 +20,16 @@ jobs: path: qcel - name: Checkout schema repo - #uses: actions/checkout@v2 - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: repository: loriab/QCSchema #repository: MolSSI/QCSchema path: qcsk ref: py2json #ref: master - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token - fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + #persist-credentials: false + fetch-depth: 0 + token: ${{ secrets.QCSK_TOKEN }} - name: Python Setup uses: actions/setup-python@v1 From 6f1e94575a13a2e76f0742e805d4bcad9b106dae Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 2 Mar 2020 18:37:03 -0500 Subject: [PATCH 20/27] from branch --- .github/workflows/QCSchema.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index f369cc23..beb189bd 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -1,6 +1,6 @@ name: QCSchema -on: [pull_request] +on: [push, pull_request] jobs: build: @@ -27,9 +27,9 @@ jobs: path: qcsk ref: py2json #ref: master - #persist-credentials: false + persist-credentials: false fetch-depth: 0 - token: ${{ secrets.QCSK_TOKEN }} + #token: ${{ secrets.QCSK_TOKEN }} - name: Python Setup uses: actions/setup-python@v1 @@ -67,7 +67,7 @@ jobs: # Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema, # rather than the python module of the current repo - - name: ASDF + - name: Generated vs. Stable shell: bash working-directory: ./qcsk run: | From 28308c1e188d734af1c9635f5dcbf4fe3ead19fb Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 3 Mar 2020 03:23:46 -0500 Subject: [PATCH 21/27] var branch --- .github/workflows/QCSchema.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index beb189bd..13cafd4c 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -80,18 +80,22 @@ jobs: git config --global user.name "Lori A. Burns" git add -A git commit -m "auto-generated from QCElemental" -# git push origin ${branch} + ::set-env name=branch::${branch} - name: Push changes uses: ad-m/github-push-action@master with: directory: ./qcsk repository: loriab/QCSchema -# # branch: ${branch} - branch: "qcel-204" + branch: ${branch} + #branch: "qcel-204" github_token: ${{ secrets.QCSK_TOKEN }} +#echo "::set-env name=action_state::yellow" + + + # git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" #git pull github ${GITHUB_REF} --ff-only # From 70aff33b7365b1bcb449fd95c331c4a7e7eca561 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 3 Mar 2020 03:32:20 -0500 Subject: [PATCH 22/27] echo? --- .github/workflows/QCSchema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 13cafd4c..016ee2c8 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -80,7 +80,7 @@ jobs: git config --global user.name "Lori A. Burns" git add -A git commit -m "auto-generated from QCElemental" - ::set-env name=branch::${branch} + echo "::set-env name=branch::${branch}" - name: Push changes uses: ad-m/github-push-action@master From f55fe47c7dde398852e0e8f797ab1c4a9c9770b1 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 3 Mar 2020 03:44:06 -0500 Subject: [PATCH 23/27] alt access --- .github/workflows/QCSchema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 016ee2c8..a2febcaf 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -87,7 +87,7 @@ jobs: with: directory: ./qcsk repository: loriab/QCSchema - branch: ${branch} + branch: ${{ env.branch }} #branch: "qcel-204" github_token: ${{ secrets.QCSK_TOKEN }} From a54187ff9173f87a0109a51ddf8be510ef71f6e1 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 3 Mar 2020 03:49:11 -0500 Subject: [PATCH 24/27] pr only --- .github/workflows/QCSchema.yml | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index a2febcaf..127643c0 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -1,6 +1,6 @@ name: QCSchema -on: [push, pull_request] +on: [pull_request] jobs: build: @@ -29,7 +29,6 @@ jobs: #ref: master persist-credentials: false fetch-depth: 0 - #token: ${{ secrets.QCSK_TOKEN }} - name: Python Setup uses: actions/setup-python@v1 @@ -76,8 +75,8 @@ jobs: branch=qcel-${pull_number} git checkout -b ${branch} git remote -v - git config --global user.email "lori.burns@gmail.com" - git config --global user.name "Lori A. Burns" + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" git add -A git commit -m "auto-generated from QCElemental" echo "::set-env name=branch::${branch}" @@ -88,36 +87,9 @@ jobs: directory: ./qcsk repository: loriab/QCSchema branch: ${{ env.branch }} - #branch: "qcel-204" github_token: ${{ secrets.QCSK_TOKEN }} -#echo "::set-env name=action_state::yellow" - - - -# git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" -#git pull github ${GITHUB_REF} --ff-only -# -#git add ... -# -#git commit -m "Update native model" -#git push github HEAD:${GITHUB_REF} - -#remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git" - -#git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS; - -#Push to branch ${branch} -#remote: Not Found -#fatal: repository 'https://github.com/https://github.com/loriab/QCSchema.git.git/' not found - -#github_token string Token for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }}. -#branch string 'master' Destination branch to push changes. -#force boolean false Determines if force push is used. -#tags boolean false Determines if --tags is used. -#directory string '.' Directory to change to before pushing. -#repository string '' Repository name. Default or empty repository name represents current github repository. If you want to push to other repository, you should make a personal access token and use it as the github_token input. #jobs: From ee17d50074b41e8a4c8ef34f8a55b09d61fe71c7 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 3 Mar 2020 11:55:56 -0500 Subject: [PATCH 25/27] define qcsk models --- Makefile | 2 +- qcelemental/models/__init__.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3b1844ce..a60f7740 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ cpu_data: .PHONY: qcschema qcschema: #install mkdir -p qcschema - python -c "exec(\"import qcelemental as qcel\nfrom pathlib import Path\nfor md in [qcel.models.Provenance, qcel.models.AtomicResultProperties]:\n\tmfile = (Path('qcschema') / md.__name__).with_suffix('.json')\n\twith open(mfile, 'w') as fp:\n\t\tfp.write(md.schema_json(indent=4))\")" + python -c "exec(\"import qcelemental as qcel\nfrom pathlib import Path\nfor md in qcel.models.qcschema_models():\n\tmfile = (Path('qcschema') / md.__name__).with_suffix('.json')\n\twith open(mfile, 'w') as fp:\n\t\tfp.write(md.schema_json(indent=4))\")" .PHONY: clean clean: diff --git a/qcelemental/models/__init__.py b/qcelemental/models/__init__.py index f2c6102c..82d12853 100644 --- a/qcelemental/models/__init__.py +++ b/qcelemental/models/__init__.py @@ -14,3 +14,19 @@ from .molecule import Molecule from .procedures import Optimization, OptimizationInput, OptimizationResult from .results import AtomicInput, AtomicResult, AtomicResultProperties, Result, ResultInput, ResultProperties + + +def qcschema_models(): + return [ + AtomicInput, + AtomicResult, + AtomicResultProperties, + basis.BasisCenter, + BasisSet, + basis.ElectronShell, + basis.ECPPotential, + common_models.Model, + Molecule, + Provenance, + results.WavefunctionProperties, + ] From 3191b444ed2e372b77cff7fd9babe9a3be5996d9 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 3 Mar 2020 12:00:33 -0500 Subject: [PATCH 26/27] clean gha --- .github/workflows/QCSchema.yml | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 127643c0..0c9c21ca 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -66,7 +66,7 @@ jobs: # Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema, # rather than the python module of the current repo - - name: Generated vs. Stable + - name: Compare Schemas (generated vs. community) shell: bash working-directory: ./qcsk run: | @@ -79,33 +79,13 @@ jobs: git config --local user.name "GitHub Action" git add -A git commit -m "auto-generated from QCElemental" - echo "::set-env name=branch::${branch}" + echo "::set-env name=prbranch::${branch}" - - name: Push changes + - name: Propose changes uses: ad-m/github-push-action@master with: directory: ./qcsk repository: loriab/QCSchema - branch: ${{ env.branch }} + #repository: MolSSI/QCSchema + branch: ${{ env.prbranch }} github_token: ${{ secrets.QCSK_TOKEN }} - - - - -#jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@master -# - name: Create local changes -# run: | -# ... -# - name: Commit files -# run: | -# git config --local user.email "action@github.com" -# git config --local user.name "GitHub Action" -# git commit -m "Add changes" -a -# - name: Push changes -# uses: ad-m/github-push-action@master -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} From 4472e9f01ac9c444f60e1bdd371f8301765905d0 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 3 Mar 2020 16:46:18 -0500 Subject: [PATCH 27/27] adapt to more schema --- .github/workflows/QCSchema.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/QCSchema.yml b/.github/workflows/QCSchema.yml index 0c9c21ca..43405708 100644 --- a/.github/workflows/QCSchema.yml +++ b/.github/workflows/QCSchema.yml @@ -25,7 +25,8 @@ jobs: repository: loriab/QCSchema #repository: MolSSI/QCSchema path: qcsk - ref: py2json + #ref: py2json + ref: json_files #ref: master persist-credentials: false fetch-depth: 0 @@ -62,7 +63,8 @@ jobs: eval "$(conda shell.bash hook)" && conda activate test make qcschema ls -l qcschema - cp -p qcschema/* ../qcsk/qcschema_json/ + #cp -p qcschema/* ../qcsk/qcschema_json/ + cp -p qcschema/* ../qcsk/qcschema/ # Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema, # rather than the python module of the current repo @@ -89,3 +91,4 @@ jobs: #repository: MolSSI/QCSchema branch: ${{ env.prbranch }} github_token: ${{ secrets.QCSK_TOKEN }} + force: true