diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:16:22 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:16:22 +0100 |
commit | 5e88d395dee651175a277092c712249e3898a7d8 (patch) | |
tree | e6e0b475c7ab5c6a7ff4f0ea7ad1b08cecf05e68 | |
parent | 54c1f6f845765fa7ed8720bbbc0130d99fc7a123 (diff) | |
download | tagit-5e88d395dee651175a277092c712249e3898a7d8.tar.gz tagit-5e88d395dee651175a277092c712249e3898a7d8.tar.bz2 tagit-5e88d395dee651175a277092c712249e3898a7d8.zip |
build fixes
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | MANIFEST.in | 53 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | doc/source/installation.rst | 23 | ||||
-rw-r--r-- | setup.py | 24 | ||||
-rw-r--r-- | tagit/__init__.py | 3 | ||||
-rw-r--r-- | tagit/apps/desktop.py | 4 | ||||
-rw-r--r-- | tagit/external/setproperty/README.md | 24 | ||||
-rw-r--r-- | tagit/external/setproperty/build.py | 5 | ||||
-rw-r--r-- | tagit/external/setproperty/preprocess.py | 8 | ||||
-rw-r--r-- | tagit/external/setproperty/setup.py | 1 |
11 files changed, 146 insertions, 9 deletions
@@ -9,7 +9,7 @@ __pycache__ .coverage .pypirc .mypy_cache -bsfs.egg-info +tagit.egg-info htmlcov tags dev/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..9964a30 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,53 @@ +include tagit/actions/action.kv +include tagit/actions/browser.kv +include tagit/actions/filter.kv +include tagit/actions/grouping.kv +include tagit/actions/misc.kv +include tagit/actions/search.kv +include tagit/actions/session.kv +include tagit/actions/tagging.kv +include tagit/assets/fonts/kivy/Unifont.ttf +include tagit/assets/icons/kivy/browser-0.png +include tagit/assets/icons/kivy/browser.atlas +include tagit/assets/icons/kivy/filter-0.png +include tagit/assets/icons/kivy/filter.atlas +include tagit/assets/icons/kivy/grouping-0.png +include tagit/assets/icons/kivy/grouping.atlas +include tagit/assets/icons/kivy/misc-0.png +include tagit/assets/icons/kivy/misc.atlas +include tagit/assets/icons/kivy/no_preview.png +include tagit/assets/icons/kivy/objects-0.png +include tagit/assets/icons/kivy/objects.atlas +include tagit/assets/icons/kivy/search-0.png +include tagit/assets/icons/kivy/search.atlas +include tagit/assets/icons/kivy/session-0.png +include tagit/assets/icons/kivy/session.atlas +include tagit/assets/icons/kivy/tagging-0.png +include tagit/assets/icons/kivy/tagging.atlas +include tagit/assets/required_schema.nt +include tagit/assets/themes/default/style.kv +include tagit/config/settings.yaml +include tagit/config/user-defaults.yaml +include tagit/dialogues/console.kv +include tagit/dialogues/dialogue.kv +include tagit/dialogues/license.t +include tagit/dialogues/path_picker.kv +include tagit/dialogues/simple_input.kv +include tagit/external/kivy_garden/contextmenu/app_menu.kv +include tagit/external/kivy_garden/contextmenu/context_menu.kv +include tagit/external/kivy_garden/mapview/icons/cluster.png +include tagit/external/kivy_garden/mapview/icons/marker.png +exclude tagit/external/setproperty/* +include tagit/external/setproperty/README.md +include tagit/external/setproperty/__init__.py +include tagit/external/setproperty/build.py +include tagit/external/setproperty/setproperty.c +include tagit/external/tooltip.kv +include tagit/tiles/decoration.kv +include tagit/tiles/tile.kv +include tagit/widgets/browser.kv +include tagit/widgets/context.kv +include tagit/widgets/dock.kv +include tagit/widgets/filter.kv +include tagit/widgets/status.kv +include tagit/windows/desktop.kv @@ -27,7 +27,13 @@ Install tagit as editable from the git repository: $ cd tagit $ pip install -e . -Install the following additional packages besides tagit: +If you want to develop (*dev*), run the tests (*test*), edit the +documentation (*doc*), or build a distributable (*build*), +install bsfs with the respective extras (in addition to file format extras): + + $ pip install -e .[dev,doc,build,test] + +Or, you can manually install the following packages besides tagit: $ pip install coverage mypy pylint $ pip install sphinx sphinx-copybutton sphinxcontrib-video furo diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 87ecff0..12d8898 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -7,7 +7,7 @@ Install *tagit* via pip:: pip install --extra-index-url https://pip.bsfs.io tagit This installs the `tagit` python package as well as the `tagit.app` command. -It is recommended to install *tagit* in a virtual environment (via `virtualenv`). +It is recommended to install *tagit* in a virtual environment (via ``virtualenv``). Please note that you may have to separately install the `BSIE <https://www.bsfs.io/bsie>`_ package into the same environment. @@ -21,6 +21,27 @@ By downloading or using the application you agree to the license's terms and con .. literalinclude:: ../../LICENSE +Demo +---- + +The following commands install *tagit*, its dependencies, and the demo files, +then starts *tagit*. Of course, you can also do this in a ``virtualenv``:: + + pip install --extra-index-url https://pip.bsfs.io/ tagit + wget https://www.bsfs.io/demo/tagitrc -O ~/.tagitrc + wget https://www.bsfs.io/demo/demo-triples.pkl -O ~/demo-triples.pkl + wget https://www.bsfs.io/demo/demo-schema.pkl -O ~/demo-schema.pkl + tagit + +Or, you can run the demo in a docker container (although it will be relatively slow):: + + mkdir bsfs-demo; cd bsfs-demo + wget https://www.bsfs.io/demo/Dockerfile + docker build -t bsfs/demo . + xhost +local:* + docker run --rm --ipc=host -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix -it bsfs/demo + + Source ------ @@ -1,5 +1,5 @@ -from setuptools import setup, find_packages +from setuptools import setup, find_packages, Extension import os setup( @@ -16,9 +16,18 @@ setup( download_url='https://pip.igsor.net', # packages - packages=('tagit', ), + packages=find_packages(include=['tagit']), + package_dir={'tagit': 'tagit'}, # data files are included if mentioned in MANIFEST.in include_package_data=True, + # setproperty needs to be compiled + # NOTE: Assumes that setproperty has already been cythonized! + ext_modules=[ + Extension( + name='tagit.external.setproperty.setproperty', + sources=['tagit/external/setproperty/setproperty.c'], + ), + ], # entrypoints entry_points={ @@ -30,11 +39,20 @@ setup( # dependencies python_requires=">=3.7", install_requires=( + 'bsfs', + 'pillow', 'kivy', - 'pyparsing' + 'pyparsing', 'python-dateutil', 'pyyaml', 'requests', ), + + extras_require={ + 'dev': ['coverage', 'mypy', 'pylint'], + 'doc': ['sphinx', 'sphinx-copybutton', 'sphinxcontrib-video', 'furo'], + 'test': ['pyexiv2'], + 'build': ['build'], + }, ) diff --git a/tagit/__init__.py b/tagit/__init__.py index b0c602d..8c4285a 100644 --- a/tagit/__init__.py +++ b/tagit/__init__.py @@ -20,6 +20,9 @@ import collections import os import typing +import kivy.config +kivy.config.Config.set('input', 'mouse', 'mouse,disable_multitouch') + # kivy imports from kivy.resources import resource_add_path import kivy diff --git a/tagit/apps/desktop.py b/tagit/apps/desktop.py index 913f922..149bf30 100644 --- a/tagit/apps/desktop.py +++ b/tagit/apps/desktop.py @@ -32,8 +32,8 @@ def load_data_hook(cfg, store): import pickle import os # fetch data_hook config flags - schema_path = cfg('session', 'data_hook', 'schema') - triples_path = cfg('session', 'data_hook', 'triples') + schema_path = os.path.expanduser(cfg('session', 'data_hook', 'schema')) + triples_path = os.path.expanduser(cfg('session', 'data_hook', 'triples')) # load data if present if os.path.exists(schema_path) and os.path.exists(triples_path): with open(schema_path, 'rb') as ifile: diff --git a/tagit/external/setproperty/README.md b/tagit/external/setproperty/README.md index e579132..4849b6c 100644 --- a/tagit/external/setproperty/README.md +++ b/tagit/external/setproperty/README.md @@ -1,5 +1,27 @@ -build with +# SetProperty + +Analigous to kivy.properties.ListProperty, SetProperty provides a wrapper +that extends python's set() with [Kivy](https://kivy.org) events. + +## Installation + +Note that you'll need Cython to run the following commands. +Install Cython via: + +$ pip install Cython + +or via your system's package manager (e.g., ``sudo apt install cython``). + +Then, cythonize the SetProperty with: + +$ python preprocess.py + +build the shared library from cythonized with: + +$ python build.py build_ext --inplace + +or perform both steps with one command: $ python setup.py build_ext --inplace diff --git a/tagit/external/setproperty/build.py b/tagit/external/setproperty/build.py new file mode 100644 index 0000000..9b3d6ab --- /dev/null +++ b/tagit/external/setproperty/build.py @@ -0,0 +1,5 @@ + +from distutils.core import Extension, setup +ext = Extension(name="setproperty", sources=["setproperty.c"]) +setup(ext_modules=[ext]) + diff --git a/tagit/external/setproperty/preprocess.py b/tagit/external/setproperty/preprocess.py new file mode 100644 index 0000000..7c85b86 --- /dev/null +++ b/tagit/external/setproperty/preprocess.py @@ -0,0 +1,8 @@ + +from distutils.core import Extension +from Cython.Build import cythonize + +ext = Extension(name="setproperty", sources=["setproperty.pyx"]) +cythonize(ext) + + diff --git a/tagit/external/setproperty/setup.py b/tagit/external/setproperty/setup.py index 8500340..bd95d70 100644 --- a/tagit/external/setproperty/setup.py +++ b/tagit/external/setproperty/setup.py @@ -4,3 +4,4 @@ from Cython.Build import cythonize # define an extension that will be cythonized and compiled ext = Extension(name="setproperty", sources=["setproperty.pyx"]) setup(ext_modules=cythonize(ext)) + |