Skip to content

Commit cc8e613

Browse files
authored
Merge pull request #590 from sandialabs/bugfix-pypi-deployment
PyPI Deployment Fix (v0.9.13.2)
2 parents c3f1f84 + 3610c33 commit cc8e613

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

.github/workflows/autodeploy.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
python-version: '3.10'
2929

3030
- name: Build wheels
31-
uses: pypa/cibuildwheel@v2.1.2
31+
uses: pypa/cibuildwheel@v3.0.0
3232
env:
33-
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-*
33+
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
3434
CIBW_BUILD_VERBOSITY: 1
3535
CIBW_BEFORE_ALL_LINUX: ./.github/ci-scripts/before_install.sh
3636
CIBW_BEFORE_ALL_MACOS: ./.github/ci-scripts/before_install_macos.sh
@@ -43,7 +43,6 @@ jobs:
4343
build_sdist:
4444
name: Build source distribution
4545
runs-on: ubuntu-latest
46-
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # doesn't work -- try using tags: above
4746

4847
steps:
4948
- uses: actions/checkout@v4
@@ -56,7 +55,9 @@ jobs:
5655
python-version: '3.10'
5756

5857
- name: Build sdist
59-
run: python setup.py sdist
58+
run: |
59+
pip install build
60+
python -m build --sdist
6061
6162
- uses: actions/upload-artifact@v4
6263
with:
@@ -66,7 +67,7 @@ jobs:
6667
upload_pypi:
6768
needs: [build_wheels, build_sdist]
6869
runs-on: ubuntu-latest
69-
if: github.event_name == 'release' && github.event.action == 'published'
70+
#if: github.event_name == 'release' && github.event.action == 'published'
7071
permissions:
7172
# IMPORTANT: this permission is mandatory for trusted publishing
7273
id-token: write

pygsti/layouts/prefixtable.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import collections as _collections
1414
import networkx as _nx
15-
import matplotlib.pyplot as plt
1615
from math import ceil
1716
from pygsti.baseobjs import Label as _Label
1817
from pygsti.circuits.circuit import SeparatePOVMCircuit as _SeparatePOVMCircuit
@@ -1208,6 +1207,14 @@ def _draw_graph(G, node_label_key='label', edge_label_key='promotion_cost', figu
12081207
An optional size specifier passed into the matplotlib figure
12091208
constructor to set the plot size.
12101209
"""
1210+
try:
1211+
import matplotlib.pyplot as plt
1212+
except ImportError as e:
1213+
msg = 'The function `_draw_graph` requires the installation of matplotlib.'\
1214+
+'Please ensure this is properly installed and try again.'
1215+
print(msg)
1216+
raise e
1217+
12111218
plt.figure(figsize=figure_size)
12121219
pos = _nx.nx_agraph.graphviz_layout(G, prog="dot", args="-Granksep=5 -Gnodesep=10")
12131220
labels = _nx.get_node_attributes(G, node_label_key)

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,8 @@ complete = ['pygsti[multiprocessor,no_mpi]']
9494
[project.urls]
9595
Homepage = 'https://www.pygsti.info'
9696
Repository = 'https://github.com/sandialabs/pyGSTi'
97-
Download ='https://github.com/sandialabs/pyGSTi/tarball/master'
97+
Download ='https://github.com/sandialabs/pyGSTi/tarball/master'
98+
99+
[tool.setuptools_scm]
100+
version_scheme = "only-version"
101+
local_scheme = "no-local-version"

0 commit comments

Comments
 (0)