Skip to content

Commit

Permalink
prep packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
LSYS committed Aug 28, 2022
1 parent 5e65c7d commit d0e721c
Show file tree
Hide file tree
Showing 7 changed files with 501 additions and 4 deletions.
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.DEFAULT_GOAL := help

.PHONY: test
test: # Run tests with pytest and coverage
test:
coverage erase
coverage run -m pytest -v
coverage report -m

BLACK_OPTS := -l 95
SRC_FILES := arg_validators dataframe_utils graph_utils plot text_utils
SRC_FILES := $(addprefix pyforestplot/, $(addsuffix .py, $(SRC_FILES)))
.PHONY: lint
lint: # Check with mypy, pyflakes, black
lint:
mypy $(SRC_FILES) --ignore-missing-imports
python -m pyflakes tests/*.py $(SRC_FILES)
black pyforestplot/*.py $(BLACK_OPTS)
black tests/*.py $(BLACK_OPTS)

.PHONY: prepack
prepack: # Prepare packaging for PyPi
prepack:
@rm -rf dist/ pyforestplot.egg-info/
@python setup.py sdist
twine check dist/*

PACKAGE_FILES := build/ dist/ *.egg-info/ *.egg
.PHONY: cleanpack
cleanpack: # Remove distribution/packaging files
cleanpack:
@rm -rf $(PACKAGE_FILES)

.PHONY: help
help: # Show Help
@egrep -h '\s#\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
2 changes: 1 addition & 1 deletion pyforestplot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# from pyforestplot.plot import *
from pyforestplot.plot import forestplot
from pyforestplot.dataframe_utils import load_data
7 changes: 5 additions & 2 deletions pyforestplot/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ def draw_pval_right(


def draw_yticklabel2(
dataframe: pd.core.frame.DataFrame, ax: Axes, **kwargs: Any
dataframe: pd.core.frame.DataFrame,
annoteheaders: Union[Sequence[str], None],
ax: Axes,
**kwargs: Any
) -> Tuple[Axes, float]:
"""
Draw the second ylabel title on the right-hand side y-axis.
Expand Down Expand Up @@ -282,7 +285,7 @@ def draw_yticklabel2(

extrapad = 0.05
pad = ax.get_xlim()[1] * (1 + extrapad)
if ix == group_row_ix:
if (ix == group_row_ix) and (annoteheaders is not None):
t = ax.text(
x=pad,
y=yticklabel1,
Expand Down
Loading

0 comments on commit d0e721c

Please sign in to comment.