From 43aad0914e5e2dca2e4e28271c9c35c3fb0d0fa8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 30 Jan 2017 09:24:43 +0800 Subject: [PATCH] python3.5 -> python3 Many things also work with Python 3.6. --- artiq/applets/big_number.py | 2 +- artiq/applets/image.py | 2 +- artiq/applets/plot_hist.py | 2 +- artiq/applets/plot_xy.py | 2 +- artiq/applets/plot_xy_hist.py | 2 +- artiq/examples/master/device_db.pyon | 2 +- artiq/examples/remote_exec_controller.py | 2 +- artiq/firmware/satman/Makefile | 2 +- artiq/frontend/artiq_browser.py | 2 +- artiq/frontend/artiq_client.py | 2 +- artiq/frontend/artiq_compile.py | 2 +- artiq/frontend/artiq_coreanalyzer.py | 2 +- artiq/frontend/artiq_coreconfig.py | 2 +- artiq/frontend/artiq_corelog.py | 2 +- artiq/frontend/artiq_ctlmgr.py | 2 +- artiq/frontend/artiq_dashboard.py | 2 +- artiq/frontend/artiq_devtool.py | 2 +- artiq/frontend/artiq_flash.py | 2 +- artiq/frontend/artiq_influxdb.py | 2 +- artiq/frontend/artiq_master.py | 2 +- artiq/frontend/artiq_mkfs.py | 2 +- artiq/frontend/artiq_rpctool.py | 2 +- artiq/frontend/artiq_run.py | 2 +- artiq/frontend/bit2bin.py | 2 +- artiq/frontend/korad_ka3005p_controller.py | 2 +- artiq/frontend/lda_controller.py | 2 +- artiq/frontend/novatech409b_controller.py | 2 +- artiq/frontend/pdq2_controller.py | 2 +- artiq/frontend/thorlabs_tcube_controller.py | 2 +- artiq/gateware/targets/kc705_dds.py | 2 +- artiq/gateware/targets/kc705_drtio_master.py | 2 +- artiq/gateware/targets/phaser.py | 2 +- artiq/gateware/targets/pipistrello.py | 2 +- artiq/runtime/Makefile | 2 +- doc/manual/faq.rst | 6 ++--- doc/manual/getting_started_core.rst | 2 +- doc/manual/getting_started_mgmt.rst | 2 +- doc/manual/installing_from_source.rst | 26 ++++++++++---------- setup.py | 2 +- 39 files changed, 53 insertions(+), 53 deletions(-) diff --git a/artiq/applets/big_number.py b/artiq/applets/big_number.py index 8d13170b8..62348c8cf 100755 --- a/artiq/applets/big_number.py +++ b/artiq/applets/big_number.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 from PyQt5 import QtWidgets diff --git a/artiq/applets/image.py b/artiq/applets/image.py index f64e71ff8..b7d36c1a1 100755 --- a/artiq/applets/image.py +++ b/artiq/applets/image.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import PyQt5 # make sure pyqtgraph imports Qt5 import pyqtgraph diff --git a/artiq/applets/plot_hist.py b/artiq/applets/plot_hist.py index b577120e7..dc46997b9 100755 --- a/artiq/applets/plot_hist.py +++ b/artiq/applets/plot_hist.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import PyQt5 # make sure pyqtgraph imports Qt5 import pyqtgraph diff --git a/artiq/applets/plot_xy.py b/artiq/applets/plot_xy.py index 97f32c7dc..da7f2197d 100755 --- a/artiq/applets/plot_xy.py +++ b/artiq/applets/plot_xy.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import numpy as np import PyQt5 # make sure pyqtgraph imports Qt5 diff --git a/artiq/applets/plot_xy_hist.py b/artiq/applets/plot_xy_hist.py index bc5cfbe7e..7b8135561 100755 --- a/artiq/applets/plot_xy_hist.py +++ b/artiq/applets/plot_xy_hist.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import numpy as np from PyQt5 import QtWidgets diff --git a/artiq/examples/master/device_db.pyon b/artiq/examples/master/device_db.pyon index 5803a3e80..a8a8f63d8 100644 --- a/artiq/examples/master/device_db.pyon +++ b/artiq/examples/master/device_db.pyon @@ -209,7 +209,7 @@ "host": "::1", "port": 6283, "target_name": "camera_sim", - "command": "python3.5 -m artiq.examples.remote_exec_controller" + "command": "python3 -m artiq.examples.remote_exec_controller" }, "camera_sim_rexec": { "type": "controller_aux_target", diff --git a/artiq/examples/remote_exec_controller.py b/artiq/examples/remote_exec_controller.py index 11e607927..421202414 100755 --- a/artiq/examples/remote_exec_controller.py +++ b/artiq/examples/remote_exec_controller.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import numpy as np from numba import jit diff --git a/artiq/firmware/satman/Makefile b/artiq/firmware/satman/Makefile index 2ebd64e9c..2144befe3 100644 --- a/artiq/firmware/satman/Makefile +++ b/artiq/firmware/satman/Makefile @@ -1,7 +1,7 @@ include ../include/generated/variables.mak include $(MISOC_DIRECTORY)/software/common.mak -PYTHON ?= python3.5 +PYTHON ?= python3 RUSTOUT := cargo/or1k-unknown-none/debug diff --git a/artiq/frontend/artiq_browser.py b/artiq/frontend/artiq_browser.py index 10fc0df85..692558616 100755 --- a/artiq/frontend/artiq_browser.py +++ b/artiq/frontend/artiq_browser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import asyncio diff --git a/artiq/frontend/artiq_client.py b/artiq/frontend/artiq_client.py index 5b5f56b12..7f5c63d7c 100755 --- a/artiq/frontend/artiq_client.py +++ b/artiq/frontend/artiq_client.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import logging diff --git a/artiq/frontend/artiq_compile.py b/artiq/frontend/artiq_compile.py index ef801516c..89d3cd234 100755 --- a/artiq/frontend/artiq_compile.py +++ b/artiq/frontend/artiq_compile.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import os, sys, logging, argparse diff --git a/artiq/frontend/artiq_coreanalyzer.py b/artiq/frontend/artiq_coreanalyzer.py index b715eebc0..ec1b4406d 100755 --- a/artiq/frontend/artiq_coreanalyzer.py +++ b/artiq/frontend/artiq_coreanalyzer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import sys diff --git a/artiq/frontend/artiq_coreconfig.py b/artiq/frontend/artiq_coreconfig.py index d8fdaeba5..cf5ff8b19 100755 --- a/artiq/frontend/artiq_coreconfig.py +++ b/artiq/frontend/artiq_coreconfig.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import struct diff --git a/artiq/frontend/artiq_corelog.py b/artiq/frontend/artiq_corelog.py index df114ec49..046d6cece 100755 --- a/artiq/frontend/artiq_corelog.py +++ b/artiq/frontend/artiq_corelog.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse diff --git a/artiq/frontend/artiq_ctlmgr.py b/artiq/frontend/artiq_ctlmgr.py index d3091dfdd..6aeaee0f6 100755 --- a/artiq/frontend/artiq_ctlmgr.py +++ b/artiq/frontend/artiq_ctlmgr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import asyncio import atexit diff --git a/artiq/frontend/artiq_dashboard.py b/artiq/frontend/artiq_dashboard.py index dd3aed1f7..20804ac53 100755 --- a/artiq/frontend/artiq_dashboard.py +++ b/artiq/frontend/artiq_dashboard.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import asyncio diff --git a/artiq/frontend/artiq_devtool.py b/artiq/frontend/artiq_devtool.py index bc6feb7c0..5f74ba6e8 100644 --- a/artiq/frontend/artiq_devtool.py +++ b/artiq/frontend/artiq_devtool.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # This script makes the following assumptions: # * miniconda is installed remotely at ~/miniconda diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 3714ea58e..0436c56fb 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # Copyright (C) 2015 Robert Jordens import argparse diff --git a/artiq/frontend/artiq_influxdb.py b/artiq/frontend/artiq_influxdb.py index 7028b7bf5..7205e0e4e 100755 --- a/artiq/frontend/artiq_influxdb.py +++ b/artiq/frontend/artiq_influxdb.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import logging diff --git a/artiq/frontend/artiq_master.py b/artiq/frontend/artiq_master.py index ae1e5820e..5513537c0 100755 --- a/artiq/frontend/artiq_master.py +++ b/artiq/frontend/artiq_master.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import asyncio import argparse diff --git a/artiq/frontend/artiq_mkfs.py b/artiq/frontend/artiq_mkfs.py index 0a78afa1b..22c21f1d0 100755 --- a/artiq/frontend/artiq_mkfs.py +++ b/artiq/frontend/artiq_mkfs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import struct diff --git a/artiq/frontend/artiq_rpctool.py b/artiq/frontend/artiq_rpctool.py index 3ab7f25a5..74cb8890a 100755 --- a/artiq/frontend/artiq_rpctool.py +++ b/artiq/frontend/artiq_rpctool.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import textwrap diff --git a/artiq/frontend/artiq_run.py b/artiq/frontend/artiq_run.py index 004171a0f..11419ea68 100755 --- a/artiq/frontend/artiq_run.py +++ b/artiq/frontend/artiq_run.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # Copyright (C) 2014, 2015 M-Labs Limited # Copyright (C) 2014, 2015 Robert Jordens diff --git a/artiq/frontend/bit2bin.py b/artiq/frontend/bit2bin.py index 5c99fe44b..82a33f546 100755 --- a/artiq/frontend/bit2bin.py +++ b/artiq/frontend/bit2bin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # Copyright 2014-2017 Robert Jordens # after # https://github.com/mfischer/fpgadev-zynq/blob/master/top/python/bit_to_zynq_bin.py diff --git a/artiq/frontend/korad_ka3005p_controller.py b/artiq/frontend/korad_ka3005p_controller.py index 816a8d552..fb9ba6712 100755 --- a/artiq/frontend/korad_ka3005p_controller.py +++ b/artiq/frontend/korad_ka3005p_controller.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # Written by Joe Britton, 2016 diff --git a/artiq/frontend/lda_controller.py b/artiq/frontend/lda_controller.py index db677bccc..cf3a36aae 100755 --- a/artiq/frontend/lda_controller.py +++ b/artiq/frontend/lda_controller.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse diff --git a/artiq/frontend/novatech409b_controller.py b/artiq/frontend/novatech409b_controller.py index 38e2f5f97..3cc9ce7a4 100755 --- a/artiq/frontend/novatech409b_controller.py +++ b/artiq/frontend/novatech409b_controller.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # Written by Joe Britton, 2015 diff --git a/artiq/frontend/pdq2_controller.py b/artiq/frontend/pdq2_controller.py index 7ec6fb79a..a134d8ece 100755 --- a/artiq/frontend/pdq2_controller.py +++ b/artiq/frontend/pdq2_controller.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import sys diff --git a/artiq/frontend/thorlabs_tcube_controller.py b/artiq/frontend/thorlabs_tcube_controller.py index 4c8fb57ed..bb9e5b716 100755 --- a/artiq/frontend/thorlabs_tcube_controller.py +++ b/artiq/frontend/thorlabs_tcube_controller.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse import sys diff --git a/artiq/gateware/targets/kc705_dds.py b/artiq/gateware/targets/kc705_dds.py index dd6cafc6f..73940e2fc 100755 --- a/artiq/gateware/targets/kc705_dds.py +++ b/artiq/gateware/targets/kc705_dds.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse diff --git a/artiq/gateware/targets/kc705_drtio_master.py b/artiq/gateware/targets/kc705_drtio_master.py index 75def1747..c2e22cb93 100755 --- a/artiq/gateware/targets/kc705_drtio_master.py +++ b/artiq/gateware/targets/kc705_drtio_master.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse diff --git a/artiq/gateware/targets/phaser.py b/artiq/gateware/targets/phaser.py index e13efc579..3923a6502 100755 --- a/artiq/gateware/targets/phaser.py +++ b/artiq/gateware/targets/phaser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 import argparse diff --git a/artiq/gateware/targets/pipistrello.py b/artiq/gateware/targets/pipistrello.py index f7fc45a71..7dd1c01cd 100755 --- a/artiq/gateware/targets/pipistrello.py +++ b/artiq/gateware/targets/pipistrello.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # Copyright (C) 2014, 2015 Robert Jordens # Copyright (C) 2014, 2015 M-Labs Limited diff --git a/artiq/runtime/Makefile b/artiq/runtime/Makefile index 1e030206d..45f76b7fc 100644 --- a/artiq/runtime/Makefile +++ b/artiq/runtime/Makefile @@ -1,7 +1,7 @@ include ../include/generated/variables.mak include $(MISOC_DIRECTORY)/software/common.mak -PYTHON ?= python3.5 +PYTHON ?= python3 CARGO_normal := env CARGO_quiet = @echo " CARGO " $@ && $(CARGO_normal) diff --git a/doc/manual/faq.rst b/doc/manual/faq.rst index 5097c04b8..8df0258d8 100644 --- a/doc/manual/faq.rst +++ b/doc/manual/faq.rst @@ -11,7 +11,7 @@ find ARTIQ examples? The examples are installed in the ``examples`` folder of the ARTIQ package. You can find where the ARTIQ package is installed on your machine with: :: - python3.5 -c "import artiq; print(artiq.__path__[0])" + python3 -c "import artiq; print(artiq.__path__[0])" Copy the ``examples`` folder from that path into your home/user directory, and start experimenting! @@ -75,7 +75,7 @@ determine the pyserial URL to attach to a device by its serial number? You can list your system's serial devices and print their vendor/product id and serial number by running:: - $ python3.5 -m serial.tools.list_ports -v + $ python3 -m serial.tools.list_ports -v It will give you the ``/dev/ttyUSBxx`` (or the ``COMxx`` for Windows) device names. @@ -93,7 +93,7 @@ See the :ref:`TDC001 documentation ` for an exa run unit tests? --------------- -The unit tests assume that the Python environment has been set up in such a way that ``import artiq`` will import the code being tested, and that this is still true for any subprocess created. This is not the way setuptools operates as it adds the path to ARTIQ to ``sys.path`` which is not passed to subprocesses; as a result, running the tests via ``setup.py`` is not supported. The user must first install the package or set ``PYTHONPATH``, and then run the tests with e.g. ``python3.5 -m unittest discover`` in the ``artiq/test`` folder and ``lit .`` in the ``artiq/test/lit`` folder. +The unit tests assume that the Python environment has been set up in such a way that ``import artiq`` will import the code being tested, and that this is still true for any subprocess created. This is not the way setuptools operates as it adds the path to ARTIQ to ``sys.path`` which is not passed to subprocesses; as a result, running the tests via ``setup.py`` is not supported. The user must first install the package or set ``PYTHONPATH``, and then run the tests with e.g. ``python3 -m unittest discover`` in the ``artiq/test`` folder and ``lit .`` in the ``artiq/test/lit`` folder. For the hardware-in-the-loop unit tests, set the ``ARTIQ_ROOT`` environment variable to the path to a device database containing the relevant devices. diff --git a/doc/manual/getting_started_core.rst b/doc/manual/getting_started_core.rst index 4db851c11..7658b06e9 100644 --- a/doc/manual/getting_started_core.rst +++ b/doc/manual/getting_started_core.rst @@ -28,7 +28,7 @@ Copy the file ``device_db.pyon`` (containing the device database) from the ``exa .. note:: To obtain the examples, you can find where the ARTIQ package is installed on your machine with: :: - python3.5 -c "import artiq; print(artiq.__path__[0])" + python3 -c "import artiq; print(artiq.__path__[0])" Run your code using ``artiq_run``, which is part of the ARTIQ front-end tools: :: diff --git a/doc/manual/getting_started_mgmt.rst b/doc/manual/getting_started_mgmt.rst index 3c4e04ddd..154626e14 100644 --- a/doc/manual/getting_started_mgmt.rst +++ b/doc/manual/getting_started_mgmt.rst @@ -155,7 +155,7 @@ Commit, push and submit the experiment as before. Go to the "Datasets" dock of t Plotting in the ARTIQ dashboard is achieved by programs called "applets". Applets are independent programs that add simple GUI features and are run as separate processes (to achieve goals of modularity and resilience against poorly written applets). Users may write their own applets, or use those supplied with ARTIQ (in the ``artiq.applets`` module) that cover basic plotting. -Applets are configured through their command line to select parameters such as the names of the datasets to plot. The list of command-line options can be retrieved using the ``-h`` option; for example you can run ``python3.5 -m artiq.applets.plot_xy -h`` in a terminal. +Applets are configured through their command line to select parameters such as the names of the datasets to plot. The list of command-line options can be retrieved using the ``-h`` option; for example you can run ``python3 -m artiq.applets.plot_xy -h`` in a terminal. In our case, create a new applet from the XY template by right-clicking on the applet list, and edit the applet command line so that it retrieves the ``parabola`` dataset. Run the experiment again, and observe how the points are added one by one to the plot. diff --git a/doc/manual/installing_from_source.rst b/doc/manual/installing_from_source.rst index 9db43a53b..9fdcb1de6 100644 --- a/doc/manual/installing_from_source.rst +++ b/doc/manual/installing_from_source.rst @@ -101,7 +101,7 @@ These steps are required to generate gateware bitstream (``.bit``) files, build $ cd ~/artiq-dev $ git clone https://github.com/m-labs/migen $ cd migen - $ python3.5 setup.py develop --user + $ python3 setup.py develop --user .. note:: The options ``develop`` and ``--user`` are for setup.py to install Migen in ``~/.local/lib/python3.5``. @@ -127,28 +127,28 @@ These steps are required to generate gateware bitstream (``.bit``) files, build $ cd ~/artiq-dev $ git clone https://www.github.com/m-labs/asyncserial $ cd asyncserial - $ python3.5 setup.py develop --user + $ python3 setup.py develop --user * Download and install MiSoC: :: $ cd ~/artiq-dev $ git clone --recursive https://github.com/m-labs/misoc $ cd misoc - $ python3.5 setup.py develop --user + $ python3 setup.py develop --user * Download and install ``pythonparser``: :: $ cd ~/artiq-dev $ git clone https://www.github.com/m-labs/pythonparser $ cd pythonparser - $ python3.5 setup.py develop --user + $ python3 setup.py develop --user * Download and install ARTIQ: :: $ cd ~/artiq-dev $ git clone --recursive https://github.com/m-labs/artiq $ cd artiq - $ python3.5 setup.py develop --user + $ python3 setup.py develop --user .. note:: If you have any trouble during ARTIQ setup about ``pygit2`` installation, @@ -166,11 +166,11 @@ These steps are required to generate gateware bitstream (``.bit``) files, build * For Pipistrello:: - $ python3.5 -m artiq.gateware.targets.pipistrello + $ python3 -m artiq.gateware.targets.pipistrello * For KC705:: - $ python3.5 -m artiq.gateware.targets.kc705_dds -H nist_clock # or nist_qc2 + $ python3 -m artiq.gateware.targets.kc705_dds -H nist_clock # or nist_qc2 .. note:: Add ``--toolchain ise`` if you wish to use ISE instead of Vivado. @@ -211,14 +211,14 @@ Installing the host-side software $ git clone https://github.com/m-labs/llvmlite $ cd llvmlite $ git checkout artiq-3.9 - $ LLVM_CONFIG=/usr/local/llvm-or1k/bin/llvm-config python3.5 setup.py install --user + $ LLVM_CONFIG=/usr/local/llvm-or1k/bin/llvm-config python3 setup.py install --user * Install ARTIQ: :: $ cd ~/artiq-dev $ git clone --recursive https://github.com/m-labs/artiq # if not already done $ cd artiq - $ python3.5 setup.py develop --user + $ python3 setup.py develop --user .. note:: If you have any trouble during ARTIQ setup about ``pygit2`` installation, @@ -226,19 +226,19 @@ Installing the host-side software On Ubuntu 14.04:: - $ python3.5 `which pip3` install --user pygit2==0.19.1 + $ python3 `which pip3` install --user pygit2==0.19.1 On Ubuntu 14.10:: - $ python3.5 `which pip3` install --user pygit2==0.20.3 + $ python3 `which pip3` install --user pygit2==0.20.3 On Ubuntu 15.04 and 15.10:: - $ python3.5 `which pip3` install --user pygit2==0.22.1 + $ python3 `which pip3` install --user pygit2==0.22.1 On Ubuntu 16.04:: - $ python3.5 `which pip3` install --user pygit2==0.24.1 + $ python3 `which pip3` install --user pygit2==0.24.1 The rationale behind this is that pygit2 and libgit2 must have the same major.minor version numbers. diff --git a/setup.py b/setup.py index a2148cb28..6cf55892a 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 from setuptools import setup, find_packages import sys