-
Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathMakefile
140 lines (114 loc) · 3.97 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
REPOROOT=../
# Use make help, to see the available rules
include ../.make.defaults
include ./transform.config
setup::
@# Help: Recursively make $@ all subdirs
$(MAKE) RULE=$@ .recurse
clean::
# Clean up workflows common virtual environment.
rm -rf venv || true
rm -rf *.back || true
@# Help: Recursively make $@ all subdirs
$(MAKE) RULE=$@ .recurse
setup::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
build::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
venv::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
image::
@# Help: Recursively make $@ in all subdirs
@$(MAKE) RULE=$@ .recurse
publish::
@# Help: Recursively make $@ in all subdirs
@$(MAKE) RULE=$@ .recurse
test-image::
@# Help: Recursively make $@ in all subdirs
@$(MAKE) RULE=$@ .recurse
test::
@# Help: Recursively make $@ in all subdirs
@$(MAKE) RULE=$@ .recurse
test-src::
@# Help: Recursively make $@ in all subdirs
$(MAKE) RULE=$@ .recurse
kind-load-image::
@# Help: Recursively make $@ in all subdirs
$(MAKE) RULE=$@ .recurse
docker-load-image::
@# Help: Recursively make $@ in all subdirs
$(MAKE) RULE=$@ .recurse
docker-save-image::
@# Help: Recursively make $@ in all subdirs
$(MAKE) RULE=$@ .recurse
workflow-venv::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
setup::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
workflow-test::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
workflow-build::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
workflow-upload::
@# Help: Recursively make $@ in subdirs
$(MAKE) RULE=$@ .recurse
set-versions::
@# Help: Recursively make $@ in all subdirs
make set-pkg-version
@$(MAKE) RULE=$@ .recurse
set-pkg-version:
@# Help: Set tag for this package and its dependencies
if [ -e pyproject.toml ]; then \
cat pyproject.toml | sed -e 's/^version[ ]*=.*/version = "'${TRANSFORMS_PKG_VERSION}'"/' > tt; \
mv tt pyproject.toml; \
fi
#echo $(DPK_VERSION)
if [ -e requirements.txt ]; then \
cat requirements.txt | sed -e 's/data-prep-toolkit\([=><~][=]\).*/data-prep-toolkit\1$(DPK_VERSION)/' > tt; \
mv tt requirements.txt; \
fi
if [ -e requirements-ray.txt ]; then \
cat requirements-ray.txt | sed -e 's/data-prep-toolkit\[ray\]\([=><~][=]\).*/data-prep-toolkit\[ray\]\1$(DPK_VERSION)/' > tt; \
mv tt requirements-ray.txt; \
fi
build-pkg-dist:
@# Help: Build package wheel
## Most transforms today don't have a package name.... Need to fix that
## In the meantime, we will copy everything to a single folder
-rm -fr src
mkdir src
# Copy all the src folders recursively (not clear if they have subfolders)
for x in $(shell find . | grep '[ray| python | spark]/src$$') ; do \
echo $$x ; \
if [ -d "$$x" ]; then \
cp -r $$x/* src ; \
fi \
done
# Only needs to build the whl
git show --no-patch > src/gitshow.txt
$(MAKE) BUILD_WHEEL_EXTRA_ARG=-w .defaults.build-dist
-rm -fr src
test-pkg-dist:
@# Help: Setup environment and run unit tests for all transforms.
-rm -fr venv
python -m venv venv
source venv/bin/activate && $(PYTHON) -m pip install '$(REPOROOT)/data-processing-lib/dist/data_prep_toolkit-$(DPK_VERSION)-py3-none-any.whl[dev,ray]'
source venv/bin/activate && $(PYTHON) -m pip install 'dist/data_prep_toolkit_transforms-$(TRANSFORMS_PKG_VERSION)-py3-none-any.whl[all]'
for T in $(shell find . | grep '[ray| python]/test$$') ; do \
echo "running unit test on: $$T" ; \
source venv/bin/activate && $(PYTEST) $$T; \
done;
@# Help: Setup environment and run unit tests for all transforms
publish-dist :: .defaults.publish-dist
publish-testpypi:
## when installing from testpypi, make sure you install the dependecies first (pip install data-prep-toolkit)
## and then use extra-url-index to install this package:
## pip install --extra-index-url https://test.pypi.org/simple/ 'data-prep-toolkit-transforms[all]==x.x.x.devx'
twine upload --repository testpypi dist/*