diff --git a/Makefile b/Makefile index 64c56fd..70469ff 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2021-2022 Zapata Computing Inc. +################################################################################ include subtrees/z_quantum_actions/Makefile github_actions: @@ -5,3 +8,7 @@ github_actions: ${VENV}/bin/python3 -m pip install --upgrade pip && \ ${VENV}/bin/python3 -m pip install ./z-quantum-core && \ ${VENV}/bin/python3 -m pip install -e '.[develop]' + + +build-system-deps: + $(PYTHON) -m pip install setuptools wheel "setuptools_scm>=6.0" diff --git a/setup.py b/setup.py index c55e299..c6e3cd6 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2021-2022 Zapata Computing Inc. +################################################################################ import site import sys import warnings diff --git a/src/python/zquantum/solid_state/fermi_hubbard.py b/src/python/zquantum/solid_state/fermi_hubbard.py index eb0b0ba..969bb3b 100644 --- a/src/python/zquantum/solid_state/fermi_hubbard.py +++ b/src/python/zquantum/solid_state/fermi_hubbard.py @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2020-2022 Zapata Computing Inc. +################################################################################ import numpy as np import scipy import scipy.integrate as integrate diff --git a/src/python/zquantum/solid_state/generate_hamiltonians.py b/src/python/zquantum/solid_state/generate_hamiltonians.py index 541dd0a..ee977c6 100644 --- a/src/python/zquantum/solid_state/generate_hamiltonians.py +++ b/src/python/zquantum/solid_state/generate_hamiltonians.py @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2020-2022 Zapata Computing Inc. +################################################################################ """Module to generate 1D FHM Hamiltonians at half-filling.""" import numpy as np diff --git a/steps/fermi_hubbard_model.py b/steps/fermi_hubbard_model.py index 4194e64..c1a5484 100644 --- a/steps/fermi_hubbard_model.py +++ b/steps/fermi_hubbard_model.py @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2020-2021 Zapata Computing Inc. +################################################################################ from typing import Optional from zquantum.core.openfermion import save_interaction_operator diff --git a/subtrees/z_quantum_actions/Makefile b/subtrees/z_quantum_actions/Makefile index 0f606cd..d23a543 100644 --- a/subtrees/z_quantum_actions/Makefile +++ b/subtrees/z_quantum_actions/Makefile @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2021-2022 Zapata Computing Inc. +################################################################################ TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) include $(TOP_DIR)/variables.mk @@ -82,6 +85,9 @@ style-default: flake8 mypy black isort muster-default: style coverage @echo This project passes muster! +build-system-deps-default: + : + # This is what converts the -default targets into base target names. # Do not remove!!! %: %-default diff --git a/subtrees/z_quantum_actions/actions/publish-release/action.yml b/subtrees/z_quantum_actions/actions/publish-release/action.yml index 1d88650..11877b1 100644 --- a/subtrees/z_quantum_actions/actions/publish-release/action.yml +++ b/subtrees/z_quantum_actions/actions/publish-release/action.yml @@ -34,12 +34,46 @@ runs: git push --tags echo "::set-output name=tag::$TAG" + # Use pip to build a PEP 517 wheel + - name: Build wheel + id: build-wheel + shell: bash + run: python3 -m pip wheel --isolated --no-deps -w dist . + + # Upload all artifacts in dist + - name: Store wheel artifacts + uses: actions/upload-artifact@v2 + with: + name: Python Wheels + path: dist + - name: Create entry on GH Releases + id: make-release shell: bash run: | - curl \ + # When we make a release, we should check the response for the "upload_url" + API_RESPONSE=$(curl \ -X POST \ - curl -H "Authorization: token ${{ github.token }}" \ + -H "Authorization: token ${{ github.token }}" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/${{ github.repository }}/releases \ - -d '{"tag_name":"${{ steps.push-new-version-tag.outputs.tag }}"}' + -d '{"tag_name":"${{ steps.push-new-version-tag.outputs.tag }}"}') + # The URL from github has some extras in curly brackets that we do not want: + # The URL always ends in assets, so we can use that to help check for the end + UPLOAD_URL=$(echo ${API_RESPONSE} | jq .upload_url | sed "s/\(.*assets\){.*}/\1/") + echo "::set-output name=upload_url::${UPLOAD_URL}" + + - name: Upload wheel to release page + shell: bash + run: | + # We don't know the wheel name, so we can check for everything in the dist dir + # We may build multiple wheels from a single repo, so this works for that too. + for wheel in dist/*; do + curl \ + -X POST \ + -H "Authorization: token ${{ github.token }}" \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Content-Type: $(file -b --mime-type $wheel)" \ + -T "$wheel" \ + "${{ steps.make-release.outputs.upload_url }}?name=$(basename $wheel)" + done diff --git a/subtrees/z_quantum_actions/bin/get_next_version.py b/subtrees/z_quantum_actions/bin/get_next_version.py index c020a20..c646611 100755 --- a/subtrees/z_quantum_actions/bin/get_next_version.py +++ b/subtrees/z_quantum_actions/bin/get_next_version.py @@ -1,4 +1,7 @@ #! /usr/bin/env python3 +################################################################################ +# © Copyright 2022 Zapata Computing Inc. +################################################################################ # This script ia intended to be run from within a Github Action. # Reads current project version, bumps "minor", and sets the "next_version" output diff --git a/subtrees/z_quantum_actions/sample_setup.py b/subtrees/z_quantum_actions/sample_setup.py index 80f8e3c..f6e9ff2 100644 --- a/subtrees/z_quantum_actions/sample_setup.py +++ b/subtrees/z_quantum_actions/sample_setup.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +################################################################################ +# © Copyright 2021-2022 Zapata Computing Inc. +################################################################################ import site import sys diff --git a/subtrees/z_quantum_actions/setup_extras.py b/subtrees/z_quantum_actions/setup_extras.py index ed1d1da..dc38637 100644 --- a/subtrees/z_quantum_actions/setup_extras.py +++ b/subtrees/z_quantum_actions/setup_extras.py @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2021-2022 Zapata Computing Inc. +################################################################################ extras = { # Development extras needed in every project, because the stylechecks depend on it. # If you need more dev deps, extend this list in your own setup.py. diff --git a/subtrees/z_quantum_actions/tests/test_get_next_version.py b/subtrees/z_quantum_actions/tests/test_get_next_version.py index cb9614f..a17fd3a 100644 --- a/subtrees/z_quantum_actions/tests/test_get_next_version.py +++ b/subtrees/z_quantum_actions/tests/test_get_next_version.py @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2022 Zapata Computing Inc. +################################################################################ import re import subprocess diff --git a/tests/zquantum/solid_state/fermi_hubbard_test.py b/tests/zquantum/solid_state/fermi_hubbard_test.py index b2b1de1..2fe4d1e 100644 --- a/tests/zquantum/solid_state/fermi_hubbard_test.py +++ b/tests/zquantum/solid_state/fermi_hubbard_test.py @@ -1,3 +1,6 @@ +################################################################################ +# © Copyright 2021-2022 Zapata Computing Inc. +################################################################################ import unittest from zquantum.core.openfermion import FermionOperator, get_interaction_operator