|
14 | 14 |
|
15 | 15 | [Zenodo]: https://zenodo.org |
16 | 16 |
|
| 17 | +[umsdk]: https://github.com/sensapex/umsdk |
| 18 | +[sensapex-py]: https://github.com/sensapex/sensapex-py |
| 19 | + |
17 | 20 | [//]: # (Badges) |
| 21 | +[//]: # ([](https://zenodo.org/badge/latestdoi/370470893)) |
| 22 | +[//]: # ([](https://pypi.org/project/templatepy)) |
| 23 | +[//]: # ([](https://pypi.org/project/templatepy)) |
| 24 | +[//]: # () |
18 | 25 |
|
19 | | -[](https://github.com/larsrollik/templatepy/blob/main/CONTRIBUTING.md) |
20 | | -[](https://zenodo.org/badge/latestdoi/370470893) |
21 | | -[](https://github.com/larsrollik/templatepy) |
22 | | -[](https://pypi.org/project/templatepy) |
23 | | -[](https://pypi.org/project/templatepy) |
24 | | - |
| 26 | +[](https://github.com/larsrollik/sensapex_api/blob/main/CONTRIBUTING.md) |
| 27 | +[](https://github.com/larsrollik/sensapex_api) |
25 | 28 | [](https://github.com/python/black) |
26 | 29 | [](https://github.com/pre-commit/pre-commit) |
27 | 30 |
|
28 | 31 |
|
29 | | -# templatepy |
30 | | -Template repo for python repositories & PyPi integration |
| 32 | +# sensapex-api |
| 33 | +Meta-API for Sensapex Manipulators from uMx family. |
31 | 34 | --- |
32 | | -**Version: "0.0.3"** |
33 | | - |
34 | | - |
35 | | -## Usage |
36 | | -1. **Change** files according to overview in `TODO` below |
37 | | -2. **Develop** package... |
38 | | -3. **Install** package: |
39 | | - - static/normal install: `pip install .` |
40 | | - - editable install:`pip install -e .` |
41 | | - - dev install: `pip install -e .[dev]` (some terminals require to escape brackets with ` \ ` as `\[`, esp. zsh) |
42 | | - |
43 | | - |
44 | | - |
45 | | -## File overview |
46 | | - |
47 | | - |
48 | | -#### General |
49 | | -- `LICENSE`: license text |
50 | | - |
51 | | -- `README.md`: [Github-flavored markdown] file |
52 | | - |
53 | | -- `templatepy`: placeholder folder for any python package that is configured for install via `setup.cfg` and `pyproject.toml` |
54 | | - - `__init__.py`: contains basic package info and example function that is called by console entrypoint (see `setup.cfg`) |
55 | | - - `example.data.file.config`: a file to demonstrate that data files are included based on `setup.cfg` criteria |
56 | | - - `example.data.file.test-extension-yu48`: a file to demonstrate data exclusion via `setup.py` |
57 | | - |
58 | | - |
59 | | -#### Testing |
60 | | -- `tests`: placeholder folder for unit/integration tests and associated data |
61 | | -- `pytest.ini`: config for testing framework with `pytest` and `coverage` plugin (`pytest-cov`) |
62 | | - |
63 | | - |
64 | | -#### Packaging system (see: [packaging] and [setup.cfg]) |
65 | | - - `MANIFEST.in`: [manifest] file describes included/excluded files for build |
| 35 | +**Version: "0.0.1"** |
66 | 36 |
|
67 | | - - `pyproject.toml`: |
68 | | - - specifies build system: this replaces the usual `setup.py` architecture for setuptools |
69 | | - - config for [black] code formatter |
| 37 | +This is a meta-API for the Sensapex Python API, which is in turn a binding for the underlying C library. |
70 | 38 |
|
71 | | - - `setup.cfg`: |
72 | | - - package specification and install dependencies |
73 | | - - config for `flake8` formatting (see pre-commit) |
| 39 | +See underlying library and sources from Sensapex here: |
| 40 | +- [umsdk] library |
| 41 | +- [sensapex-py] |
74 | 42 |
|
75 | | - - `setup.py`: legacy file (see notes on new build-system below) |
| 43 | +## Functionality |
| 44 | +- Set relative zero position for one or all axes |
| 45 | +- Convenience methods to move signle axes (instead of giving vector for all axis, even if only intending to move one axis) |
76 | 46 |
|
| 47 | +-> See `examples` folder for usage of the relative positioning on one or all axes. |
77 | 48 |
|
78 | | -#### Code maintenance (linting/formatting/github) |
79 | | -- `.pre-commit-config.yaml`: use [pre-commit] to run code formatting (e.g. with [black] and `flake8`) and PEP compliance checks |
80 | | - - Install pre-commit hook with `pre-commit install` (Note: only installs it in the current virtual environment) |
81 | | - - Run it manually with `pre-commit run --all` or leave it to run on commit (requires to re-stage changed files!) |
82 | | - |
83 | | -- `.github`: folder that contains github automation workflows and issues templates |
84 | | - |
85 | | -- `.gitignore`: ignored files/folders in git tools |
86 | | - |
87 | | -- `.bumpversion.cfg`: config for [bump2version] |
88 | | - |
89 | | - |
90 | | -## TODO for **adapting** template to new project |
91 | | - |
92 | | -- [ ] Change package name: |
93 | | - - (1) `templatepy` folder |
94 | | - - (2) README.md |
95 | | - - (3) `name` argument in `setup.cfg` |
96 | | - - (4) `.github/workflows` files |
97 | | - - (5) `setup.cfg`: `[bumpversion:file:templatepy/__init__.py]` |
98 | | -- [ ] Change details about project author, etc. in `setup.cfg`, `README.md`, and `templatepy/__init__.py` |
99 | | -- [ ] Change license holder in `LICENSE` |
100 | | -- [ ] Change `README` badge paths at top |
101 | | -- [ ] Verify inclusions/exclusions of installable files/folders in `MANIFEST.in` and `setup.cfg` |
102 | | -- [ ] Check `.gitignore` contains relevant criteria |
103 | | -- [ ] Add all version string locations to `setup.cfg`/bump2version field. |
104 | | - - Use same syntax as for `[bumpversion:file:PACKAGEFOLDER/__init__.py]` line to describe how to find version on version increment |
105 | | -- [ ] To upload to [pypi]: see below for workflow |
106 | | -- [ ] To upload to [Zenodo] if repo is a publication: |
107 | | - - (1) Connect Zenodo to Github account |
108 | | - - (2) Flip switch on zenodo view of repo - **NOTE**: Zenodo can only copy from **public** repos |
109 | | - - (3) Create new release version of github repo (manual or via `.github/workflows/CI.yaml`) |
110 | | - - (4) Wait! Zenodo view with DOI assignment should update within about a minute |
111 | | - - (5) Add DOI badge to `README` file |
112 | | - |
113 | | - |
114 | | - |
115 | | -## Workflow for (automatically) uploading package to [pypi] or [test.pypi] |
116 | | -- (1) On [pypi], make new API key for repo or general |
117 | | -- (2) On [Github](https://github.com/larsrollik/templatepy/settings/secrets/actions/new), in repository settings add a new **actions secret** named `TWINE_API_KEY` and copy in the pypi API key |
118 | | -- (3) Create a new [release](https://github.com/larsrollik/templatepy/releases/new) manually on github or by triggering the github workflow with a version without release extension (e.g. `x.y.z`) |
119 | | - |
120 | | - |
121 | | - |
122 | | -## Notes |
123 | | - |
124 | | -#### New(er) build system with `pyproject.toml` and `setup.cfg` |
125 | | -- `pip` |
126 | | - - tested with `pip install . --use-feature=in-tree-build` for forward-compatibility with `pip 21.3` |
127 | | - - keeping empty `setup.py` for enabling install in editable mode `-e` as this still requires such a file |
128 | | - - added `wheel` as build-system dependency for compatibility with pip that does not implement `PEP 517` |
129 | | -- `setup.cfg`/`setup.py` might be fully replaced with `pyproject.toml`. [See this discussion](https://stackoverflow.com/questions/44878600/is-setup-cfg-deprecated) about [PEP-426](https://peps.python.org/pep-0426/), [PEP-517](https://peps.python.org/pep-0517), [PEP-518](https://peps.python.org/pep-0518) |
| 49 | +## Install |
| 50 | +1. Clone repo: `git clone https://github.com/larsrollik/sensapex-api.git` |
| 51 | +2. Install package: `pip install sensapex-api` |
| 52 | +3. Install sensapex UM SDK library |
| 53 | + 1. Follow method in original repo: [umsdk] library |
| 54 | + 2. or use version of `install_lib.sh` script (in this repo) |
130 | 55 |
|
| 56 | +## Dependencies |
| 57 | +- [sensapex-py] package that can be installed from [sensapex-py] or via `pip install sensapex` |
| 58 | +- [umsdk] library |
131 | 59 |
|
132 | 60 | ## Contributing |
133 | 61 | Contributions are very welcome! |
134 | 62 | Please see the [contribution guidelines](https://github.com/larsrollik/templatepy/blob/main/CONTRIBUTING.md) or check out the [issues](https://github.com/larsrollik/templatepy/issues) |
135 | 63 |
|
136 | 64 | ## License |
137 | | -This software is released under the **[BSD 3-Clause License](https://github.com/larsrollik/templatepy/blob/main/LICENSE)** |
138 | | - |
139 | | - |
140 | | -```shell |
141 | | -wget -q -O tmp.zip http://dist.sensapex.com/misc/um-sdk/latest/umsdk-1_022-src.zip \ |
142 | | - && unzip tmp.zip \ |
143 | | - && rm tmp.zip \ |
144 | | - && cd umsdk-1_022/src/lib/ \ |
145 | | - && make -f Makefile.linux |
146 | | - |
147 | | -sudo make -f Makefile.linux install |
148 | | -echo $PWD |
149 | | -``` |
| 65 | +This software is released under the **[BSD 3-Clause License](https://github.com/larsrollik/templatepy/blob/main/LICENSE)**. |
| 66 | + |
| 67 | +This code is an abstraction layer on top of the MIT-licensed [sensapex-py] and the [umsdk]. |
0 commit comments