Skip to content

Commit

Permalink
Merge pull request #590 from consideRatio/pr/refactor-test-as-opt-dep
Browse files Browse the repository at this point in the history
maint: replace test-requirements.txt with opt. dependencies
  • Loading branch information
GeorgianaElena committed Apr 7, 2023
2 parents 5c71e25 + 22d7dd3 commit a06b411
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:

- name: Install Python dependencies
run: |
pip install --upgrade . -r test-requirements.txt
pip install ".[test]"
pip list
- name: Downgrade to oldest dependencies
Expand Down
15 changes: 5 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,17 @@ To set up a development environment for this repository:

```
cd oauthenticator
pip install -e .
pip install -e ".[test]"
```

3. Install test dependencies
3. Install pre-commit hooks that checks formatting before commits are made.

```
pip install -r test-requirements.txt
pip install pre-commit
pre-commit install --install-hooks
```

4. Install pre-commit hooks that checks formatting before commits are made.

```
pre-commit install
```

5. Run tests
4. Run tests

```
pytest
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,17 @@ The [docs](https://oauthenticator.readthedocs.io/en/latest/tutorials/provider-sp

## Running tests

To run the tests locally:
To run the tests locally, first setup a development environment as described in
[CONTRIBUTING.md], and then do:

```
$ pip install --upgrade --pre -r test-requirements.txt
```

```
$ pytest -v ./oauthenticator/tests/
pytest -v ./oauthenticator/tests/
```

Or you run a specific test file with:

```
$ pytest -v ./oauthenticator/tests/<test-file-name>
pytest -v ./oauthenticator/tests/<test-file-name>
```

[contributing.md]: https://github.com/jupyterhub/oauthenticator/blob/main/CONTRIBUTING.md
26 changes: 24 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,31 @@ def run(self):


setup_args['extras_require'] = {
'googlegroups': ['google-api-python-client', 'google-auth-oauthlib'],
'mediawiki': ['mwoauth>=0.3.8'],
# azuread is required for use of AzureADOAuthenticator
'azuread': ['pyjwt>=2'],
# googlegroups is required for use of GoogleOAuthenticator configured with
# either admin_google_groups and/or allowed_google_groups.
'googlegroups': [
'google-api-python-client',
'google-auth-oauthlib',
],
# mediawiki is required for use of MWOAuthenticator
'mediawiki': ['mwoauth>=0.3.8'],
# test is required to run tests, and includes all authenticator specific
# dependencies above.
'test': [
'pytest>=2.8',
'pytest-asyncio',
'pytest-cov',
'requests-mock',
# dependencies from azuread:
'pyjwt>=2',
# dependencies from googlegroups:
'google-api-python-client',
'google-auth-oauthlib',
# dependencies from mediawiki:
'mwoauth>=0.3.8',
],
}


Expand Down
9 changes: 0 additions & 9 deletions test-requirements.txt

This file was deleted.

0 comments on commit a06b411

Please sign in to comment.