Skip to content
This repository
Browse code

Updates to setup

- Use find_packages from setuptools/distutils
- Add libqtile/resources to MANIFEST.in so that, e.g., battery icons are installed
  • Loading branch information...
commit 76e2810abecd1705f8114ff263faa4082ed958fd 1 parent e903bc4
Derek Payton dmpayton authored

Showing 2 changed files with 29 additions and 94 deletions. Show diff stats Hide diff stats

  1. +3 1 MANIFEST.in
  2. +26 93 setup.py
4 MANIFEST.in
... ... @@ -1,7 +1,9 @@
1 1 include LICENSE
  2 +include README.rst
2 3 recursive-include examples *
3 4 recursive-include contrib *
  5 +recursive-include docs *.html *.js *.css *.png
  6 +recursive-include libqtile/resources *
4 7 recursive-include scripts *
5 8 recursive-include test *
6   -recursive-include doc *.html *.js *.css *.png
7 9 recursive-exclude test *.swo *.swp *.pyc
119 setup.py
... ... @@ -1,4 +1,9 @@
1   -from distutils.core import setup
  1 +#!/usr/bin/env python
  2 +
  3 +try:
  4 + from setuptools import setup, find_packages
  5 +except ImportError:
  6 + from distutils.core import setup, find_packages
2 7
3 8 long_description = """
4 9 A pure-Python tiling window manager.
@@ -19,97 +24,25 @@
19 24 Qtile depends on the Python X Library (http://python-xlib.sourceforge.net/).
20 25 """
21 26
22   -"""
23   - The content below is included from the distextend project.
24   -
25   - The code is in the public domain, and may be used for any purpose
26   - whatsoever.
27   -"""
28   -import fnmatch
29   -import os.path
30   -
31   -
32   -def _fnmatch(name, patternList):
33   - for i in patternList:
34   - if fnmatch.fnmatch(name, i):
35   - return True
36   - return False
37   -
38   -
39   -def _splitAll(path):
40   - parts = []
41   - h = path
42   - while 1:
43   - if not h:
44   - break
45   - h, t = os.path.split(h)
46   - parts.append(t)
47   - parts.reverse()
48   - return parts
49   -
50   -
51   -def findPackages(path, dataExclude=[]):
52   - """
53   - Recursively find all packages and data directories rooted at path. Note
54   - that only data _directories_ and their contents are returned -
55   - non-Python files at module scope are not, and should be manually
56   - included.
57   -
58   - dataExclude is a list of fnmatch-compatible expressions for files and
59   - directories that should not be included in pakcage_data.
60   -
61   - Returns a (packages, package_data) tuple, ready to be passed to the
62   - corresponding distutils.core.setup arguments.
63   - """
64   - packages = []
65   - datadirs = []
66   - for root, dirs, files in os.walk(path, topdown=True):
67   - if "__init__.py" in files:
68   - p = _splitAll(root)
69   - packages.append(".".join(p))
70   - else:
71   - dirs[:] = []
72   - if packages:
73   - datadirs.append(root)
74   -
75   - package_data = {}
76   - for i in datadirs:
77   - if not _fnmatch(i, dataExclude):
78   - parts = _splitAll(i)
79   - module = ".".join(parts[:-1])
80   - acc = package_data.get(module, [])
81   - for root, dirs, files in os.walk(i, topdown=True):
82   - sub = os.path.join(*_splitAll(root)[1:])
83   - if not _fnmatch(sub, dataExclude):
84   - for fname in files:
85   - path = os.path.join(sub, fname)
86   - if not _fnmatch(path, dataExclude):
87   - acc.append(path)
88   - else:
89   - dirs[:] = []
90   - package_data[module] = acc
91   - return packages, package_data
92   -
93   -packages, package_data = findPackages("libqtile")
94   -
95   -
96 27 setup(
97   - name="qtile",
98   - version="0.5",
99   - description="A pure-Python tiling window manager.",
100   - author="Aldo Cortesi",
101   - author_email="aldo@nullcube.com",
102   - license="MIT",
103   - url="http://www.qtile.org",
104   - packages=packages,
105   - package_data=package_data,
106   - scripts=["qtile-session", "qtile", "qsh"],
107   - classifiers=[
108   - "Intended Audience :: End Users/Desktop",
109   - "License :: OSI Approved :: MIT License",
110   - "Development Status :: 3 - Alpha",
111   - "Programming Language :: Python",
112   - "Operating System :: Unix",
113   - "Topic :: Desktop Environment :: Window Managers",
114   - ]
  28 + name="qtile",
  29 + version="0.5",
  30 + description="A pure-Python tiling window manager.",
  31 + long_description=long_description,
  32 + classifiers=[
  33 + "Intended Audience :: End Users/Desktop",
  34 + "License :: OSI Approved :: MIT License",
  35 + "Development Status :: 3 - Alpha",
  36 + "Programming Language :: Python",
  37 + "Operating System :: Unix",
  38 + "Topic :: Desktop Environment :: Window Managers",
  39 + ],
  40 + keywords="qtile tiling window manager",
  41 + author="Aldo Cortesi",
  42 + author_email="aldo@nullcube.com",
  43 + url="http://qtile.org",
  44 + license="MIT",
  45 + include_package_data=True,
  46 + packages=find_packages(),
  47 + scripts=["qtile-session", "qtile", "qsh"],
115 48 )

0 comments on commit 76e2810

Please sign in to comment.
Something went wrong with that request. Please try again.