Skip to content

Commit 20940c1

Browse files
committed
Use new xcamera module
We no longer rely on `garden`.
1 parent 49cba2b commit 20940c1

File tree

11 files changed

+18
-23
lines changed

11 files changed

+18
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Use new `xcamera` from PyPI
56
- Use `opencv-python` from PyPI, refs #23
67

78
## [2019.0909]

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ venv:
3131
virtualenv: venv
3232
$(PIP) install Cython==0.28.6
3333
$(PIP) install -r requirements/requirements.txt
34-
$(GARDEN) install xcamera
34+
35+
virtualenv/test: virtualenv
36+
$(PIP) install -r requirements/requirements-test.txt
3537

3638
system_dependencies:
3739
ifeq ($(OS), Ubuntu)
@@ -46,17 +48,16 @@ run: run/linux
4648
test:
4749
$(TOX)
4850

49-
uitest: virtualenv
50-
$(PIP) install -r requirements/test_requirements.txt
51+
uitest: virtualenv/test
5152
PYTHONPATH=src $(PYTHON) -m unittest discover --top-level-directory=. --start-directory=tests/ui/
5253

53-
lint/isort-check: virtualenv
54+
lint/isort-check: virtualenv/test
5455
$(ISORT) --check-only --recursive --diff $(SOURCES)
5556

56-
lint/isort-fix: virtualenv
57+
lint/isort-fix: virtualenv/test
5758
$(ISORT) --recursive $(SOURCES)
5859

59-
lint/flake8: virtualenv
60+
lint/flake8: virtualenv/test
6061
$(FLAKE8) $(SOURCES)
6162

6263
lint: lint/isort-check lint/flake8

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ Install system requirements (Ubuntu 18.04):
3535
make system_dependencies
3636
```
3737

38-
Install garden requirements:
39-
```sh
40-
garden install --upgrade xcamera
41-
```
42-
4338
Install zbarcam:
4439
```sh
4540
pip install --upgrade zbarcam
@@ -65,9 +60,6 @@ make uitest
6560

6661
## Troubleshooting
6762

68-
### Install `Unable to import package 'kivy.garden.xcamera.XCamera'`
69-
You're missing the `xcamera` dependency. Install it as described in the install instructions.
70-
7163
### Android `ValueError: Empty module name`
7264
More likely an import issue in your `.kv` file.
7365
Try to `from zbarcam import ZBarCam` in your `main.py` to see the exact error.

buildozer.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ requirements =
4343
libzbar,
4444
Pillow==5.2.0,
4545
python3,
46-
pyzbar==0.1.8
46+
pyzbar==0.1.8,
47+
xcamera
4748
4849
4950
# (str) Custom source folders for requirements
@@ -52,7 +53,6 @@ requirements =
5253
5354
# (list) Garden requirements
5455
#garden_requirements =
55-
garden_requirements = xcamera
5656
5757
# (str) Presplash of the application
5858
#presplash.filename = %(source.dir)s/data/presplash.png
File renamed without changes.

requirements/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ numpy==1.16.1
44
opencv-python==4.1.1.26
55
Pillow==5.2.0
66
pyzbar==0.1.8
7+
xcamera

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def read(fname):
2828
'opencv-python>=4',
2929
'pillow',
3030
'pyzbar',
31+
'xcamera',
3132
],
3233
}
3334

src/kivy_garden/zbarcam/zbarcam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
import PIL
55
from kivy.clock import Clock, mainthread
6-
from kivy.garden.xcamera import XCamera
76
from kivy.lang import Builder
87
from kivy.properties import ListProperty
98
from kivy.uix.anchorlayout import AnchorLayout
9+
from kivy_garden.xcamera import XCamera
1010
from pyzbar import pyzbar
1111

1212
from .utils import check_request_camera_permission, fix_android_image
@@ -16,7 +16,7 @@
1616

1717
class CustomXCamera(XCamera):
1818
"""
19-
Inherits from `kivy.garden.xcamera.XCamera`.
19+
Inherits from `kivy_garden.xcamera.XCamera`.
2020
Overrides `_on_index()` to make sure the `kivy.core.camera.Camera` object
2121
is only created if permission are granted on Android.
2222
On other system, it's a noop calling the parent `_on_index()`.

tests/test_zbarcam.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import mock
55
from kivy.base import EventLoop
66
from kivy.core.image import Image
7-
87
from kivy_garden.zbarcam import ZBarCam
98

109
FIXTURE_DIR = os.path.join(

tests/ui/test_zbarcam_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import mock
77
from kivy.clock import Clock
8-
98
from kivy_garden.zbarcam.zbarcam import ZBarCam
9+
1010
from main import DemoApp
1111

1212

0 commit comments

Comments
 (0)