Skip to content

Commit

Permalink
Make tests work with [dev]
Browse files Browse the repository at this point in the history
  • Loading branch information
aversey committed Jun 28, 2024
1 parent 9f26ed7 commit b9d7e8d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 46 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "python/setup.py"
- run: pip install -e python[python,dev]
- run: pip install -e python[dev]

- name: Display Python version
run: python --version
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "python/setup.py"
- run: pip install -e python[python,dev-pandas1]
- run: pip install -e python[dev-pandas1]

- name: Display Python version
run: python --version
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "python/setup.py"
- run: pip install -e 'python[python,dev]'
- run: pip install -e 'python[dev]'

- name: Display Python version
run: python --version
Expand All @@ -154,7 +154,7 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "python/setup.py"
- run: pip install -e python[python,dev,docs]
- run: pip install -e python[dev,docs]

- name: Run Pytest suite
env:
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "python/setup.py"
- run: pip install -e python[python,dev]
- run: pip install -e python[dev]

- name: Display Python version
run: python --version
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "python/setup.py"
- run: pip install -e python[python,dev]
- run: pip install -e python[dev]

- name: Display Python version
run: python --version
Expand Down
75 changes: 43 additions & 32 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,14 @@ dependencies = [
"pyjks",
"mock",
"tqdm",
####################### from hsfs:
# "pyhumps==1.6.1",
# "requests",
# "furl",
# "boto3",
"pandas<2.2.0", # has to be
# "numpy<2",
# "pyjks",
# "mock",
"avro==1.11.3", # has to be
# "sqlalchemy",
# "PyMySQL[rsa]",
# "tzlocal",
# "fsspec",
"retrying", # has to be
"hopsworks_aiomysql[sa]==0.2.1", # has to be
"polars>=0.20.18,<=0.21.0", # has to be
"opensearch-py>=1.1.0,<=2.4.2", # has to be
####################### from hsml:
# "pyhumps==1.6.1",
# "requests",
# "furl",
# "boto3",
# "pandas",
# "numpy",
# "pyjks",
# "mock",
# "tqdm",
"grpcio>=1.49.1,<2.0.0", # ^1.49.1 # has to be
"protobuf>=3.19.0,<4.0.0", # ^3.19.0 # has to be
"pandas<2.2.0",
"avro==1.11.3",
"retrying",
"hopsworks_aiomysql[sa]==0.2.1",
"polars>=0.20.18,<=0.21.0",
"opensearch-py>=1.1.0,<=2.4.2",
"grpcio>=1.49.1,<2.0.0", # ^1.49.1
"protobuf>=3.19.0,<4.0.0", # ^3.19.0
]

[project.optional-dependencies]
Expand Down Expand Up @@ -108,7 +86,31 @@ dev-pandas1 = [
"pandas<=1.5.3",
"sqlalchemy<=1.4.48",
]
dev = ["hopsworks[dev-no-opt]", "hopsworks[great-expectations]"]
miscellaneous = [
# from hsfs:
"pyhumps==1.6.1",
"requests",
"furl",
"boto3",
"numpy<2",
"pyjks",
"mock",
"sqlalchemy",
"PyMySQL[rsa]",
"tzlocal",
"fsspec",
# from hsml:
"pyhumps==1.6.1",
"requests",
"furl",
"boto3",
"pandas",
"numpy",
"pyjks",
"mock",
"tqdm",
]
dev = ["hopsworks[dev-no-opt,great-expectations,python,miscellaneous]"]


[build-system]
Expand All @@ -117,7 +119,16 @@ build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
exclude = ["tests*"]
include = ["../README.md", "../LICENSE", "hopsworks", "hopsworks.*", "hsfs", "hsfs.*", "hsml", "hsml.*"]
include = [
"../README.md",
"../LICENSE",
"hopsworks",
"hopsworks.*",
"hsfs",
"hsfs.*",
"hsml",
"hsml.*",
]

[tool.setuptools.dynamic]
version = { attr = "hopsworks.version.__version__" }
Expand Down
8 changes: 0 additions & 8 deletions python/tests/hopsworks/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def _check_api_key_existence(self):
)

def test_login_api_key_as_input(self):
return # TODO fix the test
# Should accept api key as input from command line

path, in_cwd, in_home, in_tmp = self._check_api_key_existence()
Expand All @@ -108,7 +107,6 @@ def test_login_api_key_as_input(self):
assert in_tmp is False

def test_login_api_key_as_argument(self):
return # TODO fix the test
# Should accept api key as argument
path, in_cwd, in_home, in_tmp = self._check_api_key_existence()

Expand All @@ -126,7 +124,6 @@ def test_login_api_key_as_argument(self):
assert in_tmp is False

def test_login_cmd_input_incorrect(self):
return # TODO fix the test
# Should fail to login with incorrect API key

path, in_cwd, in_home, in_tmp = self._check_api_key_existence()
Expand All @@ -140,7 +137,6 @@ def test_login_cmd_input_incorrect(self):
hopsworks.login()

def test_login_fallback_to_tmp(self):
return # TODO fix the test
# Should fall back to storing api key in tmp folder if home is not write and executable for user
os.chmod(self.home_dir, 0o400)

Expand All @@ -160,7 +156,6 @@ def test_login_fallback_to_tmp(self):
assert in_tmp is True and os.path.exists(path)

def test_login_use_cwd_api_key(self):
return # TODO fix the test
# Should use API key in cwd if exists

api_key_path = os.path.join(os.getcwd(), ".hw_api_key")
Expand All @@ -183,7 +178,6 @@ def test_login_use_cwd_api_key(self):
assert in_tmp is False

def test_login_use_home_api_key(self):
return # TODO fix the test
# Should use API key in home if exists

api_key_folder_path = os.path.join(
Expand All @@ -209,7 +203,6 @@ def test_login_use_home_api_key(self):
assert in_tmp is False

def test_login_api_key_as_environ(self):
return # TODO fix the test
# Should accept api key as environmet variable
try:
os.environ["HOPSWORKS_API_KEY"] = os.environ["APP_API_KEY"]
Expand All @@ -234,7 +227,6 @@ def test_login_api_key_as_environ(self):
del os.environ["HOPSWORKS_API_KEY"]

def test_login_newline_in_api_key(self):
return # TODO fix the test
try:
imaginaryApiKey = "ImaginaryApiKey\n"
hopsworks.login(api_key_value=imaginaryApiKey)
Expand Down

0 comments on commit b9d7e8d

Please sign in to comment.