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

Add circleci for flake8 #7

Merged
merged 16 commits into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from 14 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: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2.0
jobs:
build:
docker:
- image: circleci/python:3.7.0
working_directory: ~/nativeauthenticator
steps:
- checkout
- run:
name: Installing dependencies
command: sudo pip install -r dev-requirements.txt
Copy link
Member

Choose a reason for hiding this comment

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

You likely want to pip install . here as well. Sudo might not be required if you use --user

Copy link
Contributor

Choose a reason for hiding this comment

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

To expand a little bit:

pip install . will install package in setup.py in current directory (.). Currently the error in CircleCI seems to be:

ModuleNotFoundError: No module named 'jupyterhub'

This is because the JupyterHub package is specified as part of install_requires in setup.py, but not in dev-requirements.txt. setup.py is the correct place for it, but we should use pip to run it before testing here.

- run:
name: Running flake8
command: flake8 .
- run:
name: Running tests
command: pytest nativeauthenticator
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest
pytest-asyncio
flake8
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def tmpcwd(tmpdir):
async def test_basic(tmpcwd):
auth = NativeAuthenticator()
response = await auth.authenticate(Mock(), {'username': 'name',
'password': '123'})
'password': '123'})
assert response == 'name'