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
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
[workspace]
members = [
"console_backend",
]
members = ["console_backend"]
102 changes: 77 additions & 25 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
env_scripts = [
# Two proposed methods of simplifying path globbing
# https://github.com/sagiegurari/cargo-make/issues/542
# https://github.com/sagiegurari/cargo-make/issues/543
'''
'''
#!@duckscript
!include_files ./utils/glob.ds

Expand All @@ -15,7 +12,8 @@ qml_files = glob_paths_excluding_target resources/**/*.qml

set_env QML_FILES ${qml_files}
echo QML_FILES=${qml_files}
''']
''',
] # Two proposed methods of simplifying path globbing # https://github.com/sagiegurari/cargo-make/issues/542 # https://github.com/sagiegurari/cargo-make/issues/543

[env]
CONDA_ENV = "console_pp"
Expand Down Expand Up @@ -113,18 +111,32 @@ Get-ChildItem .\console_backend -Recurse -Include @("*.egg-info", "*.dist-info")
private = true
command = "conda"
args = [
"run", "-n", "${CONDA_ENV}",
"--no-capture-output", "--live-stream",
"python", "src/main/python/main.py",
"run",
"-n",
"${CONDA_ENV}",
"--no-capture-output",
"--live-stream",
"python",
"src/main/python/main.py",
"${@}",
]
]

[tasks.run]
dependencies = ["copy-capnp", "generate-resources", "remove-egg-dist", "install-backend"]
dependencies = [
"copy-capnp",
"generate-resources",
"remove-egg-dist",
"install-backend",
]
run_task = "start-console"

[tasks.prod-run]
dependencies = ["copy-capnp", "generate-resources", "remove-egg-dist", "prod-install-backend"]
dependencies = [
"copy-capnp",
"generate-resources",
"remove-egg-dist",
"prod-install-backend",
]
run_task = "start-console"

[tasks.setuptools-rust]
Expand All @@ -146,7 +158,12 @@ conda run -n $CONDA_ENV --no-capture-output --live-stream python -m pip install
'''

[tasks.prod-freeze-no-copy]
dependencies = ["copy-capnp", "generate-resources", "setuptools-rust", "prod-install-backend"]
dependencies = [
"copy-capnp",
"generate-resources",
"setuptools-rust",
"prod-install-backend",
]
script_runner = "@shell"
script = '''
conda run -n $CONDA_ENV fbs freeze
Expand All @@ -166,7 +183,11 @@ mkdir -p target/swift_navigation_console/console_backend && cp -r console_backen
'''

[tasks.prod-freeze]
dependencies = ["prod-freeze-no-copy", "remove-negligibles", "copy-console-backend-to-fbs"]
dependencies = [
"prod-freeze-no-copy",
"remove-negligibles",
"copy-console-backend-to-fbs",
]

[tasks.prod-installer]
dependencies = ["prod-freeze"]
Expand Down Expand Up @@ -244,28 +265,28 @@ git diff --exit-code -- $QML_FILES
[tasks.rust-format]
dependencies = ["copy-capnp"]
command = "cargo"
args = ["fmt", "--all"]
args = ["fmt", "--all"]

[tasks.rust-format-check]
dependencies = ["copy-capnp"]
command = "cargo"
args = ["fmt", "--", "--check"]
args = ["fmt", "--", "--check"]

[tasks.rust-lint]
dependencies = ["copy-capnp"]
command = "cargo"
args = ["clippy", "--all-targets", "--", "--deny", "warnings"]
args = ["clippy", "--all-targets", "--", "--deny", "warnings"]

[tasks.rust-tests]
dependencies = ["copy-capnp"]
command = "cargo"
cwd = "console_backend"
args = ["test", "--features", "tests", "--", "--nocapture"]
cwd = "console_backend"
args = ["test", "--features", "tests", "--", "--nocapture"]

[tasks.rust-type-check]
dependencies = ["copy-capnp"]
command = "cargo"
args = ["check"]
args = ["check"]

[tasks.python-type-check]
script_runner = "@shell"
Expand All @@ -286,22 +307,41 @@ conda run -n $CONDA_ENV black $PYTHON_FILES
'''

[tasks.python-format]
alias="python-format-all"
alias = "python-format-all"

[tasks.python-lint]
script_runner = "@shell"
script = '''
conda run -n $CONDA_ENV pylint --output-format=parseable $PYTHON_FILES
'''

