Skip to content

Commit 0bdb3b1

Browse files
authored
dependencies must be separated by ; instead of , (#15)
1 parent 3a3f266 commit 0bdb3b1

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
Anything MAY change at any time. The public API SHOULD NOT be considered stable.").
1010
While in this phase, we will denote breaking changes with a minor increase.
1111

12+
13+
## 0.3.0
14+
### Changed
15+
* Dependencies passed in CLI `--pkg-dependencies` or `PyProjectConfig` must be separated by `;` or newline (previously was `,` or newline)
16+
1217
## 0.2.0
1318
### Added
1419
* First release of `dac`

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ build-backend = "setuptools.build_meta"
5353

5454
[tool.black]
5555
line-length = 120
56+
57+
[tool.ruff]
58+
line-length = 120

src/dac/_input/pyproject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ def generate_pyproject_toml(self) -> str:
2828

2929
def _get_list_of_project_dependencies(self) -> List[str]:
3030
splitted_by_newline = self.project_dependencies.splitlines()
31-
splitted_by_newline_or_comma = [s for ss in splitted_by_newline for s in ss.split(",")]
31+
splitted_by_newline_or_comma = [s for ss in splitted_by_newline for s in ss.split(";")]
3232
return sorted(map(lambda x: x.strip(), splitted_by_newline_or_comma))

test/unit_test/_input/pyproject_test.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import pytest
44
import toml # type: ignore
5-
65
from dac._input.pyproject import PyProjectConfig
76

87

@@ -11,7 +10,9 @@ def test_if_dependencies_are_passed_as_comma_separated_then_valid_pyproject_is_p
1110
project_name: str, project_version: str
1211
):
1312
pm = PyProjectConfig(
14-
project_name=project_name, project_version=project_version, project_dependencies="pandas,adlfs, pyarrow"
13+
project_name=project_name,
14+
project_version=project_version,
15+
project_dependencies="pandas;adlfs; pyarrow",
1516
)
1617
toml_content = pm.generate_pyproject_toml()
1718
parsed_toml = toml.loads(toml_content)
@@ -46,7 +47,11 @@ def test_if_dependencies_are_passed_from_cat_requirements_then_valid_pyproject_i
4647
)
4748
def test_if_invalid_project_name_then_raise_error(name: str):
4849
with pytest.raises(ValueError) as e:
49-
PyProjectConfig(project_name=name, project_version="0.1.2", project_dependencies="pandas,adlfs,pyarrow")
50+
PyProjectConfig(
51+
project_name=name,
52+
project_version="0.1.2",
53+
project_dependencies="pandas,adlfs,pyarrow",
54+
)
5055
assert "Invalid project name" in str(e.value)
5156

5257

@@ -55,4 +60,8 @@ def test_if_invalid_project_name_then_raise_error(name: str):
5560
["valid", "va_lid"],
5661
)
5762
def test_if_valid_project_name_then_dont_raise_error(name: str):
58-
PyProjectConfig(project_name=name, project_version="0.1.2", project_dependencies="pandas,adlfs,pyarrow")
63+
PyProjectConfig(
64+
project_name=name,
65+
project_version="0.1.2",
66+
project_dependencies="pandas,adlfs,pyarrow",
67+
)

0 commit comments

Comments
 (0)