Skip to content

Commit

Permalink
#11 maybe fix build, add requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Jul 19, 2013
1 parent 7dcc740 commit 9bd1640
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
/xattr.egg-info
/build
/dist
/*.egg
*.pyc
*.so
.\#*
Expand Down
5 changes: 5 additions & 0 deletions 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
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
@@ -0,0 +1 @@
cffi>=0.4
33 changes: 16 additions & 17 deletions setup.py
Expand Up @@ -4,22 +4,20 @@
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
Expand Down Expand Up @@ -54,15 +52,16 @@
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},
)
2 changes: 1 addition & 1 deletion xattr/__init__.py
Expand Up @@ -7,7 +7,7 @@
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,
Expand Down
2 changes: 1 addition & 1 deletion xattr/lib.py
Expand Up @@ -577,7 +577,7 @@
#define xattr_listxattr listxattr
#define xattr_flistxattr flistxattr
#endif
""")
""", ext_package='xattr')

XATTR_NOFOLLOW = lib.XATTR_NOFOLLOW
XATTR_CREATE = lib.XATTR_CREATE
Expand Down

0 comments on commit 9bd1640

Please sign in to comment.