Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@dmpayton dmpayton authored
Showing with 29 additions and 94 deletions.
  1. +3 −1 MANIFEST.in
  2. +26 −93 setup.py
View
4 MANIFEST.in
@@ -1,7 +1,9 @@
include LICENSE
+include README.rst
recursive-include examples *
recursive-include contrib *
+recursive-include docs *.html *.js *.css *.png
+recursive-include libqtile/resources *
recursive-include scripts *
recursive-include test *
-recursive-include doc *.html *.js *.css *.png
recursive-exclude test *.swo *.swp *.pyc
View
119 setup.py
@@ -1,4 +1,9 @@
-from distutils.core import setup
+#!/usr/bin/env python
+
+try:
+ from setuptools import setup, find_packages
+except ImportError:
+ from distutils.core import setup, find_packages
long_description = """
A pure-Python tiling window manager.
@@ -19,97 +24,25 @@
Qtile depends on the Python X Library (http://python-xlib.sourceforge.net/).
"""
-"""
- The content below is included from the distextend project.
-
- The code is in the public domain, and may be used for any purpose
- whatsoever.
-"""
-import fnmatch
-import os.path
-
-
-def _fnmatch(name, patternList):
- for i in patternList:
- if fnmatch.fnmatch(name, i):
- return True
- return False
-
-
-def _splitAll(path):
- parts = []
- h = path
- while 1:
- if not h:
- break
- h, t = os.path.split(h)
- parts.append(t)
- parts.reverse()
- return parts
-
-
-def findPackages(path, dataExclude=[]):
- """
- Recursively find all packages and data directories rooted at path. Note
- that only data _directories_ and their contents are returned -
- non-Python files at module scope are not, and should be manually
- included.
-
- dataExclude is a list of fnmatch-compatible expressions for files and
- directories that should not be included in pakcage_data.
-
- Returns a (packages, package_data) tuple, ready to be passed to the
- corresponding distutils.core.setup arguments.
- """
- packages = []
- datadirs = []
- for root, dirs, files in os.walk(path, topdown=True):
- if "__init__.py" in files:
- p = _splitAll(root)
- packages.append(".".join(p))
- else:
- dirs[:] = []
- if packages:
- datadirs.append(root)
-
- package_data = {}
- for i in datadirs:
- if not _fnmatch(i, dataExclude):
- parts = _splitAll(i)
- module = ".".join(parts[:-1])
- acc = package_data.get(module, [])
- for root, dirs, files in os.walk(i, topdown=True):
- sub = os.path.join(*_splitAll(root)[1:])
- if not _fnmatch(sub, dataExclude):
- for fname in files:
- path = os.path.join(sub, fname)
- if not _fnmatch(path, dataExclude):
- acc.append(path)
- else:
- dirs[:] = []
- package_data[module] = acc
- return packages, package_data
-
-packages, package_data = findPackages("libqtile")
-
-
setup(
- name="qtile",
- version="0.5",
- description="A pure-Python tiling window manager.",
- author="Aldo Cortesi",
- author_email="aldo@nullcube.com",
- license="MIT",
- url="http://www.qtile.org",
- packages=packages,
- package_data=package_data,
- scripts=["qtile-session", "qtile", "qsh"],
- classifiers=[
- "Intended Audience :: End Users/Desktop",
- "License :: OSI Approved :: MIT License",
- "Development Status :: 3 - Alpha",
- "Programming Language :: Python",
- "Operating System :: Unix",
- "Topic :: Desktop Environment :: Window Managers",
- ]
+ name="qtile",
+ version="0.5",
+ description="A pure-Python tiling window manager.",
+ long_description=long_description,
+ classifiers=[
+ "Intended Audience :: End Users/Desktop",
+ "License :: OSI Approved :: MIT License",
+ "Development Status :: 3 - Alpha",
+ "Programming Language :: Python",
+ "Operating System :: Unix",
+ "Topic :: Desktop Environment :: Window Managers",
+ ],
+ keywords="qtile tiling window manager",
+ author="Aldo Cortesi",
+ author_email="aldo@nullcube.com",
+ url="http://qtile.org",
+ license="MIT",
+ include_package_data=True,
+ packages=find_packages(),
+ scripts=["qtile-session", "qtile", "qsh"],
)

0 comments on commit 76e2810

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