Skip to content

Commit

Permalink
Release v1.1
Browse files Browse the repository at this point in the history
commit 32287c6
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:36:51 2024 +0400

    Debug CICD

commit 3ec68c0
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:35:21 2024 +0400

    Debug CICD

commit a78fad2
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:34:55 2024 +0400

    Debug CICD

commit 7c49a28
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:27:31 2024 +0400

    Debug CICD

commit 7eef921
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:25:40 2024 +0400

    Debug CICD

commit f6f025d
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:15:07 2024 +0400

    Debug CICD

commit ca96032
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:14:19 2024 +0400

    Debug CICD

commit 8a5da3c
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:11:37 2024 +0400

    Debug CICD

commit 33e73b9
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:10:20 2024 +0400

    Debug CICD

commit b710aaa
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:05:44 2024 +0400

    Debug CICD

commit a61c393
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Nov 9 12:05:36 2024 +0400

    Minor fixes docs

commit ea4f18c
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:49:21 2024 +0400

    Debug CICD

commit df86c3b
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:47:32 2024 +0400

    Debug CICD

commit 5b5847b
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:41:59 2024 +0400

    Debug CICD

commit 52192ee
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:38:04 2024 +0400

    Debug CICD

commit 90074cb
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:33:04 2024 +0400

    Debug CICD

commit 2c5ec82
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:30:31 2024 +0400

    Debug CICD

commit 9705298
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:25:18 2024 +0400

    Debug CICD

commit 19180ed
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 22:24:35 2024 +0400

    Debug CICD

commit 5efc53c
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 21:38:55 2024 +0400

    Debug CICD

