Skip to content
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

Complete styling changes #74

Closed
balupton opened this issue Nov 6, 2021 · 9 comments
Closed

Complete styling changes #74

balupton opened this issue Nov 6, 2021 · 9 comments
Assignees
Labels
enhancement Improvement or suggestion ongoing Ongoing efforts of incremental improvements
Milestone

Comments

@balupton
Copy link
Member

balupton commented Nov 6, 2021

I've updated several commands, but there are still a lot to go.

Completed:

  • alias-*
  • is-same
  • setup-go
  • setup-mac
  • setup-mac-brew
  • setup-util
  • setup-utils
  • setup-util-gocryptfs

We should start with the setup-* workflow and work backwards from there.

@balupton
Copy link
Member Author

balupton commented Nov 6, 2021

@molleweide can I assign this to you?

@molleweide
Copy link
Collaborator

Sure, later when I have time to walk through all of these files this is a good way for me to get into each of this files. I am assuming you mean update the echoes with colors etc?

@balupton
Copy link
Member Author

balupton commented Nov 6, 2021

Sure, later when I have time to walk through all of these files this is a good way for me to get into each of this files. I am assuming you mean update the echoes with colors etc?

yup, and thank you

balupton added a commit that referenced this issue Nov 6, 2021
Changes:

`setup-environment-commands`:

- `GOPATH`, `GOROOT`, `GOBIN` are now created if `go` is present
- Use bash `:=` trick to simplify some code
- Use arrays to avoid issues with spaces in directories (this may cause issues with bash v3 on fresh macOS installations, needs testing)

`setup-go`:

- Fixed incorrect `goinstall` function, should have been `act`, but has been rewritten
- Removed outdated linting tooling
- Removed update all request, as that seems to have been deprecated in favour of requirement of `@latest` tooling

`setup-util`:

- Stylised and quiet and verbose logging support
- Three logging modes, QUIET='', QUIET='no', QUIET='yes'
- Added `OPTIONAL=yes` mode

`setup-git`:

- Optional dependencies now marked as optional via new `setup-util` `OPTIONAL=yes` ability

`echo-color`:

- Consistent {h,e,g}{1,2,3} styling, so you immediatly know what footers are attache to what header

`setup-util-aria2`:

- Fixed bad CLI detection

Stylised:

- `setup-go`, `setup-mac`, `setup-mac-brew,` `setup-util`, `setup-utils`, `setup-util-gocryptfs`
@balupton balupton changed the title Complete styling changes for setup-update and setup-install process Complete styling changes Nov 7, 2021
balupton added a commit that referenced this issue Nov 7, 2021
Added VERBOSE mode. Only display success if QUIET=no (which is VERBOSE=yes)
balupton added a commit that referenced this issue Nov 7, 2021
`setup-util` now supports a `CMD` mode, which is now used by `setup-util-gocryptfs` to install itself

This enabled commands that do their own installations to benefit from `setup-util`'s features and consistency
@balupton balupton added the enhancement Improvement or suggestion label Nov 7, 2021
balupton added a commit that referenced this issue Nov 9, 2021
On homebrew systems, there could by multiple ruby versions installed, as dependencies of other packages.
If this is the case, this commit forces the user to select a preference.

It also removes opt/llvm gem handling, not sure why that was there, perhaps a bug.
And simplifies code around when `RUBY_VERSION` is not specified yet, allowing graceful operation.

Compiler flags will only now be provided for the selecte `RUBY_VERSION` install.

