Skip to content

test: update nox file to build and test wheels #1295

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

Merged
merged 4 commits into from
Apr 20, 2021
Merged
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
17 changes: 16 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import sys

import nox
import os
import shutil

test_dependencies = [
"django>=2.0.0",
Expand Down Expand Up @@ -58,9 +60,22 @@ def lint(session):
],
)
def unit(session, oauth2client):
# Clean up dist and build folders
shutil.rmtree('dist', ignore_errors=True)
shutil.rmtree('build', ignore_errors=True)

session.install(*test_dependencies)
session.install(oauth2client)
session.install('.')

# Create and install wheels
session.run('python3', 'setup.py', 'bdist_wheel')
session.install(os.path.join('dist', os.listdir('dist').pop()))

# Run tests from a different directory to test the package artifacts
root_dir = os.path.dirname(os.path.realpath(__file__))
temp_dir = session.create_tmp()
session.chdir(temp_dir)
shutil.copytree(os.path.join(root_dir, 'tests'), 'tests')

# Run py.test against the unit tests.
session.run(
Expand Down