Skip to content
Snippets Groups Projects
Commit 7bab6d38 authored by Millian Poquet's avatar Millian Poquet
Browse files

package python protocol

parent 1aa33178
Branches
No related tags found
No related merge requests found
...@@ -24,21 +24,16 @@ let self = rec { ...@@ -24,21 +24,16 @@ let self = rec {
ninja ninja
]; ];
}; };
protocol-python = pkgs.stdenv.mkDerivation { protocol-python = pythonPackages.buildPythonPackage {
pname = "protocol-python"; name = "protocol-python-0.1.0";
version = "local";
src = pkgs.lib.sourceByRegex ./protocol [ src = pkgs.lib.sourceByRegex ./protocol [
"hello\.proto" "hello\.proto"
"setup\.py"
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
pkgs.protobuf pkgs.protobuf
pythonPackages.protobuf pythonPackages.protobuf
]; ];
phases = [ "unpackPhase" "buildPhase" ];
buildPhase = ''
mkdir -p $out/lib/python${pkgs.lib.versions.majorMinor python3.version}/site-packages/protocol
protoc --python_out $out/lib/python${pkgs.lib.versions.majorMinor python3.version}/site-packages/protocol hello.proto
'';
}; };
simgrid-simulator = pkgs.stdenv.mkDerivation { simgrid-simulator = pkgs.stdenv.mkDerivation {
pname = "simgrid-simulator"; pname = "simgrid-simulator";
......
#!/usr/bin/env python
from distutils.core import setup
from distutils.spawn import find_executable
from os import makedirs
import subprocess
import sys
protoc = find_executable('protoc')
makedirs('protocol', exist_ok=True)
protoc_command = [protoc, '--python_out=protocol', 'hello.proto']
if subprocess.call(protoc_command) != 0:
sys.exit(1)
setup(name='protocol',
version='0.1.0',
packages=['protocol'],
python_requires='>=3.6',
install_requires=[
'protobuf>=3.19.4',
],
description="Example python protocol library for DZ2 toy CI prototype.",
author='Millian Poquet',
author_email='millian.poquet@irit.fr',
url='https://gitlab.irit.fr/sepia/datazero/ci-prototype',
license='MIT',
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment