Skip to content

Commit

Permalink
test: update nox file to build and test wheels (#1295)
Browse files Browse the repository at this point in the history
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-api-python-client/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)

Fixes #1235 馃

In an attempt to verify that this is a fix for #1235  I'm going push a commit that removes the fix from #1221 in this PR and confirm that the checks fail.
  • Loading branch information
parthea committed Apr 20, 2021
1 parent 937ae84 commit ff1e936
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion noxfile.py
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

0 comments on commit ff1e936

Please sign in to comment.