Skip to content

Commit

Permalink
Cleanup dependencies (#356)
Browse files Browse the repository at this point in the history
* remove pytest from package dependency

* reorder packages

* make docker optional to install

* remove absl from our dependency
  • Loading branch information
suquark authored Feb 18, 2022
1 parent d424ad8 commit 7c64c4d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 37 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install pylint==2.8.2
# https://github.com/edaniszewski/pylint-quotes
pip install pylint-quotes
pip install ".[all]"
pip install pylint==2.8.2
pip install pylint-quotes==0.2.3
- name: Analysing the code with pylint
run: |
pylint --load-plugins pylint_quotes sky
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install ".[all]"
pip install pytest
- name: Run tests with pytest
run: pytest
4 changes: 4 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# formatting
yapf==0.32.0
pylint==2.8.2
# https://github.com/edaniszewski/pylint-quotes
pylint-quotes==0.2.3

# testing
pytest
10 changes: 1 addition & 9 deletions sky/clouds/service_catalog/data_fetchers/fetch_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import datetime
from typing import Tuple

from absl import app
from absl import logging
import numpy as np
import pandas as pd
import ray
Expand Down Expand Up @@ -137,14 +135,8 @@ def get_all_regions_instance_types_df():
return df


def main(argv):
del argv # Unused.
if __name__ == '__main__':
ray.init()
logging.set_verbosity(logging.DEBUG)
df = get_all_regions_instance_types_df()
df.to_csv(common.get_data_path('aws.csv'), index=False)
print('AWS Service Catalog saved to aws.csv')


if __name__ == '__main__':
app.run(main)
10 changes: 1 addition & 9 deletions sky/clouds/service_catalog/data_fetchers/fetch_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from typing import Optional, Tuple
import urllib

from absl import app
from absl import logging
import numpy as np
import pandas as pd
import ray
Expand Down Expand Up @@ -174,14 +172,8 @@ def get_additional_columns(row):
return df_ret


def main(argv):
del argv # Unused.
if __name__ == '__main__':
ray.init()
logging.set_verbosity(logging.DEBUG)
df = get_all_regions_instance_types_df()
df.to_csv('../data/azure.csv', index=False)
print('Azure Service Catalog saved to azure.csv')


if __name__ == '__main__':
app.run(main)
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
https://cloud.google.com/sdk/gcloud/reference/compute/machine-types/list
"""

from absl import app
from absl import logging
import numpy as np
import pandas as pd

Expand Down Expand Up @@ -94,13 +92,7 @@ def get_gpu_tpu_df():
return df


def main(argv):
del argv # Unused.
logging.set_verbosity(logging.DEBUG)
if __name__ == '__main__':
df = get_gpu_tpu_df()
df.to_csv('../data/gcp.csv', index=False)
print('GCP Service Catalog saved to gcp.csv')


if __name__ == '__main__':
app.run(main)
4 changes: 3 additions & 1 deletion sky/setup_files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
# Sky requires python version >= 3.6

# You can just install the dependencies for
# certain clouds, e.g., ".[aws,azure,gcp]"
# certain clouds or containers, e.g., ".[aws,azure,gcp,docker]"

# Use "all" to install all dependencies
pip install -e ".[all]"

python examples/resnet_app.py
Expand Down
6 changes: 2 additions & 4 deletions sky/setup_files/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
ROOT_DIR = os.path.dirname(__file__)

install_requires = [
'wheel',
'Click',
'absl-py',
'colorama',
'jinja2',
'networkx',
Expand All @@ -15,17 +15,15 @@
'pycryptodome==3.12.0',
'pendulum',
'PrettyTable',
'pytest',
'ray[default]',
'tabulate',
'docker',
'wheel',
]

extras_require = {
'aws': ['awscli==1.22.17', 'boto3'],
'azure': ['azure-cli==2.30.0'],
'gcp': ['google-api-python-client', 'google-cloud-storage'],
'docker': ['docker'],
}

extras_require['all'] = sum(extras_require.values(), [])
Expand Down

0 comments on commit 7c64c4d

Please sign in to comment.