Skip to content

Commit

Permalink
Merge branch 'master' into 1704-defcalibrations-affect-the-resulting-…
Browse files Browse the repository at this point in the history
…wavefunction-in-pyquil-4
  • Loading branch information
MarquessV authored Apr 10, 2024
2 parents f3731bd + 1119c34 commit ea69d66
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 48 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 4.9.0-rc.0 (2024-04-09)

### Features

#### Publish pyquil-grpc-web; A new package that supports making gRPC connections over HTTP/1.1. (#1763)

## 4.8.0 (2024-03-08)

### Features
Expand Down
97 changes: 51 additions & 46 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
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"
Expand All @@ -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"
Expand Down
38 changes: 38 additions & 0 deletions scripts/ci_publish_grpc_web.py
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)

0 comments on commit ea69d66

Please sign in to comment.