Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build wheel only once per tox invocation #180

Merged
merged 3 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changes
- the ldaptor whl is tested with tox. The sdist is now untested,
deprecated and should only be used for compatability with very old
packaging tools.
- the setup.py file is deprecated and will be removed in a future release.

Bugfixes
^^^^^^^^
Expand Down
16 changes: 10 additions & 6 deletions ldaptor/test/test_ldiftree.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def reverse_listdir():

self.addCleanup(reverse_listdir)

def chmod(self, path, mode):
self.addCleanup(os.chmod, path, os.stat(path).st_mode)
os.chmod(path, mode)


class Dir2LDIF(RandomizeListdirTestCase):
def setUp(self):
Expand Down Expand Up @@ -115,7 +119,7 @@ def testSimpleRead(self):

@skipIfWindowsOrRoot
def testNoAccess(self):
os.chmod(os.path.join(self.tree,
self.chmod(os.path.join(self.tree,
'dc=com.dir',
'dc=example.dir',
'cn=foo.ldif'),
Expand Down Expand Up @@ -445,29 +449,29 @@ def _cb_test_children_twoChildren_callback(self, r, children):

@skipIfWindowsOrRoot
def test_children_noAccess_dir_noRead(self):
os.chmod(self.meta.path, 0o300)
self.chmod(self.meta.path, 0o300)
d = self.meta.children()
def eb(fail):
fail.trap(OSError)
self.assertEqual(fail.value.errno, errno.EACCES)
os.chmod(self.meta.path, 0o755)
self.chmod(self.meta.path, 0o755)
d.addCallbacks(testutil.mustRaise, eb)
return d

@skipIfWindowsOrRoot
def test_children_noAccess_dir_noExec(self):
os.chmod(self.meta.path, 0o600)
self.chmod(self.meta.path, 0o600)
d = self.meta.children()
def eb(fail):
fail.trap(IOError)
self.assertEqual(fail.value.errno, errno.EACCES)
os.chmod(self.meta.path, 0o755)
self.chmod(self.meta.path, 0o755)
d.addCallbacks(testutil.mustRaise, eb)
return d

@skipIfWindowsOrRoot
def test_children_noAccess_file(self):
os.chmod(os.path.join(self.meta.path, u'cn=foo.ldif'), 0)
self.chmod(os.path.join(self.meta.path, u'cn=foo.ldif'), 0)
d = self.meta.children()
def eb(fail):
fail.trap(IOError)
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ envlist =

[testenv]
wheel = True
wheel_pep571 = True
wheel_pep517 = True
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wheel_build_env = build
deps =
coverage >= 5.3
pyparsing
Expand Down Expand Up @@ -67,6 +68,9 @@ commands =
{dev,linters}: pyflakes ldaptor
{dev,linters}: check-manifest

[testenv:build]
graingert marked this conversation as resolved.
Show resolved Hide resolved
# empty environment to build universal wheel once per tox invocation
# https://github.com/ionelmc/tox-wheel#build-configuration

[testenv:documentation]
deps = sphinx
Expand Down