-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 1704-defcalibrations-affect-the-resulting-…
…wavefunction-in-pyquil-4
- Loading branch information
Showing
5 changed files
with
129 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,38 @@ jobs: | |
PYQUIL_TAG_VERSION: ${{ steps.publish.outputs.PYQUIL_TAG_VERSION }} | ||
PYQUIL_TAG_LATEST: ${{ steps.publish.outputs.PYQUIL_TAG_LATEST }} | ||
PYQUIL_TAG_RC: ${{ steps.publish.outputs.PYQUIL_TAG_RC }} | ||
|
||
build-publish-grpc-web: | ||
name: Build and Publish (pyquil-grpc-web) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-in-project: true | ||
- name: Patch package metadata for grpc-web | ||
run: | | ||
pip install toml | ||
python scripts/ci_publish_grpc_web.py | ||
- name: Poetry Build | ||
run: | | ||
poetry build --no-interaction | ||
- name: Upload wheels as artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: dist | ||
- name: Mint token | ||
id: mint | ||
uses: tschm/[email protected] | ||
- name: Publish the package with poetry | ||
run: | | ||
poetry publish -u __token__ -p '${{ steps.mint.outputs.api-token }}' | ||
docker-publish: | ||
name: Docker Publish | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pyquil" | ||
version = "4.8.0" | ||
version = "4.9.0-rc.0" | ||
description = "A Python library for creating Quantum Instruction Language (Quil) programs." | ||
authors = ["Rigetti Computing <[email protected]>"] | ||
readme = "README.md" | ||
|
@@ -26,7 +26,7 @@ lark = "^0.11.1" | |
rpcq = "^3.10.0" | ||
networkx = ">=2.5" | ||
importlib-metadata = { version = ">=3.7.3,<5", python = "<3.8" } | ||
qcs-sdk-python = "0.17.1" | ||
qcs-sdk-python = "0.17.4" | ||
tenacity = "^8.2.2" | ||
types-python-dateutil = "^2.8.19" | ||
types-retry = "^0.9.9" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
Changes the qcs-sdk-python dependency to qcs-sdk-python-grpc-web. | ||
""" | ||
|
||
from io import TextIOWrapper | ||
from os.path import dirname, realpath, join | ||
import toml | ||
|
||
workspace_path = dirname(dirname(realpath(__file__))) | ||
|
||
def write(f: TextIOWrapper, data): | ||
f.seek(0) | ||
f.write(toml.dumps(data)) | ||
f.truncate() | ||
|
||
with open(join(workspace_path, "pyproject.toml"), "r+") as f: | ||
data = toml.load(f) | ||
|
||
# renames the published package name, but not the import name | ||
data["project"] = { "name": "pyquil-grpc-web" } | ||
data["tool"]["poetry"]["name"] = "pyquil-grpc-web" | ||
|
||
# use the same dependency definition, but change the name | ||
# to the grpc-web version of the package. | ||
deps = data["tool"]["poetry"]["dependencies"] | ||
deps["qcs-sdk-python-grpc-web"] = deps["qcs-sdk-python"] | ||
del deps["qcs-sdk-python"] | ||
|
||
write(f, data) | ||
|
||
# The `__package__` will refer to `pyquil`, but this | ||
# package is now `pyquil_grpc_web` - this is the simplest | ||
# way to make that overwrite. | ||
with open(join(workspace_path, "pyquil", "_version.py"), "r+") as f: | ||
updated = f.read().replace("__package__", '"pyquil_grpc_web"') | ||
f.seek(0) | ||
f.truncate() | ||
f.write(updated) |