Skip to content

Commit

Permalink
Remove protobuf and all its uses
Browse files Browse the repository at this point in the history
This removes the prototype of experiment server,
and not used async functions from run models.
  • Loading branch information
dafeda committed Sep 28, 2023
1 parent dbf128a commit 664fce7
Show file tree
Hide file tree
Showing 32 changed files with 34 additions and 1,939 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ jobs:
run: |
pip install ".[dev, types]"
- name: Install dependencies
# type checking requires protobuf stubs
run: |
python -m pip install --upgrade pip
python -m pip install grpcio-tools
python -m grpc_tools.protoc -I src/_ert_com_protocol --mypy_out=src/_ert_com_protocol src/_ert_com_protocol/_schema.proto
- run: echo ::add-matcher::.github/mypy-matcher.json
- name: Run mypy
run: |
Expand Down
3 changes: 0 additions & 3 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ ignore_missing_imports = True
ignore_missing_imports = True
ignore_errors = True

[mypy-ert.experiment_server._schema_pb2]
ignore_errors = True

[mypy-cwrap.*]
ignore_missing_imports = True

Expand Down
6 changes: 0 additions & 6 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ limit-inference-results=100
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=pylint.extensions.no_self_use,
pylint_protobuf,

# Pickle collected data for later comparisons.
persistent=yes
Expand Down Expand Up @@ -177,11 +176,6 @@ notes=FIXME,
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=_ert_com_protocol.*

# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
("py:class", "pydantic.types.PositiveInt"),
("py:class", "LibresFacade"),
("py:class", "pandas.core.frame.DataFrame"),
("py:class", "google.protobuf.descriptor.Descriptor"),
("py:class", "websockets.legacy.server.WebSocketServerProtocol"),
("py:class", "EnsembleReader"),
]
Expand Down
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ requires = [
"ecl",
"conan<2",
"pybind11>=2.10.0", # If this comes out of sync with the version installed by Conan please update the version in CMakeLists
"grpcio-tools",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -66,7 +65,6 @@ dependencies=[
"packaging",
"pandas",
"pluggy>=1.3.0",
"protobuf",
"psutil",
"pydantic >= 1.10.8, < 2",
"PyQt5",
Expand Down Expand Up @@ -101,7 +99,6 @@ dev = [
"ecl_data_io",
"furo",
"flaky",
"grpcio-tools",
"hypothesis<=6.83.0; python_version=='3.8'", # ipython pinned to 8.12.2 for python 3.8 support
"hypothesis; python_version>='3.9'",
"jsonpath_ng",
Expand Down Expand Up @@ -136,18 +133,15 @@ style = [
"black",
"ruff",
"pylint",
"pylint-protobuf"
]
types = [
"mypy",
"mypy-protobuf<3.4",
"types-aiofiles",
"types-requests",
"types-PyYAML",
"types-python-dateutil",
"types-decorator",
"types-docutils",
"types-protobuf",
"types-tqdm",
]

Expand Down
56 changes: 1 addition & 55 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,9 @@
import os
import subprocess
import sys
from pathlib import Path

from setuptools import Command, find_packages
from setuptools.command.egg_info import egg_info
from setuptools import find_packages
from skbuild import setup

# list of pair of .proto file and out directory
PROTOBUF_FILES = [("src/_ert_com_protocol/_schema.proto", "src/_ert_com_protocol")]


def compile_protocol_buffers():
for proto, out_dir in PROTOBUF_FILES:
proto_path = Path(proto).parent
subprocess.run(
[
sys.executable,
"-m",
"grpc_tools.protoc",
"-I",
proto_path,
f"--python_out={out_dir}",
proto,
],
check=True,
)


class EggInfo(egg_info):
"""scikit-build uses the metadata of ert to determine what to include when building
the project. This determination results in files being copied to a special build
folder. If ert wants to compile e.g. protobuf files and have those included in the
distribution, those files needs to be a part of the distribution metadata, i.e. it
needs to happen in egg_info so that the compiled files are copied to the build
folder."""

def run(self):
compile_protocol_buffers()
egg_info.run(self) # old style class, no super()


class CompileProtocolBuffers(Command):
user_options = []

def initialize_options(self) -> None:
pass

def finalize_options(self) -> None:
pass

def run(self):
compile_protocol_buffers()


# Corporate networks tend to be behind a proxy server with their own non-public
# SSL certificates. Conan keeps its own certificates,
# whose path we can override
Expand Down Expand Up @@ -93,10 +43,6 @@ def package_files(directory):
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15",
],
cmake_source_dir="src/clib/",
cmdclass={
"egg_info": EggInfo,
"compile_protocol_buffers": CompileProtocolBuffers,
},
)

setup(**args)
Expand Down
90 changes: 0 additions & 90 deletions src/_ert_com_protocol/__init__.py

This file was deleted.

132 changes: 0 additions & 132 deletions src/_ert_com_protocol/_schema.proto

This file was deleted.

Loading

0 comments on commit 664fce7

Please sign in to comment.