diff --git a/.github/actions/install-main-dependencies/action.yml b/.github/actions/install-main-dependencies/action.yml index 45302c6..d25bbda 100644 --- a/.github/actions/install-main-dependencies/action.yml +++ b/.github/actions/install-main-dependencies/action.yml @@ -22,6 +22,9 @@ inputs: terra-main: description: 'Use Terra main' required: true + nature-main: + description: 'Use Nature main' + required: true runs: using: "composite" steps: @@ -87,32 +90,37 @@ runs: shell: bash - name: Install Nature from Main run: | - echo 'Install Nature from Main' - BASE_DIR=nature-cache - build_from_main=true - cache_hit=${{ steps.nature-cache.outputs.cache-hit }} - echo "cache hit: ${cache_hit}" - if [ "$cache_hit" == "true" ]; then - pip_result=0 - pushd "${BASE_DIR}" - python -m pip install *.whl && pip_result=$? || pip_result=$? - popd - if [ $pip_result == 0 ]; then - build_from_main=false + if [ "${{ inputs.nature-main }}" == "true" ]; then + echo 'Install Nature from Main' + BASE_DIR=nature-cache + build_from_main=true + cache_hit=${{ steps.nature-cache.outputs.cache-hit }} + echo "cache hit: ${cache_hit}" + if [ "$cache_hit" == "true" ]; then + pip_result=0 + pushd "${BASE_DIR}" + python -m pip install *.whl && pip_result=$? || pip_result=$? + popd + if [ $pip_result == 0 ]; then + build_from_main=false + fi + else + mkdir -p ${BASE_DIR} + fi + if [ "$build_from_main" == "true" ]; then + echo 'Create wheel file from main' + pip install -U wheel + git clone --depth 1 --branch main https://github.com/Qiskit/qiskit-nature.git /tmp/qiskit-nature + pushd /tmp/qiskit-nature + python setup.py bdist_wheel + popd + cp -rf /tmp/qiskit-nature/dist/*.whl "${BASE_DIR}" + pushd "${BASE_DIR}" + python -m pip install *.whl + popd fi else - mkdir -p ${BASE_DIR} - fi - if [ "$build_from_main" == "true" ]; then - echo 'Create wheel file from main' - pip install -U wheel - git clone --depth 1 --branch main https://github.com/Qiskit/qiskit-nature.git /tmp/qiskit-nature - pushd /tmp/qiskit-nature - python setup.py bdist_wheel - popd - cp -rf /tmp/qiskit-nature/dist/*.whl "${BASE_DIR}" - pushd "${BASE_DIR}" - python -m pip install *.whl - popd + echo 'Install Nature from Stable' + pip install -U qiskit-nature fi shell: bash diff --git a/.github/actions/install-nature-pyscf/action.yml b/.github/actions/install-nature-pyscf/action.yml index f615b05..6ef4000 100644 --- a/.github/actions/install-nature-pyscf/action.yml +++ b/.github/actions/install-nature-pyscf/action.yml @@ -18,9 +18,8 @@ inputs: required: true runs: using: "composite" - steps: + steps: - run : | + pip install -U -c constraints.txt -r requirements-dev.txt -r requirements.txt pip install -e . - pip install qiskit-nature[pyscf,mpl,sparse] - pip install -U -c constraints.txt -r requirements-dev.txt shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a8b495..ef5c306 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -135,6 +135,7 @@ jobs: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} terra-main: "false" + nature-main: "false" if: ${{ !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} - uses: ./.github/actions/install-nature-pyscf with: diff --git a/constraints.txt b/constraints.txt index 8448ac4..a63ac66 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,3 +1,4 @@ astroid==2.5.6 pylint==2.8.3 numpy>=1.20.0 +rustworkx!=0.13.0;python_version<"3.8"