-
Notifications
You must be signed in to change notification settings - Fork 20
ux improvements #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
ux improvements #37
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from typing import Iterable, ValuesView | ||
import rich.progress | ||
from datetime import datetime | ||
import inspect | ||
|
||
import rich.text | ||
|
||
from .subproject import Subproject | ||
|
||
def progress( | ||
sequence: ValuesView[Subproject], | ||
) -> Iterable[Subproject]: | ||
|
||
taskname = inspect.stack()[1].function | ||
|
||
class NumTaskColumn(rich.progress.ProgressColumn): | ||
def render(self, task: rich.progress.Task) -> rich.text.Text: | ||
return rich.text.Text(f"{task.completed}/{task.total}", style="purple") | ||
|
||
current_hour = datetime.now().hour | ||
if 7 <= current_hour < (12 + 9): | ||
spinner_name = "earth" | ||
else: | ||
spinner_name = "moon" | ||
|
||
progress = rich.progress.Progress( | ||
rich.progress.SpinnerColumn(spinner_name=spinner_name), | ||
rich.progress.TextColumn("[progress.description]{task.description}"), | ||
rich.progress.BarColumn(), | ||
NumTaskColumn(), | ||
rich.progress.TimeElapsedColumn(), | ||
redirect_stdout=True, | ||
redirect_stderr=True, | ||
# refresh_per_second=50 | ||
) | ||
|
||
with progress: | ||
for item in progress.track( | ||
sequence, total=len(sequence) | ||
): | ||
progress.update(progress.task_ids[0], description=f"{taskname} {item.name}") | ||
yield item | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,12 @@ | |
|
||
[params] | ||
|
||
parallel = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm concerned about these interacting poorly with CI. Maybe have a user-specific file that is added to .gitignore instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default should be parallel. Also, if ci sets an environment variable, this won't override it. Cache should also be on by default imo. But I do need to check if ccache is available and not use it if it doesn't exist. |
||
cc_launcher = "ccache" | ||
# strip_libpython = true | ||
# macosx_deployment_target = "12" | ||
|
||
|
||
wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/release" | ||
wpilib_bin_version = "2024.1.1-beta-3" | ||
# wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/development" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ click | |
packaging | ||
pydantic<2 | ||
requests | ||
rich | ||
setuptools | ||
tomlkit | ||
tomli | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# file generated by setuptools_scm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably should add this to .gitignore |
||
# don't change, don't track in version control | ||
__version__ = version = '2024.0.0b3.post2.dev3+g375e0468.d20231113' | ||
__version_tuple__ = version_tuple = (2024, 0, 0, 'dev3', 'g375e0468.d20231113') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely do not install the requirements automatically. Just detect the first import error and output the appropriate command for the user to copy/paste, but do not execute it.