File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ install_requires = [
99 " wpilib==THIS_VERSION"
1010]
1111
12+ [tool .robotpy-build .metadata .entry_points ]
13+ robotpysimext = [
14+ " xrp = xrp.extension" ,
15+ ]
16+
1217[build-system ]
1318requires = [
1419 " robotpy-build<2025.0.0,~=2024.0.0" ,
@@ -45,3 +50,16 @@ group_id = "edu.wpi.first.xrpVendordep"
4550repo_url = " https://frcmaven.wpi.edu/artifactory/release"
4651version = " 2024.2.1"
4752libs = [" xrpVendordep" ]
53+
54+ [tool .robotpy-build .wrappers ."xrp .extension" .maven_lib_download ]
55+ artifact_id = " halsim_xrp"
56+ group_id = " edu.wpi.first.halsim"
57+ # repo_url = "https://frcmaven.wpi.edu/artifactory/release"
58+ repo_url = " https://frcmaven.wpi.edu/artifactory/release"
59+ version = " 2024.2.1"
60+
61+ dlopenlibs = [" halsim_xrp" ]
62+
63+ [tool .robotpy-build .wrappers ."xrp .extension" ]
64+ name = " xrp_ext"
65+ depends = [" wpiHal" , " wpinet" ]
Original file line number Diff line number Diff line change 1+ from .main import loadExtension
2+
3+ __all__ = ["loadExtension" ]
Original file line number Diff line number Diff line change 1+ import logging
2+ import os
3+ from os .path import abspath , dirname , join
4+
5+ logger = logging .getLogger ("xrp.extension" )
6+
7+
8+ def loadExtension ():
9+ try :
10+ import hal
11+ except ImportError as e :
12+ # really, should never happen...
13+ raise ImportError ("you must install robotpy-hal!" ) from e
14+
15+ from ..version import version
16+
17+ logger .info ("WPILib XRP client %s" , version )
18+
19+ root = join (abspath (dirname (__file__ )), "lib" )
20+ ext = join (root , os .listdir (root )[0 ])
21+ retval = hal .loadOneExtension (ext )
22+ if retval != 0 :
23+ logger .warn ("loading extension may have failed (error=%d)" , retval )
You can’t perform that action at this time.
0 commit comments