Skip to content

Commit

Permalink
0.8.4 (#120)
Browse files Browse the repository at this point in the history
* βž– Add optional deps to extras so they aren't installed by default

* πŸ”– 0.8.4

* πŸ‘· Update CI

* 🎨 Giva better message when optional packages not installed
  • Loading branch information
pwwang authored May 14, 2022
1 parent ba50a00 commit 4f282c7
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 14 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ jobs:
python -m pip install flake8
python -m pip install poetry
poetry config virtualenvs.create false
poetry install -E pdtypes -v
pip install wcwidth
pip install scipy
pip install python-slugify
poetry install -E pdtypes -E scipy -E wcwidth -E slugify -v
# reinstall pandas to specific version
pip install -U $PANDAS
env:
Expand Down Expand Up @@ -94,10 +91,7 @@ jobs:
python -m pip install flake8
python -m pip install poetry
poetry config virtualenvs.create false
poetry install -E modin -E pdtypes -v
pip install wcwidth
pip install scipy
pip install python-slugify
poetry install -E modin -E pdtypes -E scipy -E wcwidth -E slugify -v
# reinstall modin to specific version
pip install -U $MODIN
env:
Expand Down
2 changes: 1 addition & 1 deletion datar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)

__all__ = ("f", "get_versions")
__version__ = "0.8.3"
__version__ = "0.8.4"

apply_init_callbacks()

Expand Down
3 changes: 2 additions & 1 deletion datar/base/bessel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def _get_special_func_from_scipy(name):
from scipy import special
except ImportError as imperr: # pragma: no cover
raise ValueError(
"Bessel functions require scipy to be installed."
"`bessel` family requires `scipy` package.\n"
"Try: pip install -U datar[scipy]"
) from imperr

return getattr(special, name)
Expand Down
9 changes: 8 additions & 1 deletion datar/base/funs.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,14 @@ def make_names(names, unique=False):
Returns:
Converted names
"""
from slugify import slugify
try:
from slugify import slugify
except ImportError as imerr: # pragma: no cover
raise ValueError(
"`make_names()` requires `python-slugify` package.\n"
"Try: pip install -U datar[slugify]"
) from imerr

from . import as_character

if is_scalar(names):
Expand Down
8 changes: 7 additions & 1 deletion datar/base/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,13 @@ def _nchar_scalar(x, retn, allow_na, keep_na, na_len):
return np.nan if keep_na else na_len

if retn == "width":
from wcwidth import wcswidth
try:
from wcwidth import wcswidth
except ImportError as imperr: # pragma: no cover
raise ValueError(
"`nchar(x, type='width')` requires `wcwidth` package.\n"
"Try: pip install -U datar[wcwidth]"
) from imperr

return wcswidth(x)
if retn == "chars":
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.8.4

- βž– Add optional deps to extras so they aren't installed by default
- 🎨 Giva better message when optional packages not installed

## 0.8.3

- ⬆️ Upgrade pipda to v0.6
Expand Down
5 changes: 4 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "datar"
version = "0.8.3"
version = "0.8.4"
description = "Port of dplyr and other related R packages in python, using pipda."
authors = ["pwwang <[email protected]>"]
readme = "README.md"
Expand Down Expand Up @@ -28,6 +28,9 @@ modin = {version = "^0.10", optional = true}
[tool.poetry.extras]
pdtypes = ["pdtypes"]
modin = ["modin"]
scipy = ["scipy"]
wcwidth = ["wcwidth"]
slugify = ["python-slugify"]

[tool.poetry.dev-dependencies]
pytest = "^7"
Expand Down

0 comments on commit 4f282c7

Please sign in to comment.