forked from eduvpn/python-eduvpn-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
146 lines (112 loc) · 3.66 KB
/
Makefile
File metadata and controls
146 lines (112 loc) · 3.66 KB
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
140
141
142
143
144
145
146
# note: this file is intended for development only and not to actually
# install the client.
#
.PHONY: all dockers doc
VENV=./venv
all: eduvpn-cli
$(VENV)/:
python3 -m venv venv --system-site-packages
$(VENV)/bin/pip install --upgrade pip wheel pytest
$(VENV)/bin/eduvpn-cli: $(VENV)/
$(VENV)/bin/pip install -e ".[test]"
$(VENV)/bin/eduvpn-gui: $(VENV)/
$(VENV)/bin/pip install -e ".[test,gui]"
eduvpn-gui: $(VENV)/bin/eduvpn-gui
$(VENV)/bin/eduvpn-gui
letsconnect-gui: $(VENV)/bin/eduvpn-gui
venv/bin/letsconnect-gui
eduvpn-cli: $(VENV)/bin/eduvpn-cli
$(VENV)/bin/eduvpn-cli interactive
dockers:
for i in `ls docker/*.docker`; do echo "*** $$i"; docker build --progress=plain . -f $$i; done
# install all required binary packages on a debian based system
deb:
apt update
apt install -y \
gir1.2-gtk-3.0 \
gir1.2-notify-0.7 \
libdbus-glib-1-dev \
python3-gi \
python3-requests-oauthlib \
python3-cryptography \
python3-setuptools \
python3-nacl \
python3-pytest \
python3-wheel \
python3-dbus \
network-manager-openvpn-gnome
# install all required binary packages on a rpm based system
dnf:
sudo dnf install -y \
libnotify \
gtk3 \
python3-dbus \
python3-requests-oauthlib \
python3-gobject \
python3-pynacl \
python3-pytest \
python3-cairo-devel \
gobject-introspection-devel \
cairo-gobject-devel \
dbus-python-devel
# install required binary packages when running GUI on OSX
osx:
brew install gobject-introspection cairo # py3cairo pygobject3
doc: $(VENV)/
$(VENV)/bin/pip install -r doc/requirements.txt
$(VENV)/bin/python -msphinx doc doc/_build
srpm-fedora:
rm dist/*.src.rpm
docker build --progress=plain -t rpm_fedora_35 -f docker/rpm_fedora_35.docker .
mkdir -p dist
docker run -v `pwd`/dist:/dist:rw rpm_fedora_35 sh -c "cp /root/rpmbuild/SRPMS/* /dist"
rpm-fedora:
docker build --progress=plain -t rpm_fedora_35 -f docker/rpm_fedora_35.docker .
mkdir -p dist
docker run -v `pwd`/dist:/dist:rw rpm_fedora_35 sh -c "cp /root/rpmbuild/RPMS/noarch/* /dist"
rpm-centos:
docker build --progress=plain -t rpm_centos_8 -f docker/rpm_centos_8.docker .
mkdir -p dist
docker run -v `pwd`/dist:/dist:rw rpm_centos_8 sh -c "cp /root/rpmbuild/RPMS/noarch/* /dist"
$(VENV)/bin/pycodestyle $(VENV)/bin/pytest: $(VENV)/
$(VENV)/bin/pip install -e ".[test]"
touch $(VENV)/bin/pytest
touch $(VENV)/bin/pycodestyle
$(VENV)/bin/mypy: $(VENV)/
$(VENV)/bin/pip install -e ".[mypy]"
touch $(VENV)/bin/mypy
mypy: $(VENV)/bin/mypy
$(VENV)/bin/mypy --config-file setup.cfg eduvpn tests
pycodestyle: $(VENV)/bin/pycodestyle
$(VENV)/bin/pycodestyle eduvpn tests
test: $(VENV)/bin/pytest
$(VENV)/bin/pytest
checks: test mypy pycodestyle
$(VENV)/bin/jupyter-notebook: $(VENV)/bin/eduvpn-gui
$(VENV)/bin/pip install -r notebooks/requirements.txt
touch $(VENV)/bin/jupyter-notebook
notebook: $(VENV)/bin/jupyter-notebook
$(VENV)/bin/jupyter-notebook --notebook-dir= notebooks/
clean:
rm -rf $(VENV) dist .eggs eduvpn_client.egg-info .pytest_cache tests/__pycache__/
find . -name *.pyc -delete
find . -name __pycache__ -delete
sdist: $(VENV)
rm dist/*.tar.gz
$(VENV)/bin/python setup.py sdist
bdist_wheel: $(VENV)
rm dist/*.whl
$(VENV)/bin/python setup.py bdist_wheel
rpmbuild: sdist
mkdir -p ~/rpmbuild/SOURCES/.
cp dist/*.tar.gz ~/rpmbuild/SOURCES/.
rpmbuild -bs eduvpn.spec
rpmbuild -bb eduvpn.spec
$(VENV)/bin/copr-cli: $(VENV)
$(VENV)/bin/pip install copr-cli
$(VENV)/bin/twine: $(VENV)
$(VENV)/bin/pip install twine
copr-upload: srpm-fedora $(VENV)/bin/copr-cli
$(VENV)/bin/copr-cli build @eduvpn/eduvpn-client dist/*.src.rpm
twine-upload: sdist bdist_wheel $(VENV)/bin/twine
$(VENV)/bin/twine upload dist/*.tar.gz dist/*.whl