[tasks.format-toml-check]
dependencies = ["format-toml"]
script_runner = "@shell"
script = '''
git diff --exit-code
'''

[tasks.format-all]
dependencies = ["python-format-all", "qml-format", "rust-format", "newline-format"]
dependencies = [
"python-format-all",
"qml-format",
"rust-format",
"newline-format",
"format-toml",
]

[tasks.format]
alias = "format-all"

[tasks.format-check]
dependencies = ["python-format-check", "qml-format-check", "rust-format-check", "newline-check"]
dependencies = [
"python-format-check",
"qml-format-check",
"rust-format-check",
"newline-check",
"format-toml-check",
]

[tasks.lint]
dependencies = ["python-lint", "rust-lint", "format-check"]
Expand All @@ -315,7 +355,7 @@ dependencies = ["rust-tests"]
[tasks.backend-cpu-bench]
dependencies = ["copy-capnp", "generate-resources"]
command = "cargo"
args = ["bench", "--all-features", "--", "--verbose", "--noplot"]
args = ["bench", "--all-features", "--", "--verbose", "--noplot"]

[tasks.backend-cpu-bench-validate]
script_runner = "@shell"
Expand All @@ -326,10 +366,22 @@ conda run -n $CONDA_ENV python utils/bench_runner.py --backend_cpu
[tasks.backend-mem-bench]
dependencies = ["copy-capnp", "generate-resources"]
command = "cargo"
args = ["test", "test_run_process_messages", "--manifest-path=console_backend/Cargo.toml", "--features", "benches", "--", "--nocapture"]
args = [
"test",
"test_run_process_messages",
"--manifest-path=console_backend/Cargo.toml",
"--features",
"benches",
"--",
"--nocapture",
]

[tasks.backend-benches]
dependencies = ["backend-cpu-bench", "backend-cpu-bench-validate", "backend-mem-bench"]
dependencies = [
"backend-cpu-bench",
"backend-cpu-bench-validate",
"backend-mem-bench",
]

[tasks.disk-usage-bench]
script_runner = "@shell"
Expand Down
4 changes: 2 additions & 2 deletions console_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ chrono = { version = "0.4", features = ["serde"] }
csv = "1"
paste = "1"
pyo3 = { version = "0.13", features = ["extension-module"] }
sbp = { git = "https://github.com/swift-nav/libsbp.git", rev = "629974666b1aa5fdab9fdbd517e180a2aee3809b", features = ["swiftnav-rs"]}
sbp = { git = "https://github.com/swift-nav/libsbp.git", rev = "629974666b1aa5fdab9fdbd517e180a2aee3809b", features = ["swiftnav-rs"] }
serde = { version = "1.0.123", features = ["derive"] }
tempfile = "3.2.0"
ordered-float = "2.0"
Expand All @@ -30,7 +30,7 @@ directories = "3"
anyhow = { version = "1", features = ["backtrace"] }
serde_yaml = "0.8.17"
clap = "3.0.0-beta.2"
indexmap = {version = "1.6.2", features = ["serde"] }
indexmap = { version = "1.6.2", features = ["serde"] }

[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
serialport = "4.0.1"
Expand Down
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ authors = ["Swift Navigation <[email protected]>"]
[tool.poetry.dependencies]
python = ">=3.9,<3.10"
PySide2 = "^5.15.2"
fbs = {git = "https://github.com/silverjam/fbs.git"}
pycapnp = {git = "https://github.com/silverjam/pycapnp.git", rev = "disable-import-hook"}
fbs = { git = "https://github.com/silverjam/fbs.git" }
pycapnp = { git = "https://github.com/silverjam/pycapnp.git", rev = "disable-import-hook" }

[tool.poetry.dev-dependencies]
black = "^21.5b0"
Expand All @@ -22,10 +22,15 @@ Cython = "^0.29.21"
nuitka = "<=0.6.12.4"
psutil = "5.8.0"
qt5-applications = [{ version = "^5.15.2", platform = "linux" }]
py2many = {git = "https://github.com/john-michaelburke/py2many", rev = "console"}
py2many = { git = "https://github.com/john-michaelburke/py2many", rev = "console" }

[build-system]
requires = ["poetry-core>=1.0.0", "setuptools>=41.0.0", "wheel", "setuptools_rust>=0.10.2"]
requires = [
"poetry-core>=1.0.0",
"setuptools>=41.0.0",
"wheel",
"setuptools_rust>=0.10.2",
]
build-backend = "poetry.core.masonry.api"

[tool.black]
Expand Down