Also achieves formatting changes for `setup-ruby`, so progress on #74
balupton added a commit that referenced this issue Nov 10, 2021
- `choose-basename` and `choose-expansion` were unused
- `choose-path` upgraded for `choose-option`
- `dark-mode` renamed to `macos-theme` and upgraded and fixed
- remove `splitlines.bash` and `IFS= ` as they were unnecessary: https://unix.stackexchange.com/a/676876/50703
- remove `files-to-list`, it was unused, as is simple enough
- remove `replace-inside`, it was unused, just use `sd`
- cleaned `nullglob.bash` and `globstar.bash` remaining usage
- improved `fs-absolute`,  `what-is-using`, `macos-drive`, `macos-state`, `echo-subpaths`
- added `echo-paths-and-basenames`
- rejigged `TIPS.md`
- fixed regression in `ask` from 5b6c078
- styled `setup-node` (progress #74)
@balupton
Copy link
Member Author

balupton commented Nov 10, 2021

Worth noting that a few commits ago added echo-revolving-door, as well as some magic in setup-util, such that successes collapsed in non-verbose mode. Would be good to scale this out to other commands too, but that can happen once the styling colors has completed.

balupton added a commit that referenced this issue Nov 11, 2021
- move out `act` from `setup-util` into `echo-collapse` which can be run as a command, or sourced
- added segment open and close styles to `echo-color`
- redid `setup-python` to use these new styling abilities
- disabled some irrelevant shellcheck issues in the headers of some files
- added `echo-indent`, it isn't used yet, but perhaps could be one day

Signed-off-by: Benjamin Lupton <b@lupton.cc>
@balupton
Copy link
Member Author

balupton commented Nov 11, 2021

New styling abilities have been added in f8ede3b and utilised by setup-python. @molleweide you now have a substitute for your headers prefixes and suffixes.

For setup-python it turns this:

Ensuring python 2 and 3 are installed...
The [python] utility is already installed because [python] is present. All good. ✅
The [python3] utility is already installed because [python3] is present. All good. ✅

Installing pip for python...

11/11 15:59:11 [NOTICE] Downloading 1 item(s)

11/11 15:59:12 [NOTICE] Download complete: /var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.yNHUloPX

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
af48d2|OK  |   5.1MiB/s|/var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.yNHUloPX

Status Legend:
(OK):download completed.
Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.3.1
    Uninstalling pip-21.3.1:
      Successfully uninstalled pip-21.3.1
Successfully installed pip-21.3.1

Install 0 pip dependencies for python...

Installing pipx for python...
Collecting pipx
  Using cached pipx-0.16.4-py3-none-any.whl (53 kB)
Collecting packaging>=20.0
  Using cached packaging-21.2-py3-none-any.whl (40 kB)
Collecting argcomplete<2.0,>=1.9.4
  Using cached argcomplete-1.12.3-py2.py3-none-any.whl (38 kB)
Collecting userpath>=1.6.0
  Using cached userpath-1.7.0-py2.py3-none-any.whl (14 kB)
Collecting pyparsing<3,>=2.0.2
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting click
  Using cached click-8.0.3-py3-none-any.whl (97 kB)
Installing collected packages: pyparsing, click, userpath, packaging, argcomplete, pipx
  Attempting uninstall: pyparsing
    Found existing installation: pyparsing 2.4.7
    Uninstalling pyparsing-2.4.7:
      Successfully uninstalled pyparsing-2.4.7
  Attempting uninstall: click
    Found existing installation: click 8.0.3
    Uninstalling click-8.0.3:
      Successfully uninstalled click-8.0.3
  Attempting uninstall: userpath
    Found existing installation: userpath 1.7.0
    Uninstalling userpath-1.7.0:
      Successfully uninstalled userpath-1.7.0
  Attempting uninstall: packaging
    Found existing installation: packaging 21.2
    Uninstalling packaging-21.2:
      Successfully uninstalled packaging-21.2
  Attempting uninstall: argcomplete
    Found existing installation: argcomplete 1.12.3
    Uninstalling argcomplete-1.12.3:
      Successfully uninstalled argcomplete-1.12.3
  Attempting uninstall: pipx
    Found existing installation: pipx 0.16.4
    Uninstalling pipx-0.16.4:
      Successfully uninstalled pipx-0.16.4
Successfully installed argcomplete-1.12.3 click-8.0.3 packaging-21.2 pipx-0.16.4 pyparsing-2.4.7 userpath-1.7.0

Install 4 pipx dependencies for python...
Installing to existing venv 'youtube-dl'
⚠️  Note: youtube-dl was already on your PATH at /usr/local/bin/youtube-dl
  installed package youtube-dl 2021.6.6, Python 3.9.7
  These apps are now globally available
    - youtube-dl
done! ✨ 🌟 ✨
Installing to existing venv 'stig'
  installed package stig 0.12.2a0, Python 3.9.7
  These apps are now globally available
    - chardetect
    - natsort
    - stig
done! ✨ 🌟 ✨
Installing to existing venv 'katcr'
  installed package katcr 3.0.7, Python 3.9.7
  These apps are now globally available
    - bot
    - chardetect
    - gogo
    - katcr
    - normalizer
    - py.test
    - pytest
    - tabulate
    - torrentmirror
    - yapf
done! ✨ 🌟 ✨
Installing to existing venv 'poetry'
  installed package poetry 1.1.11, Python 3.9.7
  These apps are now globally available
    - doesitcache
    - keyring
    - normalizer
    - pkginfo
    - poetry
    - virtualenv
done! ✨ 🌟 ✨

Installing pip for python2...

11/11 15:59:26 [NOTICE] Downloading 1 item(s)
[#46cdc5 0B/0B CN:1 DL:0B]                                                                                                                                                            
11/11 15:59:28 [NOTICE] Download complete: /var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.6rELTx3K

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
46cdc5|OK  |   5.1MiB/s|/var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.6rELTx3K

Status Legend:
(OK):download completed.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pip<21.0
  Using cached pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.3.4
    Uninstalling pip-20.3.4:
      Successfully uninstalled pip-20.3.4
Successfully installed pip-20.3.4

Install 0 pip dependencies for python2...

Installing pip for python3...

11/11 15:59:33 [NOTICE] Downloading 1 item(s)

11/11 15:59:33 [NOTICE] Download complete: /var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.YgzMrfgC

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
c6a880|OK  |   5.0MiB/s|/var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.YgzMrfgC

Status Legend:
(OK):download completed.
Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.3.1
    Uninstalling pip-21.3.1:
      Successfully uninstalled pip-21.3.1
Successfully installed pip-21.3.1

Install 0 pip dependencies for python3...

Installing pipx for python3...
Collecting pipx
  Using cached pipx-0.16.4-py3-none-any.whl (53 kB)
Collecting packaging>=20.0
  Using cached packaging-21.2-py3-none-any.whl (40 kB)
Collecting argcomplete<2.0,>=1.9.4
  Using cached argcomplete-1.12.3-py2.py3-none-any.whl (38 kB)
Collecting userpath>=1.6.0
  Using cached userpath-1.7.0-py2.py3-none-any.whl (14 kB)
Collecting pyparsing<3,>=2.0.2
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting click
  Using cached click-8.0.3-py3-none-any.whl (97 kB)
Installing collected packages: pyparsing, click, userpath, packaging, argcomplete, pipx
  Attempting uninstall: pyparsing
    Found existing installation: pyparsing 2.4.7
    Uninstalling pyparsing-2.4.7:
      Successfully uninstalled pyparsing-2.4.7
  Attempting uninstall: click
    Found existing installation: click 8.0.3
    Uninstalling click-8.0.3:
      Successfully uninstalled click-8.0.3
  Attempting uninstall: userpath
    Found existing installation: userpath 1.7.0
    Uninstalling userpath-1.7.0:
      Successfully uninstalled userpath-1.7.0
  Attempting uninstall: packaging
    Found existing installation: packaging 21.2
    Uninstalling packaging-21.2:
      Successfully uninstalled packaging-21.2
  Attempting uninstall: argcomplete
    Found existing installation: argcomplete 1.12.3
    Uninstalling argcomplete-1.12.3:
      Successfully uninstalled argcomplete-1.12.3
  Attempting uninstall: pipx
    Found existing installation: pipx 0.16.4
    Uninstalling pipx-0.16.4:
      Successfully uninstalled pipx-0.16.4
Successfully installed argcomplete-1.12.3 click-8.0.3 packaging-21.2 pipx-0.16.4 pyparsing-2.4.7 userpath-1.7.0

Install 4 pipx dependencies for python3...
Installing to existing venv 'youtube-dl'
⚠️  Note: youtube-dl was already on your PATH at /usr/local/bin/youtube-dl
  installed package youtube-dl 2021.6.6, Python 3.9.7
  These apps are now globally available
    - youtube-dl
done! ✨ 🌟 ✨
Installing to existing venv 'stig'
  installed package stig 0.12.2a0, Python 3.9.7
  These apps are now globally available
    - chardetect
    - natsort
    - stig
done! ✨ 🌟 ✨
Installing to existing venv 'katcr'
  installed package katcr 3.0.7, Python 3.9.7
  These apps are now globally available
    - bot
    - chardetect
    - gogo
    - katcr
    - normalizer
    - py.test
    - pytest
    - tabulate
    - torrentmirror
    - yapf
done! ✨ 🌟 ✨
Installing to existing venv 'poetry'
  installed package poetry 1.1.11, Python 3.9.7
  These apps are now globally available
    - doesitcache
    - keyring
    - normalizer
    - pkginfo
    - poetry
    - virtualenv
done! ✨ 🌟 ✨

Installed python, pyenv, pip, and pipx successfully. ✅

Into this:

┌  Setup Python ⏲   ┐
┌  Install python  ┐
The [python] utility is already installed because [python] is present. All good. ✅
The [python3] utility is already installed because [python3] is present. All good. ✅
└  Install python  ┘
┌  Download pip for python  ┐
└  Download pip for python  ┘
┌  Install pip for python  ┐
└  Install pip for python  ┘
┌  Install 0 pip dependencies for python  ┐
└  Install 0 pip dependencies for python  ┘
┌  Install pipx for python  ┐
└  Install pipx for python  ┘
┌  Install 4 pipx dependencies for python  ┐
   pipx installed: youtube_dl
   pipx installed: stig
   pipx installed: katcr
   pipx installed: poetry
└  Install 4 pipx dependencies for python  ┘
┌  Download pip for python2  ┐
└  Download pip for python2  ┘
┌  Install pip for python2  ┐
< python2 /var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.e8qhtceM --user >
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 i└  Install pip for python2  ┘
┌  Install 0 pip dependencies for python2  ┐
└  Install 0 pip dependencies for python2  ┘
┌  Download pip for python3  ┐
└  Download pip for python3  ┘
┌  Install pip for python3  ┐
└  Install pip for python3  ┘
┌  Install 0 pip dependencies for python3  ┐
└  Install 0 pip dependencies for python3  ┘
┌  Install pipx for python3  ┐
└  Install pipx for python3  ┘
┌  Install 4 pipx dependencies for python3  ┐
   pipx installed: youtube_dl
   pipx installed: stig
   pipx installed: katcr
   pipx installed: poetry
└  Install 4 pipx dependencies for python3  ┘
└  Setup Python ✅  ┘

I'm unsure why these lines were retained and had the footer added onto it, but can debug it later:

┌  Install pip for python2  ┐
< python2 /var/folders/wm/8g56ry4s47z_hbt0tgv0m5gr0000gn/T/tmp.e8qhtceM --user >
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 i└  Install pip for python2  ┘

balupton added a commit that referenced this issue Nov 11, 2021
setup-rust now checks if rust is installed via brew, and if it is, prompts to remove it
@balupton
Copy link
Member Author

balupton commented Nov 11, 2021

It's a pity it isn't possible to do

echo-segment 'do something' -- {
   # do a bunch of things
}

This may work however:

{
   # do a bunch of things
} | echo-segment 'do something'

However, it would require special handling for exit codes and stderr, maybe:

{
   # do a bunch of things
} 2>&1 | echo-segment --collapse --piped 'do something' || echo-segment --elsed 'do something'

Turns out this creates worse code:

https://gist.github.com/balupton/8e86fbe8a97fb8def4e60143e62efbdb

balupton added a commit that referenced this issue Nov 11, 2021
setup-rust now checks if rust is installed via brew, and if it is, prompts to remove it
@balupton
Copy link
Member Author

balupton commented Nov 11, 2021

most of the styling of the setup utils is done, but a few need a bunch of cleaning, and make use of the open and close syles, and eval-collapse, to get inline with the magic of setup-python

balupton added a commit that referenced this issue Nov 11, 2021
- styled `setup-python` with `echo-segment`
- fix `setup-node` break when NVM_DIR doesn't exist
- styled `setup-node`
- fix `eval-collapse` leaking local vars to global scope
balupton added a commit that referenced this issue Nov 11, 2021
balupton added a commit that referenced this issue Nov 11, 2021
prior styled commands have been updated to `echo-segment` too
balupton added a commit that referenced this issue Nov 12, 2021
@balupton balupton assigned balupton and unassigned molleweide Nov 18, 2021
@balupton
Copy link
Member Author

I'll have this completed this week

@balupton balupton added this to the Public Launch milestone Nov 25, 2021
balupton added a commit that referenced this issue Dec 1, 2021
Changes:

`setup-environment-commands`:

- `GOPATH`, `GOROOT`, `GOBIN` are now created if `go` is present
- Use bash `:=` trick to simplify some code
- Use arrays to avoid issues with spaces in directories (this may cause issues with bash v3 on fresh macOS installations, needs testing)

`setup-go`:

- Fixed incorrect `goinstall` function, should have been `act`, but has been rewritten
- Removed outdated linting tooling
- Removed update all request, as that seems to have been deprecated in favour of requirement of `@latest` tooling

`setup-util`:

- Stylised and quiet and verbose logging support
- Three logging modes, QUIET='', QUIET='no', QUIET='yes'
- Added `OPTIONAL=yes` mode

`setup-git`:

- Optional dependencies now marked as optional via new `setup-util` `OPTIONAL=yes` ability

`echo-color`:

- Consistent {h,e,g}{1,2,3} styling, so you immediatly know what footers are attache to what header

`setup-util-aria2`:

- Fixed bad CLI detection

Stylised:

- `setup-go`, `setup-mac`, `setup-mac-brew,` `setup-util`, `setup-utils`, `setup-util-gocryptfs`
balupton added a commit that referenced this issue Dec 1, 2021
Added VERBOSE mode. Only display success if QUIET=no (which is VERBOSE=yes)
balupton added a commit that referenced this issue Dec 1, 2021
`setup-util` now supports a `CMD` mode, which is now used by `setup-util-gocryptfs` to install itself

This enabled commands that do their own installations to benefit from `setup-util`'s features and consistency
balupton added a commit that referenced this issue Dec 1, 2021
On homebrew systems, there could by multiple ruby versions installed, as dependencies of other packages.
If this is the case, this commit forces the user to select a preference.

It also removes opt/llvm gem handling, not sure why that was there, perhaps a bug.
And simplifies code around when `RUBY_VERSION` is not specified yet, allowing graceful operation.

Compiler flags will only now be provided for the selecte `RUBY_VERSION` install.

Also achieves formatting changes for `setup-ruby`, so progress on #74
balupton added a commit that referenced this issue Dec 1, 2021
- `choose-basename` and `choose-expansion` were unused
- `choose-path` upgraded for `choose-option`
- `dark-mode` renamed to `macos-theme` and upgraded and fixed
- remove `splitlines.bash` and `IFS= ` as they were unnecessary: https://unix.stackexchange.com/a/676876/50703
- remove `files-to-list`, it was unused, as is simple enough
- remove `replace-inside`, it was unused, just use `sd`
- cleaned `nullglob.bash` and `globstar.bash` remaining usage
- improved `fs-absolute`,  `what-is-using`, `macos-drive`, `macos-state`, `echo-subpaths`
- added `echo-paths-and-basenames`
- rejigged `TIPS.md`
- fixed regression in `ask` from 5b6c078
- styled `setup-node` (progress #74)
balupton added a commit that referenced this issue Dec 1, 2021
- move out `act` from `setup-util` into `echo-collapse` which can be run as a command, or sourced
- added segment open and close styles to `echo-color`
- redid `setup-python` to use these new styling abilities
- disabled some irrelevant shellcheck issues in the headers of some files
- added `echo-indent`, it isn't used yet, but perhaps could be one day

Signed-off-by: Benjamin Lupton <b@lupton.cc>
balupton added a commit that referenced this issue Dec 1, 2021
setup-rust now checks if rust is installed via brew, and if it is, prompts to remove it
balupton added a commit that referenced this issue Dec 1, 2021
- styled `setup-python` with `echo-segment`
- fix `setup-node` break when NVM_DIR doesn't exist
- styled `setup-node`
- fix `eval-collapse` leaking local vars to global scope
balupton added a commit that referenced this issue Dec 1, 2021
balupton added a commit that referenced this issue Dec 1, 2021
prior styled commands have been updated to `echo-segment` too
balupton added a commit that referenced this issue Dec 1, 2021
@balupton balupton added the ongoing Ongoing efforts of incremental improvements label Dec 5, 2021
@balupton
Copy link
Member Author

Completed via #105 and #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement or suggestion ongoing Ongoing efforts of incremental improvements
Development

No branches or pull requests

2 participants