Skip to content

Commit 3bd810b

Browse files
Merge pull request #8 from arvindrajan92/FANPR-2
2 parents c132a39 + 8e80741 commit 3bd810b

File tree

7 files changed

+138
-8
lines changed

7 files changed

+138
-8
lines changed

.github/workflows/merge.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
os: [windows-latest, ubuntu-latest, macos-latest, raspberrypi]
17+
os: [ubuntu-latest]
1818
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
19-
exclude:
20-
- os: windows-latest
21-
python-version: "3.11"
2219
runs-on: ${{ matrix.os }}
2320
steps:
2421
- uses: actions/checkout@v3

.github/workflows/merge_macos.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: main-macos
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- closed
9+
10+
jobs:
11+
if_merged:
12+
name: Run unit tests on different python versions and check build
13+
if: github.event.pull_request.merged == true
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [macos-latest]
18+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install .[dev]
30+
- name: Lint with flake8
31+
uses: py-actions/flake8@v2
32+
with:
33+
max-line-length: "120"
34+
- name: Test with pytest
35+
run: pytest --exitfirst --verbose --failed-first
36+
- name: Build package
37+
run: python setup.py sdist bdist_wheel
38+
- name: Checking build
39+
run: twine check dist/*

.github/workflows/merge_raspbian.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: main-raspbian
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- closed
9+
10+
jobs:
11+
if_merged:
12+
name: Run unit tests on different python versions and check build
13+
if: github.event.pull_request.merged == true
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [raspberrypi]
18+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install .[dev]
30+
- name: Lint with flake8
31+
uses: py-actions/flake8@v2
32+
with:
33+
max-line-length: "120"
34+
- name: Test with pytest
35+
run: pytest --exitfirst --verbose --failed-first
36+
- name: Build package
37+
run: python setup.py sdist bdist_wheel
38+
- name: Checking build
39+
run: twine check dist/*

.github/workflows/merge_windows.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: main-windows
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- closed
9+
10+
jobs:
11+
if_merged:
12+
name: Run unit tests on different python versions and check build
13+
if: github.event.pull_request.merged == true
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [windows-latest]
18+
python-version: [ "3.8", "3.9", "3.10" ]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install .[dev]
30+
- name: Lint with flake8
31+
uses: py-actions/flake8@v2
32+
with:
33+
max-line-length: "120"
34+
- name: Test with pytest
35+
run: pytest --exitfirst --verbose --failed-first
36+
- name: Build package
37+
run: python setup.py sdist bdist_wheel
38+
- name: Checking build
39+
run: twine check dist/*

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<img src="misc/logo.jpg" alt="FastANPR logo" style="width:100%;">
22

33
[![Build Status](https://github.com/arvindrajan92/fastanpr/actions/workflows/merge.yaml/badge.svg)](https://github.com/arvindrajan92/fastanpr/actions)
4+
[![Build Status](https://github.com/arvindrajan92/fastanpr/actions/workflows/merge_macos.yaml/badge.svg)](https://github.com/arvindrajan92/fastanpr/actions)
5+
[![Build Status](https://github.com/arvindrajan92/fastanpr/actions/workflows/merge_raspbian.yaml/badge.svg)](https://github.com/arvindrajan92/fastanpr/actions)
6+
[![Build Status](https://github.com/arvindrajan92/fastanpr/actions/workflows/merge_windows.yaml/badge.svg)](https://github.com/arvindrajan92/fastanpr/actions)
47
[![Build Status](https://github.com/arvindrajan92/fastanpr/actions/workflows/push.yaml/badge.svg)](https://github.com/arvindrajan92/fastanpr/actions)
58
[![Build Status](https://github.com/arvindrajan92/fastanpr/actions/workflows/publish.yaml/badge.svg)](https://github.com/arvindrajan92/fastanpr/actions)
69
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/arvindrajan92/fastanpr)](https://github.com/arvindrajan92/fastanpr/releases)
@@ -13,9 +16,15 @@ A fast *automatic number-plate recognition* (ANPR) library. This package employs
1316
![Example outputs](misc/sample.png)
1417

1518
## Installation
19+
You can install the package using pip:
1620
```bash
1721
pip install fastanpr
1822
```
23+
### Requirements
24+
- Windows:
25+
- Python >=3.9, <3.11
26+
- Ubuntu, macOS, Raspbian:
27+
- Python >=3.9, <3.12
1928

2029
## Usage
2130
```python

setup.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import os
2+
import sys
23
import subprocess
34
from setuptools import setup, find_packages
45

6+
# Getting build version
57
try:
68
VERSION = (
79
subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE)
@@ -25,7 +27,13 @@
2527
with open("fastanpr/version.py", "r", encoding="utf-8") as fh:
2628
VERSION = fh.read().strip().lstrip("__version__ = \"").rstrip("\"")
2729

28-
DESCRIPTION = 'A fast automatic number-plate recognition (ANPR) library'
30+
# Set Python version requirements based on the operating system
31+
if sys.platform.startswith('win'):
32+
PYTHON_REQUIRES = '>=3.8, <3.11'
33+
else:
34+
PYTHON_REQUIRES = '>=3.8, <3.12'
35+
36+
# Getting long description from README
2937
with open("README.md", "r") as fh:
3038
LONG_DESCRIPTION = fh.read()
3139

@@ -34,14 +42,14 @@
3442
version=VERSION,
3543
author="arvindrajan92 (Arvind Rajan)",
3644
author_email="<[email protected]>",
37-
description=DESCRIPTION,
45+
description='A fast automatic number-plate recognition (ANPR) library',
3846
long_description_content_type="text/markdown",
3947
long_description=LONG_DESCRIPTION,
4048
packages=find_packages(),
4149
package_data={'': ['*.pt'], 'fastanpr': ['*.pt']},
4250
include_package_data=True,
4351
install_requires=['ultralytics>=8.1.26', 'paddlepaddle>=2.6.0', 'paddleocr>=2.7.0.3'],
44-
python_requires='>=3.8',
52+
python_requires=PYTHON_REQUIRES,
4553
extras_require={
4654
'dev': ['pytest', 'pytest-asyncio', 'twine', 'python-Levenshtein', 'setuptools', 'wheel', 'twine', 'flake8']
4755
},

tests/test_fastanpr.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import cv2
2-
import time
32
import pytest
43
import Levenshtein
54
import numpy as np

0 commit comments

Comments
 (0)