1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Setup script used to build and install Yokadi
@author: Sébastien Renard (sebastien.renard@digitalfox.org)
@license:GPL v3 or newer
"""
from setuptools import setup
import sys
import os
from fnmatch import fnmatch
from os.path import isdir, dirname, join
sys.path.insert(0, dirname(__file__))
import yokadi # noqa: E402
def createFileList(sourceDir, *patterns):
"""
List files from sourceDir which match one of the pattern in patterns
Returns the path including sourceDir
"""
for name in os.listdir(sourceDir):
for pattern in patterns:
if fnmatch(name, pattern):
yield join(sourceDir, name)
# Additional files
data_files = []
data_files.append(["share/yokadi",
["README.md", "CHANGELOG.md", "LICENSE"]])
# Doc
data_files.append(["share/yokadi/doc", createFileList("doc", "*.md")])
# Man
data_files.append(["share/man/man1", createFileList("man", "*.1")])
# Editor scripts
data_files.append(["share/yokadi/editors/vim/ftdetect", ["editors/vim/ftdetect/yokadimedit.vim"]])
data_files.append(["share/yokadi/editors/vim/syntax", ["editors/vim/syntax/yokadimedit.vim"]])
# Icon
for size in os.listdir("icon"):
if not isdir(join("icon", size)):
continue
data_files.append(["share/icons/hicolor/%s/apps" % size, ["icon/%s/yokadi.png" % size]])
data_files.append(["share/applications", ["icon/yokadi.desktop"]])
# Scripts
scripts = ["bin/yokadi", "bin/yokadid"]
# Windows post install script
if "win" in " ".join(sys.argv[1:]):
scripts.append("w32_postinst.py")
# Go for setup
setup(
name="yokadi",
version=yokadi.__version__,
description="Command line oriented todo list system",
author="The Yokadi Team",
author_email="ml-yokadi@sequanux.org",
url="http://yokadi.github.io/",
packages=[
"yokadi",
"yokadi.core",
"yokadi.tests",
"yokadi.update",
"yokadi.ycli",
"yokadi.yical",
],
# distutils does not support install_requires, but pip needs it to be
# able to automatically install dependencies
install_requires=[
"sqlalchemy ~= 2.0.32",
"python-dateutil ~= 2.8.2",
"colorama ~= 0.4.6",
"pyreadline3 ~= 3.4.1 ; platform_system == 'Windows'",
],
scripts=scripts,
data_files=data_files
)
|