Skip to content

Commit 729d29a

Browse files
authored
Develop (#6)
* Refactoring base classes; new parser and parser tests. * Refactoring base classes; New base classes for resources and objects. * Base class refactoring #3. * Proper session handling; added unit test cases. * Fixed handling of empty results for get/post/put. * Improved header preparation/handling. * Added general integration testing fixture; Added .env file support. * Base class refactoring; new structure for SimpleObject and ComplexObject and their respective parsers; Added base classes unit tests. * Model base class improvements; Updated Measurement object model and tests. * Model base class improvements. * Module structure improvements; Model base class improvements - generic CRUD functions support additional resource spec; Fixed parser: False boolean fields were skipped always; User/Users implementation cleanup + base class adjustments; Adding integration tests for User/Users; Adding unit tests for User class; Added common test utils. * Updated measurements API; Fixed select by series; Added integration/unit tests; Fixed on-creation definition of fragments for Devices/ManagedObjects. * Default accept header can now be removed; Base API improvements + documentation. * Added application key header tests. * Base model/parsing improvements; Consolidation of ManagedObject, Device, Measurements. * Doc fixes. * Fixed device registry logging/initialization and added integration test cases. * Parsing improvements to prevent not updatable fields from being part of the full json. * Improved base class typing and handling of paths in derived classes; Cleansed GlobalRole model implementation; Adoption or User to new principles; Fixed factories for integration tests. * Added generic object factory for broader use in integration tests. * Added functionality to add/remove users and permissions from a global role. * Updated/improved Events API. * Fixed apply_to functionality. * Long due refactoring of json parse/format; updated documentation strings. * Updated/improved alarms API. * Added apply_by and count functions to Alarms API. * Documentation and cleanup. * Moved Identity API to separate file; Added test cases. * Fixed Binaries API; added tests. * Documentation update. * Added body/params to delete. * Fixed imports; Added devicegroups API. * Removed last_updated properties as it is already covered with update_time. * Added safe_executor. * Fixed handling of revert parameter. * Fixed devicegroups; added integration tests. * Fixed protected access, more consistent update handling. * Added documentation. * Moved ManagedObject classes to separate file. * Improved documentation. * Introducing Invoke; improved tag-based versioning. * Removed obsolete utils.py. * Fixed logging; fixed circular import from Identiy API. * Removed outdated samples. * Fixed applications. * Added encoding to file open statements. * Added argument hints. * Fixed documentation. * Fixed documentation. * Fixed inventory roles implementation. * Small documentation fixes; Added update_password functionality; Fixed inventory assignments. * Linting fixes. * Removed samples folder from linting; ignoring import errors. * Prepare release.
1 parent 594bea0 commit 729d29a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+7866
-3574
lines changed

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
pip install pylint
2020
- name: Analysing the code with pylint
2121
run: |
22-
pylint --rcfile pylintrc --fail-under=9 c8y_api sample tests integration_tests
22+
pylint --rcfile pylintrc --fail-under=9 c8y_api tests integration_tests

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ venv
88
venv-linux
99
venv-win
1010
*.egg-info
11-
11+
.env
12+
_version.py
13+
wordlist.txt

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,42 @@ python3 -m venv venv
2121
source venv/bin/activate
2222
```
2323

24-
### Installation using pip
24+
### Installation from PyPI
2525

26-
The module is released as standard Python wheel (_.whl_ file). It can be
27-
installed using pip using the following command:
26+
The recommended way is to install the lastest distribution package directly from the Python Package Index (PyPI).
27+
You can either add _c8y_api_ as a dependency to your project using _setup.cfg_, or install it manually:
2828

29+
```shell
30+
pip install c8y_api
2931
```
32+
33+
### Installation using pip
34+
35+
Releases are also archived within the GitHub releases page. The module is released as standard Python wheel (_.whl_ file).
36+
It can be ownloaded and installed using pip using the following command:
37+
38+
```shell
3039
pip install <release wheel file>
3140
```
3241

33-
This will install all necessary dependencies automatically. For your
34-
references, the module's dependencies are also listed in file _requirements.txt_.
42+
Like installing from PyPI, this will install all necessary dependencies automatically. For your
43+
reference, the module's dependencies are also listed in file _requirements.txt_.
3544

3645
### Manual installation
3746

38-
The module sources can be used directly within your Python 3 project. Simply
39-
copy the _c8y_api_ folder to your sources root and install the requirements by
40-
running the following command. The _requirements.txt_ file is part of the sources.
47+
Alternatively, you can clone the repository. The module sources can be used directly within your Python 3 project.
48+
Simply copy the _c8y_api_ folder to your sources root and install the requirements by running the following command:
4149

42-
```
50+
```shell
4351
pip3 install -r requirements.txt
4452
```
4553

54+
The _requirements.txt_ file is part of the sources.
55+
4656
If the _c8y_api_ folder is in your sources root folder all imports should
4757
work right away. Alternatively you can add _c8y_api_ to your _PYHTONPATH_:
4858

49-
```
59+
```shell
5060
export PYTHONPATH=<project-root>/c8y_api; $PYTHONPATH
5161
```
5262

0 commit comments

Comments
 (0)