Skip to content

Commit 206d396

Browse files
committed
More pyproject.toml updates + PR readiness.
setup.py now has the bare minimum required, the dynamic version and compilation. This also removes a duplicated/unused no cython pyproject.toml, and reverts feature actions to not run extra tests. Notebook tests still not passing, but that will be handled in a separate PR.
1 parent 0472aff commit 206d396

File tree

5 files changed

+48
-152
lines changed

5 files changed

+48
-152
lines changed

.github/workflows/feature-branches.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
# fail-fast: true is OK here
2020
matrix:
21-
os: [macos-latest, ubuntu-latest, windows-latest] # TEMP: Try latest mac again # No Mac
21+
os: [ubuntu-latest, windows-latest]
2222
python-version: [3.9, '3.12'] # Only extremal Python versions
2323
uses: ./.github/workflows/reuseable-main.yml
2424
name: Run pyGSTi tests
@@ -27,8 +27,8 @@ jobs:
2727
python-version: ${{ matrix.python-version }}
2828
use-cython: 'true' # Only test environment with Cython
2929
run-unit-tests: 'true'
30-
run-extra-tests: 'true' # No integration tests # TEMP: Try integration tests
31-
run-notebook-tests: 'true' # No notebook tests # TEMP: Try notebook tests
30+
run-extra-tests: 'false' # No integration tests
31+
run-notebook-tests: 'false' # No notebook tests
3232

3333

3434

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include README.md CONTRIBUTING.md LICENSE
2-
include pyproject.toml pyproject.toml.no_cython
2+
include pyproject.toml
33
include install_locally.py
44
include requirements.txt
55
include optional-requirements.txt