commit 4d57dae
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Nov 4 21:27:19 2024 +0400

    Fix ValueError on extra if extra field appeared in SearchDevices response (#8)

commit 8d7f997
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 20:47:25 2024 +0400

    Add changelog

commit b522a5d
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 20:20:10 2024 +0400

    Debug CICD

commit 25e55f0
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 20:08:16 2024 +0400

    Fix lint

commit 5a254de
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 20:01:14 2024 +0400

    Add IP/MAC address validation

commit 741ef4b
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 19:38:06 2024 +0400

    Prevent print traceback on ZKSDK error

commit a8b90d3
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 19:30:52 2024 +0400

    Debug CICD

commit cbb8a3a
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 19:18:13 2024 +0400

    Debug CICD

commit 085277f
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 19:12:13 2024 +0400

    Debug CICD

commit f24dfc2
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 19:11:48 2024 +0400

    Fix imports

commit 4316df0
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 18:41:03 2024 +0400

    Debug CICD

commit 882e4eb
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 18:37:29 2024 +0400

    Debug CICD

commit 8f14458
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 18:34:36 2024 +0400

    Debug CICD

commit 476413a
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 18:32:57 2024 +0400

    Debug CICD

commit 3e80fdc
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 18:31:33 2024 +0400

    Debug CICD

commit 23aef40
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 18:20:05 2024 +0400

    Debug CICD

commit fbff1a4
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 18:17:36 2024 +0400

    Debug CICD

commit 109cca8
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 17:57:20 2024 +0400

    Debug CICD

commit 778e963
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 17:55:06 2024 +0400

    Debug CICD

commit d71bc45
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 17:53:28 2024 +0400

    Debug CICD

commit 1311f1f
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 17:51:57 2024 +0400

    Debug CICD

commit d860de3
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 17:50:02 2024 +0400

    Debug CICD

commit 1758932
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 17:39:37 2024 +0400

    Minor fix docstrings

commit d0dd726
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 16:52:13 2024 +0400

    Fix fixmes

commit a6379c6
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 16:01:19 2024 +0400

    Fix __str__ methods

commit 955cae4
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 15:56:46 2024 +0400

    Remove the connstr from exceptions

commit 1e659bf
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 14:17:10 2024 +0400

    Revert accepting the connstr from cli args, accept connect options from env vars

commit 0b0d69f
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 12:17:38 2024 +0400

    Fix docs a bit

commit 856d199
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Nov 3 12:15:20 2024 +0400

    Remove commitizen

commit 3df5596
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Tue Oct 29 22:04:04 2024 +0400

    Minor fix

commit 90efae2
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Tue Oct 29 22:01:19 2024 +0400

    Fix cli behavior

commit 4dcb88b
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Tue Oct 29 19:42:52 2024 +0400

    Fix mandatory connect attempt on getting cli help on connect command and subcommands

commit fbecb78
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Oct 26 18:54:44 2024 +0400

    Add docs article about Parameters

commit dd434ae
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Oct 26 18:54:00 2024 +0400

    Fix README

commit b2d7d92
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Oct 26 17:59:45 2024 +0400

    Fix func documentation

commit aa8887c
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Oct 26 17:07:39 2024 +0400

    Refactor docstrings and cli help

commit 9186159
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Wed Oct 23 23:05:09 2024 +0400

    Fix the documentation

commit 1740cc9
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Oct 20 17:53:53 2024 +0400

    Add github actions config

commit facbed2
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Oct 20 17:53:20 2024 +0400

    Fix docs building process

commit caff09d
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sun Oct 20 14:30:32 2024 +0400

    Fix linters

commit a7a537b
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Oct 19 22:52:50 2024 +0400

    Minor fix

commit da85a95
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Oct 19 22:44:15 2024 +0400

    Update gitignore

commit 03a4337
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Sat Oct 19 22:39:35 2024 +0400

    Add `setup` command, fix tests

commit 9c50c2d
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Oct 14 21:22:17 2024 +0400

    fix: Fix checking the platform the command is running on (#11)

commit 7ab5c30
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Mon Oct 14 17:43:35 2024 +0400

    Apply linters

commit 8642b65
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Thu Oct 10 21:07:06 2024 +0400

    Add commitizen

commit c8f7e93
Author: Igor Derkach <gosha753951@gmail.com>
Date:   Thu Oct 10 20:48:26 2024 +0400

    Remove deprecated dependencies, move to poetry
  • Loading branch information
bdragon300 committed Nov 9, 2024
1 parent f5121fa commit 037a4e6
Show file tree
Hide file tree
Showing 60 changed files with 7,114 additions and 4,320 deletions.
4 changes: 0 additions & 4 deletions .coveragerc

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Commit push
on:
push:
workflow_call:
secrets:
codecov_token:
required: true

jobs:
run_tests:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] # All Python versions supported by pyzkaccess
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Install task
run: curl -sL https://taskfile.dev/install.sh | sh
- name: Run task lint
run: ./bin/task lint
118 changes: 118 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Release
on:
push:
tags:
- "v?.?"
branches:
- master

jobs:
commit_checks:
uses: ./.github/workflows/commit.yaml
secrets: # https://stackoverflow.com/questions/78298827/why-is-codecov-upload-step-in-github-actions-not-finding-the-token
codecov_token: ${{ secrets.CODECOV_TOKEN }}
build_docs:
needs: commit_checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'latest'
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: abatilo/actions-poetry@v2
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: poetry install
- name: Install task
run: curl -sL https://taskfile.dev/install.sh | sh
- name: Build markdown with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./_jekyll
- name: Build documentation
run: "./bin/task build_docs -- -c lunr_search=\"{'fuzziness': 1, 'index_docstrings': True}\""
- run: cp -r ./_jekyll/* build/docs/
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/docs

deploy_docs:
needs: build_docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

build_exe:
needs: commit_checks
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
architecture: 'x86'
- uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Install pyinstaller
# Pyinstaller restricts the maximum Python version to use, so install it separately
run: poetry run pip install pyinstaller
- name: Build executable
run: poetry run pyinstaller --name pyzkaccess --onefile pyzkaccess/cli.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pyzkaccess.exe
path: dist/pyzkaccess.exe
if-no-files-found: error

testpypi_publish:
needs: commit_checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: |
pip install yq
poetry install
- run: poetry config repositories.testpypi https://test.pypi.org/legacy/
- name: Substitute dynamic version
run: tomlq -it --arg now $(date +%s) '.tool.poetry.version += "-" + $now' pyproject.toml
- name: Publish package
run: poetry publish -r testpypi --build
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI_TOKEN }}

pypi_publish:
needs: testpypi_publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Publish package
run: poetry publish --build
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down Expand Up @@ -139,8 +139,3 @@ cython_debug/

# IntelliJIDEA/PyCharm
.idea/

# Autogenerated html documentation
/docs/pyzkaccess
/docs/*.js
/docs/*.html
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
exclude: 'pyzkaccess/cli.py' # It will not pass the checks, since it has been written specially for Fire library
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/PyCQA/isort
rev: "5.12.0"
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: "24.8.0"
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.1
hooks:
- id: mypy
- repo: https://github.com/PyCQA/pylint
rev: v3.2.7
hooks:
- id: pylint
additional_dependencies: ["wrapt>=1.16.0"]
- repo: https://github.com/python-poetry/poetry
rev: "1.6.1"
hooks:
- id: poetry-lock
args: ["--no-update"]
- id: poetry-check
- repo: https://github.com/floatingpurr/sync_with_poetry
rev: "1.1.0"
hooks:
- id: sync_with_poetry
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

53 changes: 49 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,51 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Python Versioning](https://www.python.org/dev/peps/pep-0440/#public-version-identifiers).

## [1.1]

### Added

- Add pre-commit, code linters and apply them to codebase
- Use taskfile.dev for automation
- Build the portable Windows executable with PyInstaller
- Add missing type annotations
- Add `EventLog.where_or` method as alias for `EventLog.only` method
- Add `QuerySet.select` method as alias for `QuerySet.only_fields` method
- Get rid of printing the connection string in exception messages due to security reasons

#### CLI
- Make `1` and `0` as valid input for boolean values
- Add `events where_or` criteria as an alias for `events only`
- New subcommand `setup` that:
- Checks the Windows (or wine) and Python versions
- Asks where to install the PULL SDK from (if it has not installed): download from ZKTeco website, from local zip
file or local directory
- `connect` subcommand now able to accept the connection options (including full connection string) from environment
variables. Useful for passing the connection password securely.
- Fix mocking the SDK on non-windows platforms, showing incompatibility error (#11)
- Add IP and MAC addresses validation

### Changed

- Update dependencies
- Move from Travis CI to GitHub Actions
- Move to Poetry for dependency management
- Get rid of tox in favor of Poetry
- Update documentation: fix grammar, typos and formatting; add more examples
- Update docstrings: fix grammar, typos; add more examples
- Skip extra keys in device string instead of raising ValueError, which SearchDevices SDK function may return (#8)

#### CLI
- Fix parsing the boolean values in command line arguments
- Fix exception on applying the `select` subcommand if a single object (relay, aux input, etc.) is already selected
- Fix empty output on `events` subcommand
- Update help messages: fix grammar, typos; add more examples
- Show `--help` contents of subcommands without connecting to the device

### Removed

- Drop the python `3.5`, `3.6`, `3.7` support

## [1.0]

### Added
Expand All @@ -24,7 +69,7 @@ and this project adheres to
- Print one event by line and remove items collapsing in `EventLog` string representation
- Fix "no value" values handling in some paremeters
- Fix `search_devices` raises error when no devices found
- Rename `pyzkaccess.py` to `main.py` and `ctypes.py` to `ctypes_.py` in order to avoid
- Rename `pyzkaccess.py` to `main.py` and `ctypes.py` to `ctypes_.py` in order to avoid
possible import issues
- Change type of warning to `ImportWarning` when non-Windows platform is used

Expand Down Expand Up @@ -56,12 +101,12 @@ and this project adheres to
- BREAKING CHANGE. ZKAccess connstr constructor parameter now must be keyword parameter and be
`str` type instead of `bytes`
- Split project to several files
- BREAKING CHANGE. Split up `ZKAccess` class onto `ZKSDK` (implementation) and
`ZKAccess` (interface). Move `zk*` methods to `ZKSDK`
- BREAKING CHANGE. Split up `ZKAccess` class onto `ZKSDK` (implementation) and
`ZKAccess` (interface). Move `zk*` methods to `ZKSDK`
- BREAKING CHANGE. Convert `ControlOperation`, `RelayGroup`, `VERIFY_MODES` to python `Enum`

### Removed
- BREAKING CHANGE. Remove `enable_relay*` and `read_events` methods
- BREAKING CHANGE. Remove `enable_relay*` and `read_events` methods

## [0.1]
### Added
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018 Igor Derkach <gosha753951@gmail.com>
Copyright 2024 Igor Derkach <gosha753951@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Loading

0 comments on commit 037a4e6

Please sign in to comment.