Skip to content

Commit

Permalink
Add a setup.py script to compile python scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Ronan Abhamon <[email protected]>
  • Loading branch information
Wescoeur committed Jul 31, 2024
1 parent e56583d commit 3708ef0
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.11.4'
- name: Build python libs
run: |
./setup.py build
- name: Install test dependencies
run: |
sudo apt-get -y install nbd-client
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ nbdkit-multi-http-plugin.so:
install: nbdkit-multi-http-plugin.so
mkdir -p $(DESTDIR)$(PREFIX)/lib64/nbdkit/plugins/
cp nbdkit-multi-http-plugin.so $(DESTDIR)$(PREFIX)/lib64/nbdkit/plugins/
mkdir -p $(DESTDIR)$(PREFIX)/bin/
cp nbd-http-server $(DESTDIR)$(PREFIX)/bin/
cp http-disk-server $(DESTDIR)$(PREFIX)/bin/

clean:
$(RM) *.so
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions scripts/http-disk-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python

#
# Copyright (C) 2022 Vates SAS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

import http_disk_server

if __name__ == "__main__":
http_disk_server.main()
22 changes: 22 additions & 0 deletions scripts/nbd-http-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python

#
# Copyright (C) 2022 Vates SAS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

import nbd_http_server

if __name__ == "__main__":
nbd_http_server.main()
31 changes: 31 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python

#
# Copyright (C) 2022 Vates SAS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

from setuptools import setup

setup(
name="http-nbd-transfer",
version="1.4.0",
description="Set of tools to transfer NBD requests to an HTTP server",
author="Ronan Abhamon <[email protected]>",
author_email="[email protected]",
url="https://vates.tech",
license="GPLv3",
py_modules=["http-disk-server", "nbd-http-server"],
scripts=["scripts/http-disk-server", "scripts/nbd-http-server"]
)
2 changes: 1 addition & 1 deletion tests/bin/http-disk-server
2 changes: 1 addition & 1 deletion tests/bin/nbd-http-server

0 comments on commit 3708ef0

Please sign in to comment.