|
| 1 | +# encoding=utf-8 |
| 2 | +from __future__ import print_function |
| 3 | +import sys |
| 4 | + |
| 5 | +PYTHON_VERSION = sys.version_info[:2] |
| 6 | +if (2, 7) != PYTHON_VERSION < (3, 5): |
| 7 | + print("This mycobot version requires Python2.7, 3.5 or later.") |
| 8 | + sys.exit(1) |
| 9 | + |
| 10 | +import setuptools |
| 11 | +import textwrap |
| 12 | +import pymycobot |
| 13 | + |
| 14 | +try: |
| 15 | + long_description = ( |
| 16 | + open("README.md", encoding="utf-8").read() |
| 17 | + + open("docs/README.md", encoding="utf-8").read() |
| 18 | + ) |
| 19 | +except: |
| 20 | + long_description = textwrap.dedent( |
| 21 | + """\ |
| 22 | + # This is Python API for myCobot |
| 23 | +
|
| 24 | + This is a python API for serial communication with mycobot and controlling it. |
| 25 | +
|
| 26 | + [](https://www.elephantrobotics.com/en/myCobot-en/) |
| 27 | +
|
| 28 | + ## Installation |
| 29 | +
|
| 30 | + **Notes**: |
| 31 | +
|
| 32 | + > Make sure that `Atom` is flashed into the top Atom, `Transponder` is flashed into the base Basic. <br> |
| 33 | + > The firmware `Atom` and `Transponder` download address: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)<br> |
| 34 | + > You also can use myStudio to flash them, myStudio address: [https://github.com/elephantrobotics/myStudio/releases](https://github.com/elephantrobotics/myStudio/releases) |
| 35 | +
|
| 36 | + ### Pip |
| 37 | +
|
| 38 | + ```bash |
| 39 | + pip install pymycobot --upgrade |
| 40 | + ``` |
| 41 | +
|
| 42 | + ### Source code |
| 43 | +
|
| 44 | + ```bash |
| 45 | + git clone https://github.com/elephantrobotics/pymycobot.git <your-path> |
| 46 | + cd <your-path>/pymycobot |
| 47 | + # Install |
| 48 | + [sudo] python2 setup.py install |
| 49 | + # or |
| 50 | + [sudo] python3 setup.py install |
| 51 | + ``` |
| 52 | +
|
| 53 | + ## Usage: |
| 54 | +
|
| 55 | + ```python |
| 56 | + from pymycobot import MyCobot, Angle, Coord |
| 57 | + from pymycobot import PI_PORT, PI_BAUD # For raspberry pi version of mycobot. |
| 58 | + ``` |
| 59 | +
|
| 60 | + The [`demo`](./demo) directory stores some test case files. |
| 61 | +
|
| 62 | + You can find out which interfaces pymycobot provides in `pymycobot/README.md`. |
| 63 | +
|
| 64 | + Please go to [here](./docs/README.md). |
| 65 | + """ |
| 66 | + ) |
| 67 | + |
| 68 | +setuptools.setup( |
| 69 | + name="pymycobot", |
| 70 | + version=pymycobot.__version__, |
| 71 | + author=pymycobot.__author__, |
| 72 | + author_email=pymycobot.__email__, |
| 73 | + description="Python API for serial communication of MyCobot.", |
| 74 | + long_description=long_description, |
| 75 | + long_description_content_type="text/markdown", |
| 76 | + url=pymycobot.__git_url__, |
| 77 | + packages=setuptools.find_packages(), |
| 78 | + classifiers=[ |
| 79 | + "Programming Language :: Python :: 2.7", |
| 80 | + "Programming Language :: Python :: 3.5", |
| 81 | + "Programming Language :: Python :: 3.6", |
| 82 | + "Programming Language :: Python :: 3.7", |
| 83 | + "Programming Language :: Python :: 3.8", |
| 84 | + "Programming Language :: Python :: 3.9", |
| 85 | + "License :: OSI Approved :: MIT License", |
| 86 | + "Operating System :: OS Independent", |
| 87 | + ], |
| 88 | + install_requires=["pyserial"], |
| 89 | + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*", |
| 90 | +) |
0 commit comments