Skip to content

Commit

Permalink
Merge branch 'release/2019.0909'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Sep 9, 2019
2 parents e52c1ca + 27e0956 commit 74fcaeb
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 27 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [2019.0909]

- Fix camera events not binded
- Makefile improvements
- Bump to Kivy==1.11.1, refs #22

## [2019.0907]

- Update buildozer, p4a, and ndk versions, refs #21
Expand Down
32 changes: 23 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ all: system_dependencies virtualenv opencv

venv:
test -d venv || virtualenv -p python$(PYTHON_MAJOR_VERSION) venv
. venv/bin/activate

virtualenv: venv
$(PIP) install Cython==0.28.6
$(PIP) install -r requirements/requirements.txt
$(GARDEN) install xcamera

virtualenv: venv

system_dependencies:
ifeq ($(OS), Ubuntu)
sudo apt install --yes --no-install-recommends $(SYSTEM_DEPENDENCIES)
Expand Down Expand Up @@ -112,8 +111,10 @@ $(OPENCV_DEPLOY): $(OPENCV_BUILD) virtualenv

opencv: $(OPENCV_DEPLOY)

clean:
rm -rf $(VENV_NAME) .tox/ $(DOWNLOAD_DIR) $(DOCS_DIR)/build/ dist/ build/
run/linux: virtualenv
$(PYTHON) src/main.py

run: run/linux

test:
$(TOX)
Expand All @@ -122,25 +123,38 @@ uitest: virtualenv
$(PIP) install -r requirements/test_requirements.txt
PYTHONPATH=src $(PYTHON) -m unittest discover --top-level-directory=. --start-directory=tests/ui/

isort-check:
isort-check: virtualenv
$(ISORT) --check-only --recursive --diff $(SOURCES)

isort-fix:
isort-fix: virtualenv
$(ISORT) --recursive $(SOURCES)

flake8:
flake8: virtualenv
$(FLAKE8) $(SOURCES)

lint: isort-check flake8

docs/clean:
rm -rf $(DOCS_DIR)/build/

docs:
cd $(DOCS_DIR) && SPHINXBUILD=$(SPHINXBUILD) make html

release/build:
release/clean:
rm -rf dist/ build/

release/build: release/clean
$(PYTHON) setup.py sdist bdist_wheel
$(PYTHON) setup_meta.py sdist bdist_wheel
$(TWINE) check dist/*

release/upload:
$(TWINE) upload dist/*

clean: release/clean docs/clean
py3clean src/
find src/ -type d -name "__pycache__" -exec rm -r {} +
find src/ -type d -name "*.egg-info" -exec rm -r {} +

clean/full: clean
rm -rf $(VENV_NAME) .tox/ $(DOWNLOAD_DIR)
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A full working demo is available in [src/main.py](https://github.com/kivy-garden
### Ubuntu
Install system requirements (Ubuntu 18.04):
```sh
sudo apt install libzbar-dev
make system_dependencies
```

Install garden requirements:
Expand All @@ -42,15 +42,17 @@ garden install --upgrade xcamera

Install zbarcam:
```sh
pip install --upgrade https://github.com/kivy-garden/zbarcam/archive/develop.zip
pip install --upgrade zbarcam
```
Then import it in your Python code via:
```python
from kivy_garden.zbarcam import ZBarCam
```


You may also need to compile/install OpenCV manually, see [OpenCV.md](OpenCV.md).
[OpenCV](OpenCV.md):
```sh
make opencv
```

### Android
Build for Android via buildozer, see [buildozer.spec](buildozer.spec).
Expand Down
2 changes: 1 addition & 1 deletion buildozer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ version.filename = %(source.dir)s/kivy_garden/zbarcam/version.py
# comma seperated e.g. requirements = sqlite3,kivy
requirements =
android,
kivy==5fc5385,
kivy==1.11.1,
libiconv,
libzbar,
Pillow==5.2.0,
Expand Down
15 changes: 8 additions & 7 deletions doc/source/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Start the release with git flow:
```sh
git flow release start YYYY.MMDD
```
Now update the [CHANGELOG.md](/CHANGELOG.md) `[Unreleased]` section to match the new release version.
Now update the [CHANGELOG.md](https://github.com/kivy-garden/zbarcam/blob/develop/CHANGELOG.md)
`[Unreleased]` section to match the new release version.
Also update the `version` string from the
[src/kivy_garden/zbarcam/version.py](https://github.com/kivy-garden/zbarcam/blob/develop/src/kivy_garden/zbarcam/version.py)
file.
Expand All @@ -30,18 +31,18 @@ git push --tags

Build it:
```sh
python setup.py sdist bdist_wheel
make release/build
```
Check archive content:
This will build two packages, `kivy_garden.zbarcam` and the alias meta-package `zbarcam`.
Also note we're running `twine check` on both archives.
You can also check archive content manually via:
```sh
tar -tvf dist/kivy_garden.zbarcam-*.tar.gz
```
Twine check and upload:
Last step is to upload both packages:
```sh
twine check dist/*
twine upload dist/*
make release/upload
```
Also publish the alias meta package `setup_meta.py`.

## Check Read the Docs

Expand Down
7 changes: 3 additions & 4 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pyzbar==0.1.8
# 5fc5385 adds opencv 4 support
https://github.com/kivy/kivy/archive/5fc5385.zip#egg=kivy
Kivy==1.11.1
Kivy-Garden==0.1.4
Pillow==5.2.0
numpy==1.16.1
Pillow==5.2.0
pyzbar==0.1.8
4 changes: 2 additions & 2 deletions src/kivy_garden/zbarcam/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__version__ = '2019.0907'
__version__ = '2019.0909'
# The `__version_code__` is used for the F-Droid auto update and should match
# the `versionCode` from the `build.gradle` file located in:
# `.buildozer/android/platform/build/dists/zbarcamdemo/`
# The auto update method used is the `HTTP`, see:
# https://f-droid.org/en/docs/Build_Metadata_Reference/#UpdateCheckMode
__version_code__ = 721202807
__version_code__ = 721202809
3 changes: 3 additions & 0 deletions src/kivy_garden/zbarcam/zbarcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def _setup(self):
# `self.xcamera._camera` instance may not be available if e.g.
# the `CAMERA` permission is not granted
self.xcamera.bind(on_camera_ready=self._on_camera_ready)
# camera may still be ready before we bind the event
if self.xcamera._camera is not None:
self._on_camera_ready(self.xcamera)

def _on_camera_ready(self, xcamera):
"""
Expand Down

0 comments on commit 74fcaeb

Please sign in to comment.