From ae1ab3eec6f829042250d2ee4ac850dcf247d597 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Mon, 21 Jul 2014 05:18:30 +0200 Subject: [PATCH] Imported Upstream version 0.5.2 --- .gitignore | 10 --------- MANIFEST.in | 6 +++--- Makefile | 15 +++++++++---- NEWS | 5 +++++ PKG-INFO | 12 +++++++++++ README | 6 +++--- doc/conf.py | 6 +++--- pylibacl.egg-info/PKG-INFO | 12 +++++++++++ pylibacl.egg-info/SOURCES.txt | 19 ++++++++++++++++ pylibacl.egg-info/dependency_links.txt | 1 + pylibacl.egg-info/top_level.txt | 1 + setup.cfg | 7 +++++- setup.py | 6 +++--- {tests => test}/__init__.py | 0 {tests => test}/test_acls.py | 30 +++++++++++++++----------- 15 files changed, 96 insertions(+), 40 deletions(-) delete mode 100644 .gitignore create mode 100644 PKG-INFO create mode 100644 pylibacl.egg-info/PKG-INFO create mode 100644 pylibacl.egg-info/SOURCES.txt create mode 100644 pylibacl.egg-info/dependency_links.txt create mode 100644 pylibacl.egg-info/top_level.txt rename {tests => test}/__init__.py (100%) rename {tests => test}/test_acls.py (92%) diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e108039..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/MANIFEST -/build -/dist -/doc/doctrees -/doc/html -/posix1e.html -/posix1e.so -/posix1e.txt -/pylibacl.egg-info -*.py[co] diff --git a/MANIFEST.in b/MANIFEST.in index 04fba87..f570711 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,9 @@ include COPYING -include IMPLEMENTATION -include MANIFEST include Makefile include NEWS -include PLATFORMS include README include acl.c include setup.cfg +include doc/conf.py +include doc/*.rst +include test/*.py diff --git a/Makefile b/Makefile index 0ba620d..2005cc3 100644 --- a/Makefile +++ b/Makefile @@ -19,17 +19,24 @@ $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES) doc: $(DOCHTML)/index.html +dist: + fakeroot ./setup.py sdist + test: - for ver in 2.4 2.5 2.6 2.7 3.0 3.1 3.2; do \ + @for ver in 2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3 3.4; do \ if type python$$ver >/dev/null; then \ echo Testing with python$$ver; \ - python$$ver ./setup.py test; \ - fi; \ + python$$ver ./setup.py test -q; \ + fi; \ done + @if type pypy >/dev/null; then \ + echo Testing with pypy; \ + pypy ./setup.py test -q; \ + fi clean: rm -rf $(DOCHTML) $(DOCTREES) rm -f $(MODNAME) rm -rf build -.PHONY: doc test clean +.PHONY: doc test clean dist diff --git a/NEWS b/NEWS index a84e674..95bdd6d 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ News ==== +Version 0.5.2 +------------- + +No visible changes release: just fix tests when running under pypy. + Version 0.5.1 ------------- diff --git a/PKG-INFO b/PKG-INFO new file mode 100644 index 0000000..7cd2842 --- /dev/null +++ b/PKG-INFO @@ -0,0 +1,12 @@ +Metadata-Version: 1.0 +Name: pylibacl +Version: 0.5.2 +Summary: POSIX.1e ACLs for python +Home-page: http://pylibacl.k1024.org/ +Author: Iustin Pop +Author-email: iusty@k1024.org +License: LGPL +Description: This is a C extension module for Python which + implements POSIX ACLs manipulation. It is a wrapper on top + of the systems's acl C library - see acl(5). +Platform: UNKNOWN diff --git a/README b/README index 7b42b08..6978428 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ POSIX.1e Access Control Lists present in some OS/file-systems combinations. Downloads: go to https://github.com/iustin/pylibacl/downloads. Latest -version is 0.5.1. The source repository is either +version is 0.5.2. The source repository is either at ``_ or at https://github.com/iustin/pylibacl. @@ -20,7 +20,7 @@ pylibacl has been written and tested on Linux, kernel v2.4 or newer, with XFS filesystems; ext2/ext3 should also work. Since release 0.4.0, FreeBSD 7 also has quite good support. If any other platform implements the POSIX.1e draft, pylibacl can be used. I heard that -Solaris does, but I can't test it yet. +Solaris does, but I can't test it. - Python 2.4 or newer - operating system: @@ -33,7 +33,7 @@ Solaris does, but I can't test it yet. License ------- -pylibacl is Copyright (C) 2002-2009, 2012 Iustin Pop. +pylibacl is Copyright (C) 2002-2009, 2012, 2014 Iustin Pop. pylibacl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free diff --git a/doc/conf.py b/doc/conf.py index 3b2d215..e8299c1 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -41,16 +41,16 @@ master_doc = 'index' # General information about the project. project = u'pylibacl' -copyright = u'2002-2009, 2012, Iustin Pop' +copyright = u'2002-2009, 2012, 2014, Iustin Pop' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.5.1' +version = '0.5.2' # The full version, including alpha/beta/rc tags. -release = '0.5.1' +release = '0.5.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/pylibacl.egg-info/PKG-INFO b/pylibacl.egg-info/PKG-INFO new file mode 100644 index 0000000..7cd2842 --- /dev/null +++ b/pylibacl.egg-info/PKG-INFO @@ -0,0 +1,12 @@ +Metadata-Version: 1.0 +Name: pylibacl +Version: 0.5.2 +Summary: POSIX.1e ACLs for python +Home-page: http://pylibacl.k1024.org/ +Author: Iustin Pop +Author-email: iusty@k1024.org +License: LGPL +Description: This is a C extension module for Python which + implements POSIX ACLs manipulation. It is a wrapper on top + of the systems's acl C library - see acl(5). +Platform: UNKNOWN diff --git a/pylibacl.egg-info/SOURCES.txt b/pylibacl.egg-info/SOURCES.txt new file mode 100644 index 0000000..b73697b --- /dev/null +++ b/pylibacl.egg-info/SOURCES.txt @@ -0,0 +1,19 @@ +COPYING +MANIFEST.in +Makefile +NEWS +README +acl.c +setup.cfg +setup.py +doc/conf.py +doc/implementation.rst +doc/index.rst +doc/module.rst +doc/news.rst +pylibacl.egg-info/PKG-INFO +pylibacl.egg-info/SOURCES.txt +pylibacl.egg-info/dependency_links.txt +pylibacl.egg-info/top_level.txt +test/__init__.py +test/test_acls.py \ No newline at end of file diff --git a/pylibacl.egg-info/dependency_links.txt b/pylibacl.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/pylibacl.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/pylibacl.egg-info/top_level.txt b/pylibacl.egg-info/top_level.txt new file mode 100644 index 0000000..78cf476 --- /dev/null +++ b/pylibacl.egg-info/top_level.txt @@ -0,0 +1 @@ +posix1e diff --git a/setup.cfg b/setup.cfg index f8c1ed7..cacd252 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,9 @@ [bdist_rpm] release = 1 requires = libacl -;build_requires = libacl libacl-devel + +[egg_info] +tag_build = +tag_date = 0 +tag_svn_revision = 0 + diff --git a/setup.py b/setup.py index dbb5f56..9c8f2cd 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ long_desc = """This is a C extension module for Python which implements POSIX ACLs manipulation. It is a wrapper on top of the systems's acl C library - see acl(5).""" -version = "0.5.1" +version = "0.5.2" setup(name="pylibacl", version=version, @@ -38,11 +38,11 @@ setup(name="pylibacl", long_description=long_desc, author="Iustin Pop", author_email="iusty@k1024.org", - url="http://pylibacl.sourceforge.net/", + url="http://pylibacl.k1024.org/", license="LGPL", ext_modules=[Extension("posix1e", ["acl.c"], libraries=libs, define_macros=macros, )], - test_suite="tests", + test_suite="test", ) diff --git a/tests/__init__.py b/test/__init__.py similarity index 100% rename from tests/__init__.py rename to test/__init__.py diff --git a/tests/test_acls.py b/test/test_acls.py similarity index 92% rename from tests/test_acls.py rename to test/test_acls.py index 45cd0ed..08bfd4e 100644 --- a/tests/test_acls.py +++ b/test/test_acls.py @@ -25,11 +25,12 @@ import unittest import os import tempfile import sys +import platform import posix1e from posix1e import * -TEST_DIR = os.environ.get("TESTDIR", ".") +TEST_DIR = os.environ.get("TEST_DIR", ".") BASIC_ACL_TEXT = "u::rw,g::r,o::-" @@ -151,14 +152,14 @@ class AclExtensions(aclTest, unittest.TestCase): basic_acl.applyto(fd) for item in fd, fname: self.assertFalse(has_extended(item), - "A simple ACL should not be reported as extended") + "A simple ACL should not be reported as extended") enhanced_acl = posix1e.ACL(text="u::rw,g::-,o::-,u:root:rw,mask::r") self.assertTrue(enhanced_acl.valid(), "Failure to build an extended ACL") enhanced_acl.applyto(fd) for item in fd, fname: self.assertTrue(has_extended(item), - "An extended ACL should be reported as such") + "An extended ACL should be reported as such") @has_ext(HAS_EQUIV_MODE) def testEquivMode(self): @@ -197,13 +198,15 @@ class ModificationTests(aclTest, unittest.TestCase): def checkRef(self, obj): """Checks if a given obj has a 'sane' refcount""" + if platform.python_implementation() == "PyPy": + return ref_cnt = sys.getrefcount(obj) # FIXME: hardcoded value for the max ref count... but I've # seen it overflow on bad reference counting, so it's better # to be safe if ref_cnt < 2 or ref_cnt > 1024: - self.fail("Wrong reference count, expected 2-1024 and got %d" % - ref_cnt) + self.fail("Wrong reference count, expected 2-1024 and got %d" % + ref_cnt) def testStr(self): """Test str() of an ACL.""" @@ -242,7 +245,8 @@ class ModificationTests(aclTest, unittest.TestCase): e.tag_type = tag_type e.permset.clear() self.assertFalse(acl.valid(), - "ACL containing duplicate entries should not be valid") + "ACL containing duplicate entries" + " should not be valid") acl.delete_entry(e) @has_ext(HAS_ACL_ENTRY) @@ -259,8 +263,8 @@ class ModificationTests(aclTest, unittest.TestCase): e.permset.clear() acl.calc_mask() self.assertTrue(acl.valid(), - "ACL should be able to hold multiple" - " user/group entries") + "ACL should be able to hold multiple" + " user/group entries") @has_ext(HAS_ACL_ENTRY) def testMultipleBadEntries(self): @@ -276,14 +280,14 @@ class ModificationTests(aclTest, unittest.TestCase): e1.permset.clear() acl.calc_mask() self.assertTrue(acl.valid(), "ACL should be able to add a" - " user/group entry") + " user/group entry") e2 = acl.append() e2.tag_type = tag_type e2.qualifier = 0 e2.permset.clear() acl.calc_mask() self.assertFalse(acl.valid(), "ACL should not validate when" - " containing two duplicate entries") + " containing two duplicate entries") acl.delete_entry(e1) acl.delete_entry(e2) @@ -305,15 +309,15 @@ class ModificationTests(aclTest, unittest.TestCase): str_ps = str(ps) self.checkRef(str_ps) self.assertFalse(ps.test(perm), "Empty permission set should not" - " have permission '%s'" % pmap[perm]) + " have permission '%s'" % pmap[perm]) ps.add(perm) self.assertTrue(ps.test(perm), "Permission '%s' should exist" - " after addition" % pmap[perm]) + " after addition" % pmap[perm]) str_ps = str(ps) self.checkRef(str_ps) ps.delete(perm) self.assertFalse(ps.test(perm), "Permission '%s' should not exist" - " after deletion" % pmap[perm]) + " after deletion" % pmap[perm]) if __name__ == "__main__": -- 2.39.5