diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-20 03:38:13 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-20 03:38:13 +0000 |
commit | 2598d287b49a537f3a012256337a3fe489299846 (patch) | |
tree | ac5b1314d47786171ccb56459462de7dc99b9ddc | |
parent | 40ce3ad8e00015fdb6821b063d9861f92b4fb4de (diff) |
automatic import of python-pybricksdevopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pybricksdev.spec | 565 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 567 insertions, 0 deletions
@@ -0,0 +1 @@ +/pybricksdev-1.0.0a46.tar.gz diff --git a/python-pybricksdev.spec b/python-pybricksdev.spec new file mode 100644 index 0000000..63e4c06 --- /dev/null +++ b/python-pybricksdev.spec @@ -0,0 +1,565 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pybricksdev +Version: 1.0.0a46 +Release: 1 +Summary: Pybricks developer tools +License: MIT +URL: https://pybricks.com +Source0: https://mirrors.aliyun.com/pypi/web/packages/18/08/9db8cb113079bc9d83a3fb3d3f86774f93cd6820f573b1f397ab7c9f5812/pybricksdev-1.0.0a46.tar.gz +BuildArch: noarch + +Requires: python3-aioserial +Requires: python3-argcomplete +Requires: python3-asyncssh +Requires: python3-bleak +Requires: python3-mpy-cross-v5 +Requires: python3-tqdm +Requires: python3-validators +Requires: python3-pyusb +Requires: python3-semver +Requires: python3-appdirs +Requires: python3-prompt-toolkit +Requires: python3-mpy-cross-v6 +Requires: python3-packaging +Requires: python3-typing-extensions +Requires: python3-reactivex +Requires: python3-hidapi + +%description +[](https://coveralls.io/github/pybricks/pybricksdev?branch=master) [](https://docs.pybricks.com/projects/pybricksdev/en/latest/?badge=latest) + +# Pybricks tools & interface library + +This is a package with tools for Pybricks developers. For regular users we +recommend the [Pybricks Code][code] web IDE. + +This package contains both command line tools and a library to call equivalent +operations from within a Python script. + +[code]: https://www.code.pybricks.com + +## Installation + +### Python Runtime + +`pybricksdev` requires Python 3.8 or higher. + +- For Windows, use the [official Python installer][py-dl] or the [Windows Store][py38-win]. +- For Mac, use the [official Python installer][py-dl] or Homebrew (`brew install python@3.8`). +- For Linux, use the distro provided `python3.8` or if not available, use a Python + runtime version manager such as [asdf][asdf] or [pyenv][pyenv]. + + +[py-dl]: https://www.python.org/downloads/ +[py38-win]: https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l +[asdf]: https://asdf-vm.com +[pyenv]: https://github.com/pyenv/pyenv + +### Command Line Tool + +We recommend using [pipx] to run `pybricksdev` as a command line tool. This +ensures that you are always running the latest version of `pybricksdev`. + +We also highly recommend installing `pipx` using a package manager such as `apt`, +`brew`, etc. as suggested in the official [pipx installation] instructions. + +Then use `pipx` to run `pybricksdev`: + + pipx run pybricksdev ... + +[pipx]: https://pipxproject.github.io/pipx/ +[pipx installation]: https://pipxproject.github.io/pipx/installation/ + + +If you don't like typing `pipx run ...` all of the time, you can install +`pybrickdev` with: + + pipx install pybricksdev + +Then you can just type: + + pybricksdev run ... + +And check for updates with: + + pipx upgrade pybricksdev + +#### Windows users + +If you are using the *Python Launcher for Windows* (installed by default with +the official Python installer), then you will need to use `py -3` instead +of `python3`. + + py -3 -m pip install --upgrade pip # ensure pip is up to date first + py -3 -m pip install pipx + py -3 -m pipx run pybricksdev ... + +#### Linux USB + +On Linux, `udev` rules are needed to allow access via USB. The `pybricksdev` +command line tool contains a function to generate the required rules. Run the +following: + + pipx run pybricksdev udev | sudo tee /etc/udev/rules.d/99-pybricksdev.rules + +### Library + +To install `pybricksdev` as a library, we highly recommend using a virtual +environment for your project. Our tool of choice for this is [poetry]: + + poetry env use python3.8 + poetry add pybricksdev + +Of course you can always use `pip` as well: + + pip install pybricksdev --pre + + +[poetry]: https://python-poetry.org + + +## Using the Command Line Tool + +The following are some examples of how to use the `pybricksdev` command line tool. +For additional info, run `pybricksdev --help`. + +### Flashing Pybricks MicroPython firmware + +Turn on the hub, and run: + + pipx run pybricksdev flash <firmware.zip> + +Replace `<firmware.zip>` with the actual path to the firmware archive. + +### Running Pybricks MicroPython programs + +This compiles a MicroPython script and sends it to a hub with Pybricks +firmware. + + pipx run pybricksdev run --help + + # + # ble connection examples: + # + + # Run script on any Pybricks device + pipx run pybricksdev run ble demo/shortdemo.py + + # Run script on the first device we find called Pybricks hub + pipx run pybricksdev run ble --name "Pybricks Hub" demo/shortdemo.py + + # Run script on device with address 90:84:2B:4A:2B:75 (doesn't work on Mac) + pipx run pybricksdev run ble --name 90:84:2B:4A:2B:75 demo/shortdemo.py + + # + # usb connection examples: + # NOTE: running programs via usb connection works for official LEGO firmwares only + + # Run script on any Pybricks device + pipx run pybricksdev run usb demo/shortdemo.py + + # + # Other connection examples: + # + + # Run script on ev3dev at 192.168.0.102 + pipx run pybricksdev run ssh --name 192.168.0.102 demo/shortdemo.py + + +### Compiling Pybricks MicroPython programs without running + +This can be used to compile programs. Instead of also running them as above, +it just prints the output on the screen instead. + + pipx run pybricksdev compile demo/shortdemo.py + + pipx run pybricksdev compile "print('Hello!'); print('world!');" + + +This is mainly intended for developers who want to quickly inspect the +contents of the `.mpy` file. To get the actual file, just use `mpy-cross` +directly. We have used this tool in the past to test bare minimum MicroPython +ports that have neither a builtin compiler or any form of I/O yet. You can +paste the generated `const uint8_t script[]` directly ito your C code. + +## Additional Documentation + +https://docs.pybricks.com/projects/pybricksdev (work in progress) + + +%package -n python3-pybricksdev +Summary: Pybricks developer tools +Provides: python-pybricksdev +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pybricksdev +[](https://coveralls.io/github/pybricks/pybricksdev?branch=master) [](https://docs.pybricks.com/projects/pybricksdev/en/latest/?badge=latest) + +# Pybricks tools & interface library + +This is a package with tools for Pybricks developers. For regular users we +recommend the [Pybricks Code][code] web IDE. + +This package contains both command line tools and a library to call equivalent +operations from within a Python script. + +[code]: https://www.code.pybricks.com + +## Installation + +### Python Runtime + +`pybricksdev` requires Python 3.8 or higher. + +- For Windows, use the [official Python installer][py-dl] or the [Windows Store][py38-win]. +- For Mac, use the [official Python installer][py-dl] or Homebrew (`brew install python@3.8`). +- For Linux, use the distro provided `python3.8` or if not available, use a Python + runtime version manager such as [asdf][asdf] or [pyenv][pyenv]. + + +[py-dl]: https://www.python.org/downloads/ +[py38-win]: https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l +[asdf]: https://asdf-vm.com +[pyenv]: https://github.com/pyenv/pyenv + +### Command Line Tool + +We recommend using [pipx] to run `pybricksdev` as a command line tool. This +ensures that you are always running the latest version of `pybricksdev`. + +We also highly recommend installing `pipx` using a package manager such as `apt`, +`brew`, etc. as suggested in the official [pipx installation] instructions. + +Then use `pipx` to run `pybricksdev`: + + pipx run pybricksdev ... + +[pipx]: https://pipxproject.github.io/pipx/ +[pipx installation]: https://pipxproject.github.io/pipx/installation/ + + +If you don't like typing `pipx run ...` all of the time, you can install +`pybrickdev` with: + + pipx install pybricksdev + +Then you can just type: + + pybricksdev run ... + +And check for updates with: + + pipx upgrade pybricksdev + +#### Windows users + +If you are using the *Python Launcher for Windows* (installed by default with +the official Python installer), then you will need to use `py -3` instead +of `python3`. + + py -3 -m pip install --upgrade pip # ensure pip is up to date first + py -3 -m pip install pipx + py -3 -m pipx run pybricksdev ... + +#### Linux USB + +On Linux, `udev` rules are needed to allow access via USB. The `pybricksdev` +command line tool contains a function to generate the required rules. Run the +following: + + pipx run pybricksdev udev | sudo tee /etc/udev/rules.d/99-pybricksdev.rules + +### Library + +To install `pybricksdev` as a library, we highly recommend using a virtual +environment for your project. Our tool of choice for this is [poetry]: + + poetry env use python3.8 + poetry add pybricksdev + +Of course you can always use `pip` as well: + + pip install pybricksdev --pre + + +[poetry]: https://python-poetry.org + + +## Using the Command Line Tool + +The following are some examples of how to use the `pybricksdev` command line tool. +For additional info, run `pybricksdev --help`. + +### Flashing Pybricks MicroPython firmware + +Turn on the hub, and run: + + pipx run pybricksdev flash <firmware.zip> + +Replace `<firmware.zip>` with the actual path to the firmware archive. + +### Running Pybricks MicroPython programs + +This compiles a MicroPython script and sends it to a hub with Pybricks +firmware. + + pipx run pybricksdev run --help + + # + # ble connection examples: + # + + # Run script on any Pybricks device + pipx run pybricksdev run ble demo/shortdemo.py + + # Run script on the first device we find called Pybricks hub + pipx run pybricksdev run ble --name "Pybricks Hub" demo/shortdemo.py + + # Run script on device with address 90:84:2B:4A:2B:75 (doesn't work on Mac) + pipx run pybricksdev run ble --name 90:84:2B:4A:2B:75 demo/shortdemo.py + + # + # usb connection examples: + # NOTE: running programs via usb connection works for official LEGO firmwares only + + # Run script on any Pybricks device + pipx run pybricksdev run usb demo/shortdemo.py + + # + # Other connection examples: + # + + # Run script on ev3dev at 192.168.0.102 + pipx run pybricksdev run ssh --name 192.168.0.102 demo/shortdemo.py + + +### Compiling Pybricks MicroPython programs without running + +This can be used to compile programs. Instead of also running them as above, +it just prints the output on the screen instead. + + pipx run pybricksdev compile demo/shortdemo.py + + pipx run pybricksdev compile "print('Hello!'); print('world!');" + + +This is mainly intended for developers who want to quickly inspect the +contents of the `.mpy` file. To get the actual file, just use `mpy-cross` +directly. We have used this tool in the past to test bare minimum MicroPython +ports that have neither a builtin compiler or any form of I/O yet. You can +paste the generated `const uint8_t script[]` directly ito your C code. + +## Additional Documentation + +https://docs.pybricks.com/projects/pybricksdev (work in progress) + + +%package help +Summary: Development documents and examples for pybricksdev +Provides: python3-pybricksdev-doc +%description help +[](https://coveralls.io/github/pybricks/pybricksdev?branch=master) [](https://docs.pybricks.com/projects/pybricksdev/en/latest/?badge=latest) + +# Pybricks tools & interface library + +This is a package with tools for Pybricks developers. For regular users we +recommend the [Pybricks Code][code] web IDE. + +This package contains both command line tools and a library to call equivalent +operations from within a Python script. + +[code]: https://www.code.pybricks.com + +## Installation + +### Python Runtime + +`pybricksdev` requires Python 3.8 or higher. + +- For Windows, use the [official Python installer][py-dl] or the [Windows Store][py38-win]. +- For Mac, use the [official Python installer][py-dl] or Homebrew (`brew install python@3.8`). +- For Linux, use the distro provided `python3.8` or if not available, use a Python + runtime version manager such as [asdf][asdf] or [pyenv][pyenv]. + + +[py-dl]: https://www.python.org/downloads/ +[py38-win]: https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l +[asdf]: https://asdf-vm.com +[pyenv]: https://github.com/pyenv/pyenv + +### Command Line Tool + +We recommend using [pipx] to run `pybricksdev` as a command line tool. This +ensures that you are always running the latest version of `pybricksdev`. + +We also highly recommend installing `pipx` using a package manager such as `apt`, +`brew`, etc. as suggested in the official [pipx installation] instructions. + +Then use `pipx` to run `pybricksdev`: + + pipx run pybricksdev ... + +[pipx]: https://pipxproject.github.io/pipx/ +[pipx installation]: https://pipxproject.github.io/pipx/installation/ + + +If you don't like typing `pipx run ...` all of the time, you can install +`pybrickdev` with: + + pipx install pybricksdev + +Then you can just type: + + pybricksdev run ... + +And check for updates with: + + pipx upgrade pybricksdev + +#### Windows users + +If you are using the *Python Launcher for Windows* (installed by default with +the official Python installer), then you will need to use `py -3` instead +of `python3`. + + py -3 -m pip install --upgrade pip # ensure pip is up to date first + py -3 -m pip install pipx + py -3 -m pipx run pybricksdev ... + +#### Linux USB + +On Linux, `udev` rules are needed to allow access via USB. The `pybricksdev` +command line tool contains a function to generate the required rules. Run the +following: + + pipx run pybricksdev udev | sudo tee /etc/udev/rules.d/99-pybricksdev.rules + +### Library + +To install `pybricksdev` as a library, we highly recommend using a virtual +environment for your project. Our tool of choice for this is [poetry]: + + poetry env use python3.8 + poetry add pybricksdev + +Of course you can always use `pip` as well: + + pip install pybricksdev --pre + + +[poetry]: https://python-poetry.org + + +## Using the Command Line Tool + +The following are some examples of how to use the `pybricksdev` command line tool. +For additional info, run `pybricksdev --help`. + +### Flashing Pybricks MicroPython firmware + +Turn on the hub, and run: + + pipx run pybricksdev flash <firmware.zip> + +Replace `<firmware.zip>` with the actual path to the firmware archive. + +### Running Pybricks MicroPython programs + +This compiles a MicroPython script and sends it to a hub with Pybricks +firmware. + + pipx run pybricksdev run --help + + # + # ble connection examples: + # + + # Run script on any Pybricks device + pipx run pybricksdev run ble demo/shortdemo.py + + # Run script on the first device we find called Pybricks hub + pipx run pybricksdev run ble --name "Pybricks Hub" demo/shortdemo.py + + # Run script on device with address 90:84:2B:4A:2B:75 (doesn't work on Mac) + pipx run pybricksdev run ble --name 90:84:2B:4A:2B:75 demo/shortdemo.py + + # + # usb connection examples: + # NOTE: running programs via usb connection works for official LEGO firmwares only + + # Run script on any Pybricks device + pipx run pybricksdev run usb demo/shortdemo.py + + # + # Other connection examples: + # + + # Run script on ev3dev at 192.168.0.102 + pipx run pybricksdev run ssh --name 192.168.0.102 demo/shortdemo.py + + +### Compiling Pybricks MicroPython programs without running + +This can be used to compile programs. Instead of also running them as above, +it just prints the output on the screen instead. + + pipx run pybricksdev compile demo/shortdemo.py + + pipx run pybricksdev compile "print('Hello!'); print('world!');" + + +This is mainly intended for developers who want to quickly inspect the +contents of the `.mpy` file. To get the actual file, just use `mpy-cross` +directly. We have used this tool in the past to test bare minimum MicroPython +ports that have neither a builtin compiler or any form of I/O yet. You can +paste the generated `const uint8_t script[]` directly ito your C code. + +## Additional Documentation + +https://docs.pybricks.com/projects/pybricksdev (work in progress) + + +%prep +%autosetup -n pybricksdev-1.0.0a46 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pybricksdev -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.0a46-1 +- Package Spec generated @@ -0,0 +1 @@ +dd6e8e9f24511d26f48bcdd46f548449 pybricksdev-1.0.0a46.tar.gz |