Skip to content

Commit

Permalink
fixing requirements and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ncilfone committed Jul 12, 2021
1 parent b7c5434 commit 50ae500
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- name: Install dependencies and dev dependencies
run: |
python -m pip install --upgrade pip
pip install -r REQUIREMENTS.txt
pip install -r ./requirements/DEV_REQUIREMENTS.txt
pip install -r ./requirements/S3_REQUIREMENTS.txt
Expand Down
8 changes: 4 additions & 4 deletions docs/addons/S3.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ session = boto3.Session(

### Using the S3Config Object

As an example let's create a basic `@spock` decorated class, instantiate a `S3Config` object from `spock.addons` with
As an example let's create a basic `@spock` decorated class, instantiate a `S3Config` object from `spock.addons.s3` with
the `boto3.session.Session` we created above, and pass it to the `ConfigArgBuilder`.

```python
from spock.addons import S3Config
from spock.addons.s3 import S3Config
from spock.builder import ConfigArgBuilder
from spock.config import spock
from typing import List
Expand Down Expand Up @@ -123,8 +123,8 @@ With a `S3Config` object passed into the `ConfigArgBuilder` the S3 URI will auto
If you require any other settings for uploading or downloading files from S3 the `S3Config` class has two extra
attributes:

`download_config` which takes a `S3DownloadConfig` object from `spock.addons` which supports all ExtraArgs from
`download_config` which takes a `S3DownloadConfig` object from `spock.addons.s3` which supports all ExtraArgs from
[S3Transfer.ALLOWED_DOWNLOAD_ARGS](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/customizations/s3.html#boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS)

`upload_config` which takes a `S3UploadConfig` object from `spock.addons` which supports all ExtraArgs from
`upload_config` which takes a `S3UploadConfig` object from `spock.addons.s3` which supports all ExtraArgs from
[S3Transfer.ALLOWED_UPLOAD_ARGS](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/customizations/s3.html#boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS)
3 changes: 1 addition & 2 deletions examples/tune/optuna/tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
# https://optuna.readthedocs.io/en/stable/tutorial/20_recipes/009_ask_and_tell.html#define-and-run


import optuna
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split

from spock.addons import spockTuner
from spock.addons.tune import spockTuner
from spock.addons.tune.config import (
ChoiceHyperParameter,
OptunaTunerConfig,
Expand Down
2 changes: 2 additions & 0 deletions requirements/DEV_REQUIREMENTS.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
black
coveralls
coverage
isort
moto
portray
pytest
Expand Down
6 changes: 2 additions & 4 deletions spock/addons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
Please refer to the documentation provided in the README.md
"""
from spock.addons.s3.configs import S3DownloadConfig, S3UploadConfig
from spock.addons.s3.utils import S3Config
from spock.addons.tune.config import spockTuner

__all__ = ["s3", "S3Config", "S3DownloadConfig", "S3UploadConfig", "spockTuner"]

__all__ = ["s3", "tune"]
5 changes: 4 additions & 1 deletion spock/addons/s3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
Please refer to the documentation provided in the README.md
"""

__all__ = ["configs", "utils"]
from spock.addons.s3.configs import S3DownloadConfig, S3UploadConfig
from spock.addons.s3.configs import S3Config

__all__ = ["configs", "utils", "S3Config", "S3DownloadConfig", "S3UploadConfig"]
3 changes: 2 additions & 1 deletion spock/addons/tune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
Please refer to the documentation provided in the README.md
"""

from spock.addons.tune.config import spockTuner

__all__ = ["builder", "config"]
__all__ = ["builder", "config", "spockTuner"]
2 changes: 1 addition & 1 deletion tests/s3/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import datetime
from tests.base.base_asserts_test import *
from spock.builder import ConfigArgBuilder
from spock.addons import S3Config
from spock.addons.s3 import S3Config
from tests.base.attr_configs_test import *
from tests.s3.fixtures_test import *
import re
Expand Down
2 changes: 1 addition & 1 deletion tests/s3/test_raises.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import datetime
from spock.builder import ConfigArgBuilder
from spock.addons import S3Config
from spock.addons.s3 import S3Config
from tests.base.attr_configs_test import *
from tests.s3.fixtures_test import *
import sys
Expand Down

0 comments on commit 50ae500

Please sign in to comment.