pyproject.toml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "pygsti"
9-
dynamic = ["version", "readme", "optional-dependencies"]
9+
dynamic = ["version"]
1010
description = 'A python implementation of Gate Set Tomography'
11+
readme = "README.md"
1112
authors = [
1213
{email = 'pygsti@sandia.gov'},
1314
{name = 'Erik Nielsen'},
@@ -48,6 +49,48 @@ classifiers=[
4849
"Operating System :: Unix"
4950
]
5051

52+
[project.optional-dependencies]
53+
diamond_norm = [
54+
'cvxopt',
55+
'cvxpy'
56+
]
57+
evolutionary_optimization = ['deap']
58+
extensions = ['cython']
59+
html_reports = ['jinja2', 'MarkupSafe']
60+
interpygate = ['csaps']
61+
linting = [
62+
'autopep8',
63+
'flake8'
64+
]
65+
memory_profiling = ['psutil']
66+
mongodb = ['pymongo']
67+
msgpack = ['msgpack']
68+
multiprocessor = ['mpi4py']
69+
notebooks = [
70+
'ipython',
71+
'notebook',
72+
'jupyter_server'
73+
]
74+
pytorch = ['torch']
75+
report_pdf_figures = ['matplotlib']
76+
reports = ['pygsti[html_reports,report_pdf_figures]']
77+
testing_no_cython_mpi = [
78+
'pytest',
79+
'pytest-xdist',
80+
'pytest-cov',
81+
'nbval',
82+
'packaging',
83+
'zmq',
84+
'seaborn',
85+
'ply',
86+
'cirq-core',
87+
'pygsti[diamond_norm,interpygate,memory_profiling,msgpack,notebooks,pytorch,reports]'
88+
]
89+
testing_no_cython = ['pygsti[multiprocessor,testing_no_cython_mpi]']
90+
testing = ['pygsti[extensions,testing_no_cython]']
91+
no_mpi = ['pygsti[evolutionary_optimization,extensions,linting,mongodb,testing_no_cython_mpi]']
92+
complete = ['pygsti[multiprocessor,no_mpi]']
93+
5194
[project.urls]
5295
Homepage = 'https://www.pygsti.info'
5396
Repository = 'https://github.com/sandialabs/pyGSTi'

pyproject.toml.no_cython

Lines changed: 0 additions & 57 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -12,94 +12,6 @@
1212
from distutils.extension import Extension
1313
from distutils.command.build_ext import build_ext
1414

15-
16-
17-
descriptionTxt = """\
18-
Gate set tomography (GST) is a quantum tomography protocol that provides full characterization of a quantum logic device
19-
(e.g. a qubit). GST estimates a set of quantum logic gates and (simultaneously) the associated state preparation and
20-
measurement (SPAM) operations. GST is self-calibrating. This eliminates a key limitation of traditional quantum state
21-
and process tomography, which characterize either states (assuming perfect processes) or processes (assuming perfect
22-
state preparation and measurement), but not both together. Compared with benchmarking protocols such as randomized
23-
benchmarking, GST provides much more detailed and accurate information about the gates, but demands more data. The
24-
primary downside of GST has been its complexity. Whereas benchmarking and state/process tomography data can be analyzed
25-
with relatively simple algorithms, GST requires more complex algorithms and more fine-tuning (linear GST is an exception
26-
that can be implemented easily). pyGSTi addresses and eliminates this obstacle by providing a fully-featured, publicly
27-
available implementation of GST in the Python programming language.
28-
29-
The primary goals of the pyGSTi project are to:
30-
31-
- provide efficient and robust implementations of Gate Set Tomography algorithms;
32-
- allow straightforward interoperability with other software;
33-
- provide a powerful high-level interface suited to inexperienced programmers, so that
34-
common GST tasks can be performed using just one or two lines of code;
35-
- use modular design to make it easy for users to modify, customize, and extend GST functionality.
36-
"""
37-
38-
# Extra requirements
39-
extras = {
40-
'pytorch' : ['torch'],
41-
'diamond_norm': [
42-
'cvxopt',
43-
'cvxpy'
44-
],
45-
'memory_profiling': ['psutil'],
46-
'multiprocessor': ['mpi4py'],
47-
'evolutionary_optimization': ['deap'],
48-
'report_pickling': ['pandas'],
49-
'report_pdf_figures': ['matplotlib'],
50-
'html_reports': ['jinja2', 'MarkupSafe'],
51-
'notebooks': [
52-
'ipython',
53-
'notebook',
54-
'jupyter_server'
55-
],
56-
'mongodb': ['pymongo'],
57-
'msgpack': ['msgpack'],
58-
'extensions': ['cython'],
59-
'linting': [
60-
'autopep8',
61-
'flake8'
62-
],
63-
'interpygate': ['csaps'],
64-
'testing': [
65-
'pytest',
66-
'pytest-xdist',
67-
'pytest-cov',
68-
'nbval',
69-
'csaps',
70-
'cvxopt',
71-
'cvxpy',
72-
'cython',
73-
'matplotlib',
74-
'mpi4py',
75-
'msgpack',
76-
'packaging',
77-
'pandas',
78-
'psutil',
79-
'zmq',
80-
'jinja2',
81-
'seaborn',
82-
'scipy',
83-
'ply',
84-
'cirq-core',
85-
'notebook',
86-
'ipython',
87-
'jupyter_server',
88-
'torch'
89-
]
90-
}
91-
92-
# Add `complete' target, which will install all extras listed above
93-
extras['complete'] = list({pkg for req in extras.values() for pkg in req})
94-
95-
# Add `no_mpi' target, identical to `complete' target but without mpi4py,
96-
# which is unavailable in some common environments.
97-
extras['no_mpi'] = [e for e in extras['complete'] if e != 'mpi4py']
98-
99-
# Add testing_no_cython target, identical to `testing` but no cython
100-
extras['testing_no_cython'] = [e for e in extras['testing'] if e != 'cython']
101-
102-
10315
# Configure setuptools_scm to build a custom version (for more info,
10416
# see https://stackoverflow.com/a/78657279 and https://setuptools-scm.readthedocs.io/en/latest/extending)
10517
# If on a clean release, it uses no local scheme
@@ -150,10 +62,8 @@ def build_extensions(self):
15062

15163
def setup_with_extensions(extensions=None):
15264
setup(
153-
long_description=descriptionTxt,
15465
use_scm_version={'version_scheme': 'no-guess-dev', 'version_file': "pygsti/_version.py", 'local_scheme': custom_version},
15566
cmdclass={'build_ext': build_ext_compiler_check},
156-
extras_require=extras,
15767
ext_modules=extensions or [],
15868
packages=find_packages(),
15969
package_data={

0 commit comments

Comments
 (0)