Skip to content

Commit c8093cb

Browse files
committed
test: update nox file to build and test wheels
1 parent 937ae84 commit c8093cb

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

noxfile.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
import sys
1717

1818
import nox
19+
import os
20+
import shutil
21+
from shutil import rmtree
1922

2023
test_dependencies = [
2124
"django>=2.0.0",
@@ -58,9 +61,22 @@ def lint(session):
5861
],
5962
)
6063
def unit(session, oauth2client):
64+
# Clean up dist and build folders
65+
rmtree('dist', ignore_errors=True)
66+
rmtree('build', ignore_errors=True)
67+
6168
session.install(*test_dependencies)
6269
session.install(oauth2client)
63-
session.install('.')
70+
71+
# Create and install wheels
72+
session.run('python3', 'setup.py', 'bdist_wheel')
73+
session.install(os.path.join('dist', os.listdir('dist').pop()))
74+
75+
# Run tests from a different directory to test the package artifacts
76+
root_dir = os.path.dirname(os.path.realpath(__file__))
77+
temp_dir = session.create_tmp()
78+
session.chdir(temp_dir)
79+
shutil.copytree(os.path.join(root_dir, 'tests'), 'tests')
6480

6581
# Run py.test against the unit tests.
6682
session.run(

0 commit comments

Comments
 (0)