Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions generate_protos
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ do

python -m grpc_tools.protoc \
--proto_path=./schema/ \
--python_out=python_not_for_dunedaq/ \
--grpc_python_out=python_not_for_dunedaq/ \
--mypy_out=python_not_for_dunedaq/ \
--python_out=src/ \
--grpc_python_out=src/ \
--mypy_out=src/ \
${FILE}

# FILE_NAME=$(basename -- "$FILE")
Expand All @@ -25,8 +25,8 @@ do

python -m grpc_tools.protoc \
--proto_path=./schema/ \
--python_out=python_not_for_dunedaq/ \
--mypy_out=python_not_for_dunedaq/ \
--python_out=src/ \
--mypy_out=src/ \
${FILE}

# FILE_NAME=$(basename -- "$FILE")
Expand Down
39 changes: 22 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,47 @@ build-backend = "setuptools.build_meta"

[project]
name = "druncschema"
description = "Schema definitions and compilation script for drunc"
version = "0.11.3"
readme = "docs/README.md"
requires-python = ">=3.10"
dynamic = ["version", "readme"]
dependencies = [
"grpcio==1.68.0",
"grpcio-status==1.68.0",
"grpcio-tools==1.68.0",
"googleapis-common-protos==1.66.0"
"click",
"grpcio",
"grpcio-status",
"grpcio-tools",
"googleapis-common-protos",
"rich",
]
authors = [
{name = "Pierre Lasorak", email = "p.lasorak@imperial.ac.uk"},
{name = "Pawel Plesniak", email = "pawel.plesniak15@imperial.ac.uk"},
{name = "Claudia Su", email = "claudia.su@physics.ox.ac.uk"}
]
description = "Schema definitions and compilation script for drunc"

[project.optional-dependencies]
dev = ["ruff", "pre-commit", "pytest", "mypy-protobuf", "types-protobuf"]
dev = ["ruff", "pre-commit", "pytest", "pytest-cov", "mypy-protobuf", "types-protobuf"]

[project.urls]
Documentation = "https://dune-daq-sw.readthedocs.io/en/latest/packages/daq-release/team_repos/?h=druncschema"
Repository = "https://github.com/DUNE-DAQ/druncschema"

[project.scripts]
druncschema-generate-protos = "druncschema.apps.__main_generate_protos__:main"
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.dynamic]
version = {attr = "druncschema.__version__"}
readme = {file = ["docs/README.md"]}
[tool.pytest.ini_options]
addopts = "-v --tb=short --cov=druncschema --cov=src/druncschema tests/"

[tool.coverage.run]
source = ["druncschema"]
omit = ["tests/*", "scripts/*"]

[tool.setuptools.packages.find]
where = ["python_not_for_dunedaq"]

[tool.ruff]
exclude = [
"python_not_for_dunedaq/druncschema.egg-info",
"python_not_for_dunedaq/*/*_pb2.py*",
"python_not_for_dunedaq/*/*_pb2_grpc.py",
"src/druncschema.egg-info",
"src/druncschema/*_pb2.py*",
"src/druncschema/*_pb2_grpc.py",
]

[tool.ruff.lint]
Expand All @@ -51,5 +55,6 @@ select = [
"I", # isort
"UP", # pyupgrade
"RUF", # ruff-specific rules
"R", # refactoring suggestions
]
pydocstyle.convention = "google"
1 change: 0 additions & 1 deletion python_not_for_dunedaq/druncschema/apps/__init__.py

This file was deleted.

8 changes: 6 additions & 2 deletions ...ncschema/apps/__main_generate_protos__.py → scripts/generate_protos.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

"""Defines command to compile *.proto files.

Compiles buffers into
Expand Down Expand Up @@ -196,10 +198,10 @@ def main(
)
log.exception(e)

druncschema_root = files("druncschema").parents[1]
druncschema_root = Path(f'{os.environ["DBT_AREA_ROOT"]}/sourcecode/druncschema')
log.debug(f"Found druncschema directory at {druncschema_root}")

output_dir = druncschema_root / "python_not_for_dunedaq/"
output_dir = druncschema_root / "src/"
log.debug(f"Set output directory as {output_dir}")

source_path = druncschema_root.parents[1] / "env.sh"
Expand All @@ -225,3 +227,5 @@ def main(
clean,
do_not_compile
)

main()
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# This directory is _NOT_ to be used for dune daq, this is solely when one wants to run standalone without any dunedaq dependency.
__version__='0.11.3'
File renamed without changes.