Skip to content

Commit 3a47a96

Browse files
authored
Merge pull request #381 from tomhepz/patch-1
Add note on PYNQ compat
2 parents 390db42 + f274eb5 commit 3a47a96

5 files changed

Lines changed: 28 additions & 13 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ It consists of:
1616
* The `qick` Python package, which includes the interface to the firmware and an API for writing QICK programs
1717
* [Jupyter notebooks](qick_demos) demonstrating usage
1818

19-
See our [Read the Docs site](https://qick-docs.readthedocs.io/) for:
19+
See our [Read the Docs site](https://docs.qick.dev/) for:
2020
* Documentation of the firmware and software
21-
* A quick-start guide for setting up your board and running the example Jupyter notebooks
22-
* Ways to communicate with QICK developers and the community
21+
* A [quick-start guide](https://docs.qick.dev/latest/quick_start.html) for setting up your board and running the example Jupyter notebooks
22+
* [Ways to communicate](https://docs.qick.dev/latest/contact.html) with QICK developers and the community
2323
* Extensions to QICK for added functionailty
2424

2525
## Updates
2626

2727
The QICK firmware and software is still very much a work in progress.
2828
We strive to be consistent with the APIs but cannot guarantee backwards compatibility.
2929

30+
> [!NOTE]
31+
> QICK does not yet support PYNQ v3.1. The QICK quick-start guide (linked above) lists the currently recommended PYNQ OS images for your SD card.
32+
3033
Frequent updates to the QICK firmware and software are made as pull requests.
3134
Each pull request will be documented with a description of the notable changes, including any changes that will require you to change your code.
3235
We hope that this will help you decide whether or not to update your local code to the latest version.

qick_demos/000_Install_qick_package.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"## pynq library\n",
2222
"Let's check that the Xilinx pynq library is installed: you should see (among things) a version number, which should match the version of the PYNQ Linux image you installed.\n",
2323
"\n",
24-
"The QICK software supports pynq versions 2.6.0 and above."
24+
"The QICK software supports pynq versions 2.6 through 3.0 (including 3.0.1). Version 3.1 is not supported at this time."
2525
]
2626
},
2727
{
@@ -165,7 +165,11 @@
165165
"source": [
166166
"### Installing using pip (recommended option)\n",
167167
"\n",
168-
"You could run these `pip3` commands from the shell over SSH - they need to be run as root (using `sudo`), and on pynq 2.7 you must additionally enable the pynq `venv`. Running the commands inside a notebook, as we do here, conveniently ensures that the commands run in (and install to) the same environment that the notebook runs in."
168+
"You could run these `pip3` commands from the shell over SSH - they need to be run as root (using `sudo`), and on pynq 2.7 you must additionally enable the pynq `venv`. Running the commands inside a notebook, as we do here, conveniently ensures that the commands run in (and install to) the same environment that the notebook runs in.\n",
169+
"\n",
170+
"The options `--no-index --no-build-isolation` are important for two reasons:\n",
171+
"1. they allow pip to run even if the board doesn't have Internet access\n",
172+
"2. they prevent pip from attempting to install the `pynq` library, which may happen if you've somehow broken your board's Python environment or your `pynq` version is unsupported; pip can't actually install `pynq` correctly so this is unhelpful"
169173
]
170174
},
171175
{
@@ -205,19 +209,15 @@
205209
"# It is recommended if you expect to update the git repo, or you want to test changes to the QICK library, \n",
206210
"# and don't want to reinstall the library every time.\n",
207211
"\n",
208-
"!pip3 install -e ../\n",
209-
"\n",
210-
"# If your board doesn't have Internet access, you may need to add some extra options:\n",
211-
"\n",
212-
"# !pip3 install --no-index --no-build-isolation -e ../\n",
212+
"!pip3 install --no-index --no-build-isolation -e ../\n",
213213
"\n",
214214
"# Use the line below instead for a normal pip install, which copies the library files to a central location.\n",
215215
"# In contrast to an editable install, you will need to re-install whenever you modify or update the qick library;\n",
216216
"# a normal install is somewhat slower for the initial install and infinitely slower for updates.\n",
217217
"# This is only recommended if for some reason you want to delete the git repo after installing,\n",
218218
"# or the git repo is on a temporarily available filesystem (e.g. flash drive).\n",
219219
"\n",
220-
"# !pip3 install ../\n"
220+
"# !pip3 install --no-index --no-build-isolation ../"
221221
]
222222
},
223223
{

qick_lib/qick/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.380
1+
0.2.381

qick_lib/qick/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ def bitfile_path():
3737
src = os.path.join(os.path.dirname(qick.__file__), filename)
3838
return src
3939

40+
# Check for supported PYNQ versions that are compatible with QICK library
41+
# only do the check if running on a Zynq
42+
if platform.machine() in ['aarch64', 'armv7l']:
43+
import pkg_resources
44+
45+
pynq_version = pkg_resources.get_distribution("pynq").version
46+
if pkg_resources.parse_version(pynq_version) >= pkg_resources.parse_version("3.1"):
47+
raise RuntimeError(
48+
f"Unsupported PYNQ version {pynq_version}. "
49+
"QICK library requires PYNQ < 3.1."
50+
)
51+
4052
# tie in to rpyc, if using
4153
try:
4254
from rpyc.utils.classic import obtain

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def get_version(rel_path):
157157
# We may therefore lose compatibility with the QICK library on a PC running NumPy 2.0.
158158
install_requires=[
159159
"numpy",
160-
"pynq>=2.6;platform_machine=='aarch64' or platform_machine=='armv7l'",
160+
"pynq>=2.6,<3.1; platform_machine=='aarch64' or platform_machine=='armv7l'",
161161
"tqdm", # Optional
162162
],
163163

0 commit comments

Comments
 (0)