Skip to content

Commit 5ffffd2

Browse files
Merge pull request #389 from purduesigbots/release/3.5.5
🔖 Release 3.5.5
2 parents d1769c7 + 3cd363d commit 5ffffd2

File tree

12 files changed

+29
-20
lines changed

12 files changed

+29
-20
lines changed

.github/workflows/main.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
outputs:
1111
output1: ${{ steps.step1.outputs.test }}
1212
steps:
13-
- uses: actions/checkout@v3.1.0
13+
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
1616
- name: Update Build Number
@@ -30,12 +30,12 @@ jobs:
3030
os: [ubuntu-latest, windows-latest, macos-latest]
3131

3232
steps:
33-
- uses: actions/checkout@v3.1.0
33+
- uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0
3636

3737
- name: Setup Python
38-
uses: actions/setup-python@v4.3.0
38+
uses: actions/setup-python@v5
3939
with:
4040
python-version: 3.9
4141
cache: 'pip'
@@ -56,7 +56,7 @@ jobs:
5656
if: matrix.os == 'ubuntu-latest'
5757

5858
- name: Upload Wheel
59-
uses: actions/upload-artifact@v3.1.0
59+
uses: actions/upload-artifact@v4
6060
with:
6161
name: pros-cli-wheel-${{needs.update_build_number.outputs.output1}}
6262
path: dist/*
@@ -89,7 +89,7 @@ jobs:
8989
mv intercept-c++ pros
9090
9191
- name: Upload Artifact
92-
uses: actions/upload-artifact@v3.1.0
92+
uses: actions/upload-artifact@v4
9393
with:
9494
name: ${{ matrix.os }}-${{needs.update_build_number.outputs.output1}}
95-
path: dist/*
95+
path: dist/pros/*

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ out/
1212
*.zip
1313
*_pros_capture.png
1414

15-
venv/
16-
15+
*venv/
16+
.DS_Store
1717
*.pyc

pip_version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.4
1+
3.5.5

pros/cli/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def resolve_v5_port(port: Optional[str], type: str, quiet: bool = False) -> Tupl
268268
return None, False
269269
else:
270270
port = ports[0].device
271-
is_joystick = type == 'user' and 'Controller' in ports[0].description
271+
is_joystick = type == 'user' and ('Controller' in ports[0].description or ports[0].pid == 0x503)
272272
logger(__name__).info('Automatically selected {}'.format(port))
273273
return port, is_joystick
274274

pros/cli/conductor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def new_project(ctx: click.Context, path: str, target: str, version: str,
237237
ui.echo('New PROS Project was created:', output_machine=False)
238238
ctx.invoke(info_project, project=project)
239239

240-
if compile_after or build_cache:
240+
if (compile_after or build_cache) and not no_default_libs:
241241
with ui.Notification():
242242
ui.echo('Building project...')
243243
exit_code = project.compile([], scan_build=build_cache)

pros/cli/upload.py

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def upload(path: Optional[str], project: Optional[c.Project], port: str, **kwarg
7676
kwargs['slot'] = 1
7777
if 'icon' in options and kwargs.get('icon','pros') == 'pros':
7878
kwargs.pop('icon')
79+
if 'description' in options and kwargs.get('description','Made with PROS') == 'Made with PROS':
80+
kwargs.pop('description')
7981
if 'after' in options and kwargs.get('after','screen') is None:
8082
kwargs.pop('after')
8183

pros/conductor/project/ProjectReport.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ def __str__(self):
1717
f' ({self.project["name"]})' if self.project["name"] else ''
1818
s += '\n'
1919
rows = [t.values() for t in self.project["templates"]]
20-
headers = [h.capitalize() for h in self.project["templates"][0].keys()]
20+
21+
headers = [h.capitalize() for h in self.project["templates"][0].keys()]if self.project["templates"] else []
2122
s += tabulate.tabulate(rows, headers=headers)
23+
2224
return s
2325

2426
def __getstate__(self):

pros/conductor/project/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ def new_user_filter(new_file: str) -> bool:
166166
def remove_template(self, template: Template, remove_user: bool = False, remove_empty_directories: bool = True):
167167
if not self.template_is_installed(template):
168168
raise ValueError(f'{template.identifier} is not installed on this project.')
169-
if template.name == 'kernel':
170-
raise ValueError(f'Cannot remove the kernel template. Maybe create a new project?')
171169

172170
real_template = LocalTemplate(orig=template, location=self.location)
173171
transaction = Transaction(self.location, set(self.all_files))

pros/config/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, file, error_on_decode=False):
2525
if file:
2626
# If the file already exists, update this new config with the values in the file
2727
if os.path.isfile(file):
28-
with open(file, 'r') as f:
28+
with open(file, 'r', encoding ='utf-8') as f:
2929
try:
3030
result = jsonpickle.decode(f.read())
3131
if isinstance(result, dict):

pros/serial/devices/vex/v5_device.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,14 @@ def write_file(self, file: typing.BinaryIO, remote_file: str, file_len: int = -1
585585
if compress and self.status['system_version'] in Spec('>=1.0.5'):
586586
logger(__name__).info('Closing gzip file')
587587
file.close()
588-
self.ft_complete(options=run_after)
588+
# The time to write the file to flash isn't exactly linear with the file size,
589+
# but it's okay even if we slightly underestimate as long as we get a response back
590+
# on one of the 3 tries of ft_complete.
591+
# The point is to set our timeout window so we aren't waiting too long for a response
592+
# that will never happen if, for example, the brain turned off.
593+
ft_timeout = max(file_len/200000, 1.0)
594+
logger(__name__).debug(f'Setting file transfer timeout as {ft_timeout:.2f} seconds')
595+
self.ft_complete(options=run_after, timeout=ft_timeout)
589596

590597
@with_download_channel
591598
def capture_screen(self) -> Tuple[List[List[int]], int, int]:
@@ -688,12 +695,12 @@ def ft_initialize(self, file_name: str, **kwargs) -> Dict[str, Any]:
688695
return rx
689696

690697
@retries
691-
def ft_complete(self, options: FTCompleteOptions = FTCompleteOptions.DONT_RUN):
698+
def ft_complete(self, options: FTCompleteOptions = FTCompleteOptions.DONT_RUN, timeout: float = 1.0):
692699
logger(__name__).debug('Sending ext 0x12 command')
693700
if isinstance(options, bool):
694701
options = self.FTCompleteOptions.RUN_IMMEDIATELY if options else self.FTCompleteOptions.DONT_RUN
695702
tx_payload = struct.pack("<B", options.value)
696-
ret = self._txrx_ext_packet(0x12, tx_payload, 0, timeout=self.default_timeout * 10)
703+
ret = self._txrx_ext_packet(0x12, tx_payload, 0, timeout=timeout)
697704
logger(__name__).debug('Completed ext 0x12 command')
698705
return ret
699706

version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.4
1+
3.5.5

win_version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.4.0
1+
3.5.5.0

0 commit comments

Comments
 (0)