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

add a cli argument to display the version #148

Merged
merged 8 commits into from
Nov 4, 2023
Merged

add a cli argument to display the version #148

merged 8 commits into from
Nov 4, 2023

Conversation

tonyfast
Copy link
Member

@tonyfast tonyfast commented Nov 3, 2023

closes #147

@bollwyvl
Copy link
Contributor

bollwyvl commented Nov 3, 2023

We might not even need a short flag for --version.

Often -v is reserved for --verbose, and might be nice to reserve for future work.

I would intend to use this downstream to catch packaging issues with a "black box" invocation like:

importnb --version | grep -iE "importnb {{ version.replace('.', '\.') }}$"

Related to the as-of-yet untriaged [extras] item from #146: since pip check doesn't care about extras (last i checked), perhaps --version (or --versions) could also print out all of the versions of the packages it would use, if asked:

                importnb        2023.11.3

available optional dependencies:

    [doit]      doit            0.36.0
    [ipython]   IPython         8.17.2
    [toml]      tomli           2.0.1
    [yaml]      ruamel.yaml     0.18.5

missing optional dependencies:

    no missing optional dependencies:

With a "fail" condition like:

missing optional dependencies:

    [yaml]      To enable importnb.YAML:

                pip install importnb[yaml] 

@tonyfast
Copy link
Member Author

tonyfast commented Nov 4, 2023

i'll think about adding the extra dependency version in another PR i think.

@bollwyvl
Copy link
Contributor

bollwyvl commented Nov 4, 2023

Pushed using the the built-in action="version", and re-ran the formatters... also added formatters to ci: it won't cause a ❌ , and can be used directly as a file with e.g. git apply

https://github.com/deathbeds/importnb/actions/runs/6755482914?pr=148#summary-18363953813

@bollwyvl
Copy link
Contributor

bollwyvl commented Nov 4, 2023

image

@tonyfast
Copy link
Member Author

tonyfast commented Nov 4, 2023

Hell yea! Thanks for adding ruff. Was afraid to open that box and see how bad the formatting might be.

@bollwyvl
Copy link
Contributor

bollwyvl commented Nov 4, 2023 via email

@tonyfast tonyfast merged commit c8b7330 into main Nov 4, 2023
19 checks passed
@tonyfast tonyfast deleted the version-in-cli branch November 4, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a --version switch to the CLI
2 participants