Skip to content

Commit 0b2e6b7

Browse files
committed
Initial commit
0 parents  commit 0b2e6b7

File tree

12 files changed

+188
-0
lines changed

12 files changed

+188
-0
lines changed

.github/workflows/dist.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: dist
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
ci:
14+
uses: robotpy/build-actions/.github/workflows/package-ci.yml@v2024
15+
with:
16+
artifactory_repo_type: vendor
17+
enable_rtd: false
18+
enable_sphinx_check: false
19+
enable_raspbian: false
20+
secrets:
21+
META_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
22+
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
23+
RTD_WEBHOOK: ${{ secrets.RTD_WEBHOOK }}
24+
WPI_ARTIFACTORY_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
25+
WPI_ARTIFACTORY_TOKEN: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
26+
PYPI_API_TOKEN: ${{ secrets.PYPI_PASSWORD }}

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
*.py[cod]
2+
*.egg-info
3+
__pycache__/
4+
5+
*.so
6+
*.dylib
7+
*.dll
8+
9+
/urcl/include/
10+
/urcl/rpy-include/
11+
/urcl/_init_urcl.py
12+
/urcl/pkgcfg.py
13+
14+
/urcl/version.py
15+
16+
.pytest_cache/
17+
.coverage
18+
.coverage.*
19+
htmlcov
20+
coverage.xml
21+
22+
build/
23+
dist/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 FRC 6328 and RobotPy developers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# robotpy-urcl
2+
3+
This is a Python wrapper for [FRC Team 6328][]'s [URCL][] logging library.
4+
It enables automatic capture of CAN traffic from REV motor controllers to NetworkTables,
5+
viewable using [AdvantageScope][].
6+
7+
See the corresponding [AdvantageScope documentation][] for usage instructions.
8+
9+
[FRC Team 6328]: https://github.com/Mechanical-Advantage
10+
[URCL]: https://github.com/Mechanical-Advantage/URCL
11+
[AdvantageScope]: https://github.com/Mechanical-Advantage/AdvantageScope
12+
[AdvantageScope documentation]: https://github.com/Mechanical-Advantage/AdvantageScope/blob/main/docs/REV-LOGGING.md
13+
14+
## License
15+
16+
MIT

gen/URCL.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
3+
classes:
4+
URCL:
5+
methods:
6+
Start:

pyproject.toml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[build-system]
2+
requires = [
3+
"robotpy-build~=2024.0.0",
4+
"pyntcore<2025.0.0,>=2024.1.1",
5+
"robotpy-hal<2025.0.0,>=2024.1.1",
6+
"robotpy-wpimath<2025.0.0,>=2024.1.1",
7+
"robotpy-wpiutil<2025.0.0,>=2024.1.1",
8+
"wpilib<2025.0.0,>=2024.1.1",
9+
]
10+
11+
[tool.robotpy-build]
12+
base_package = "urcl"
13+
14+
[tool.robotpy-build.metadata]
15+
name = "robotpy-urcl"
16+
description = "Python wrapper for FRC Team 6328's URCL library"
17+
author = "RobotPy Development Team"
18+
author_email = "[email protected]"
19+
url = "https://github.com/robotpy/robotpy-urcl"
20+
license = "MIT"
21+
install_requires = [
22+
"pyntcore<2025.0.0,>=2024.1.1",
23+
"robotpy-hal<2025.0.0,>=2024.1.1",
24+
"robotpy-wpiutil<2025.0.0,>=2024.1.1",
25+
"wpilib<2025.0.0,>=2024.1.1",
26+
]
27+
28+
[tool.robotpy-build.static_libs."urcl_driver".maven_lib_download]
29+
artifact_id = "URCL-driver"
30+
group_id = "org.littletonrobotics.urcl"
31+
repo_url = "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/2024.0.1"
32+
version = "2024.0.1"
33+
libs = [
34+
"URCLDriver",
35+
]
36+
37+
[tool.robotpy-build.wrappers."urcl".maven_lib_download]
38+
artifact_id = "URCL-cpp"
39+
group_id = "org.littletonrobotics.urcl"
40+
repo_url = "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/2024.0.1"
41+
version = "2024.0.1"
42+
use_sources = true
43+
sources = [
44+
"URCL.cpp",
45+
]
46+
47+
[tool.robotpy-build.wrappers."urcl"]
48+
name = "urcl"
49+
50+
depends = [
51+
"urcl_driver",
52+
"wpiHal",
53+
"ntcore",
54+
"wpilibc",
55+
"wpiutil",
56+
]
57+
58+
sources = [
59+
"urcl/wrapper.cpp",
60+
]
61+
62+
generation_data = "gen"
63+
64+
[tool.robotpy-build.wrappers."urcl".autogen_headers]
65+
URCL = "URCL.h"

setup.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env python3
2+
3+
from robotpy_build.setup import setup
4+
5+
setup()

tests/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest

tests/run_tests.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
from os.path import abspath, dirname
5+
import sys
6+
import subprocess
7+
8+
if __name__ == "__main__":
9+
root = abspath(dirname(__file__))
10+
os.chdir(root)
11+
12+
subprocess.check_call([sys.executable, "-m", "pytest"])

tests/test_urcl.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import urcl
2+
3+
4+
def test_start():
5+
urcl.URCL.start()

urcl/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from . import _init_urcl
2+
3+
from ._urcl import URCL
4+
5+
__all__ = ("URCL",)

urcl/wrapper.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include <rpygen_wrapper.hpp>
2+
3+
RPYBUILD_PYBIND11_MODULE(m) { initWrapper(m); }

0 commit comments

Comments
 (0)