Skip to content

Commit

Permalink
update Makefile to use target_version variable and update spellbook r…
Browse files Browse the repository at this point in the history
…equirements in examples
  • Loading branch information
bgunnar5 committed Feb 19, 2025
1 parent e6b23ee commit 20d5534
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 28 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ check-flake8:

check-black:
. $(VENV)/bin/activate; \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version py38 $(MRLN); \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version py38 $(TEST); \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version py38 *.py; \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) $(MRLN); \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) $(TEST); \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) *.py; \


check-isort:
Expand Down Expand Up @@ -182,9 +182,9 @@ fix-style:
$(PYTHON) -m isort -w $(MAX_LINE_LENGTH) $(MRLN); \
$(PYTHON) -m isort -w $(MAX_LINE_LENGTH) $(TEST); \
$(PYTHON) -m isort -w $(MAX_LINE_LENGTH) *.py; \
$(PYTHON) -m black --target-version py38 -l $(MAX_LINE_LENGTH) $(MRLN); \
$(PYTHON) -m black --target-version py38 -l $(MAX_LINE_LENGTH) $(TEST); \
$(PYTHON) -m black --target-version py38 -l $(MAX_LINE_LENGTH) *.py; \
$(PYTHON) -m black --target-version $(PY_TARGET_VER) -l $(MAX_LINE_LENGTH) $(MRLN); \
$(PYTHON) -m black --target-version $(PY_TARGET_VER) -l $(MAX_LINE_LENGTH) $(TEST); \
$(PYTHON) -m black --target-version $(PY_TARGET_VER) -l $(MAX_LINE_LENGTH) *.py; \


# Increment the Merlin version. USE ONLY ON DEVELOP BEFORE MERGING TO MASTER.
Expand Down
1 change: 1 addition & 0 deletions config.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PYTHON?=python3
PY_TARGET_VER?=py311
PYV=$(shell $(PYTHON) -c "import sys;t='{v[0]}_{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)")
PYVD=$(shell $(PYTHON) -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)")
VENV?=venv_merlin_py_$(PYV)
Expand Down
32 changes: 16 additions & 16 deletions merlin/common/openfilelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,29 @@
###############################################################################

"""
OpenFileList
OpenFileList
A synthetic file class that opens a list of files and reads them as if they
were a single file
A synthetic file class that opens a list of files and reads them as if they
were a single file
SYNOPSIS:
SYNOPSIS:
with OpenFileList(["file1.txt","file2.txt",...]) as f :
print f.read();
with OpenFileList(["file1.txt","file2.txt",...]) as f :
print f.read();
reads the concatenation of file1.txt, file2.txt, etc.
reads the concatenation of file1.txt, file2.txt, etc.
file methods supported :
file methods supported :
f.read([bytes])
f.readlines([bytes])
f.readline([bytes])
f.tell()
f.close()
f.__iter__()
f.read([bytes])
f.readlines([bytes])
f.readline([bytes])
f.tell()
f.close()
f.__iter__()
TODO:
implement a seek method
TODO:
implement a seek method
"""

Expand Down
3 changes: 2 additions & 1 deletion merlin/examples/workflows/feature_demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
scikit-learn
merlin-spellbook
merlin-spellbook; python_version < "3.12"
merlin-spellbook>=0.9.0; python_version >= "3.12"
3 changes: 2 additions & 1 deletion merlin/examples/workflows/optimization/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
merlin-spellbook
merlin-spellbook; python_version < "3.12"
merlin-spellbook>=0.9.0; python_version >= "3.12"
numpy
scikit-learn
matplotlib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
scikit-learn
merlin-spellbook
merlin-spellbook; python_version < "3.12"
merlin-spellbook>=0.9.0; python_version >= "3.12"
4 changes: 1 addition & 3 deletions merlin/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import logging
import os
import time
from importlib import resources
from typing import Dict, List, Tuple

from merlin.exceptions import NoWorkersException
Expand All @@ -57,9 +58,6 @@
)


from importlib import resources


LOG = logging.getLogger(__name__)

# TODO go through this file and find a way to make a common return format to main.py
Expand Down

0 comments on commit 20d5534

Please sign in to comment.