summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2013-07-19 11:12:24 -0700
committerBob Ippolito <bob@redivi.com>2013-07-19 11:12:24 -0700
commit9bd1640c8c6ca6052cf1a115151d15eaa9577c4d (patch)
treef65e44c66b1c22f47cbe9f572a5fb796b12a6669
parent7dcc740f22a7fc42f7ef6b6638b62897e1b2d210 (diff)
downloadxattr-9bd1640c8c6ca6052cf1a115151d15eaa9577c4d.tar.gz
#11 maybe fix build, add requirements.txt
-rw-r--r--.gitignore1
-rw-r--r--CHANGES.txt5
-rw-r--r--requirements.txt1
-rw-r--r--setup.py33
-rw-r--r--xattr/__init__.py2
-rw-r--r--xattr/lib.py2
6 files changed, 25 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 5c2ffe4..0a151a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
/xattr.egg-info
/build
/dist
+/*.egg
*.pyc
*.so
.\#*
diff --git a/CHANGES.txt b/CHANGES.txt
index bfcb0ad..4e5f24a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,8 @@
+Version 0.7.0 released 2013-07-19
+
+* Rewritten to use cffi
+ https://github.com/xattr/xattr/pull/11
+
Version 0.6.4 released 2012-02-01
* Updated README.txt to match setup.py description
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..08c056b
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+cffi>=0.4
diff --git a/setup.py b/setup.py
index a3a5d0f..76c0280 100644
--- a/setup.py
+++ b/setup.py
@@ -4,22 +4,20 @@ import os
import sys
from setuptools import setup
+from distutils.command.build import build
-# HACK for setup.py build, this way it can find cffi and thus make the
-# extension
-for path in os.listdir("."):
- if path.endswith(".egg"):
- sys.path.append(path)
+class cffi_build(build):
+ """This is a shameful hack to ensure that cffi is present when
+ we specify ext_modules. We can't do this eagerly because
+ setup_requires hasn't run yet.
+ """
+ def finalize_options(self):
+ from xattr.lib import ffi
+ self.distribution.ext_modules = [ffi.verifier.get_extension()]
+ self.distribution.ext_modules.append(ext)
+ build.finalize_options(self)
-try:
- from xattr import lib
-except ImportError:
- ext_modules = []
-else:
- ext_modules = [lib.ffi.verifier.get_extension()]
-
-
-VERSION = '0.6.4'
+VERSION = '0.7.0'
DESCRIPTION = "Python wrapper for extended filesystem attributes"
LONG_DESCRIPTION = """
Extended attributes extend the basic attributes of files and directories
@@ -54,15 +52,16 @@ setup(
url="http://github.com/xattr/xattr",
license="MIT License",
packages=['xattr'],
+ ext_package='xattr',
platforms=['MacOS X', 'Linux', 'FreeBSD', 'Solaris'],
- ext_modules=ext_modules,
entry_points={
'console_scripts': [
"xattr = xattr.tool:main",
],
},
- install_requires=["cffi"],
- setup_requires=["cffi"],
+ install_requires=["cffi>=0.4"],
+ setup_requires=["cffi>=0.4"],
test_suite="xattr.tests.all_tests_suite",
zip_safe=False,
+ cmdclass={'build': cffi_build},
)
diff --git a/xattr/__init__.py b/xattr/__init__.py
index 7618bc0..a452f66 100644
--- a/xattr/__init__.py
+++ b/xattr/__init__.py
@@ -7,7 +7,7 @@ The xattr type wraps a path or file descriptor with a dict-like interface
that exposes these extended attributes.
"""
-__version__ = '0.6.4'
+__version__ = '0.7.0'
from .lib import (XATTR_NOFOLLOW, XATTR_CREATE, XATTR_REPLACE,
XATTR_NOSECURITY, XATTR_MAXNAMELEN, XATTR_FINDERINFO_NAME,
diff --git a/xattr/lib.py b/xattr/lib.py
index 86adae0..b72a1ff 100644
--- a/xattr/lib.py
+++ b/xattr/lib.py
@@ -577,7 +577,7 @@ static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int options)
#define xattr_listxattr listxattr
#define xattr_flistxattr flistxattr
#endif
-""")
+""", ext_package='xattr')
XATTR_NOFOLLOW = lib.XATTR_NOFOLLOW
XATTR_CREATE = lib.XATTR_CREATE