diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ccd794e..79434a2 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -9,7 +9,7 @@ on: - "v*" permissions: - contents: read + contents: write jobs: build-n-publish: @@ -33,11 +33,13 @@ jobs: python -m build twine check --strict dist/* - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - name: Publish distribution to PyPI (twine, skip existing) + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python -m pip install --upgrade twine + python -m twine upload --skip-existing dist/* # https://github.com/actions/first-interaction/issues/10#issuecomment-1475121828 - name: Create GitHub Release diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..f627727 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,47 @@ +name: Tests + +on: + push: + branches: ["**"] + pull_request: + branches: ["**"] + +permissions: + contents: read + +jobs: + test: + name: Lint and test (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12"] + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install system libraries for OpenCV + run: | + sudo apt-get update + sudo apt-get install -y libgl1 libglib2.0-0 + + - name: Install package and test dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[test]" + + - name: Lint with flake8 + run: | + # stop the build on syntax errors or undefined names + flake8 motrackers --count --select=E9,F63,F7,F82 --show-source --statistics + + - name: Run tests + run: | + python -m pytest -q diff --git a/README.md b/README.md index f2ff5ba..c9e5c06 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ Video source: [link](https://flic.kr/p/L6qyxj) | Video source: [link](https://fl ## Installation +This package requires **Python 3.10 or later**. + Pip install for OpenCV (version 3.4.3 or later) is available [here](https://pypi.org/project/opencv-python/) and can be done with the following command: ``` pip install motrackers @@ -77,6 +79,14 @@ while True: Please refer [examples](https://github.com/adipandas/multi-object-tracker/tree/master/examples) folder of this repository for more details. You can clone and run the examples. +## Running tests + +Install the test dependencies and run the test suite with: +``` +pip install -e ".[test]" +pytest +``` + ## Pretrained object detection models You will have to download the pretrained weights for the neural-network models. diff --git a/docs/.buildinfo b/docs/.buildinfo index 9dc96d7..b3bd5fa 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: cc69624f44c2d9a8c8c17ada5937586c +# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 726597977b6716f40fd8596146f5274a tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/.doctrees/environment.pickle b/docs/.doctrees/environment.pickle index fefc416..3bde29e 100644 Binary files a/docs/.doctrees/environment.pickle and b/docs/.doctrees/environment.pickle differ diff --git a/docs/.doctrees/includeme/apidocuments.doctree b/docs/.doctrees/includeme/apidocuments.doctree index 9cd3e6b..ee7d623 100644 Binary files a/docs/.doctrees/includeme/apidocuments.doctree and b/docs/.doctrees/includeme/apidocuments.doctree differ diff --git a/docs/.doctrees/includeme/readmefile.doctree b/docs/.doctrees/includeme/readmefile.doctree index 3a8ad9b..64709f1 100644 Binary files a/docs/.doctrees/includeme/readmefile.doctree and b/docs/.doctrees/includeme/readmefile.doctree differ diff --git a/docs/.doctrees/index.doctree b/docs/.doctrees/index.doctree index 262f3cc..790de47 100644 Binary files a/docs/.doctrees/index.doctree and b/docs/.doctrees/index.doctree differ diff --git a/docs/_modules/index.html b/docs/_modules/index.html index 19ecec8..3bf92f7 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -1,21 +1,20 @@ + + - +
-