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

test cli for pydantic gen and add deprecated support for --pydantic_v… #1781

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

sierra-moxon
Copy link
Member

…ersion

fixes #1780

@sierra-moxon sierra-moxon marked this pull request as ready for review December 12, 2023 00:56
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f9b2acc) 79.84% compared to head (8f89fd7) 79.84%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1781   +/-   ##
=======================================
  Coverage   79.84%   79.84%           
=======================================
  Files          98       98           
  Lines       11280    11281    +1     
  Branches     2905     2905           
=======================================
+ Hits         9006     9007    +1     
+ Misses       1728     1727    -1     
- Partials      546      547    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

def test_metamodel_valid_cli_arguments(arguments, kitchen_sink_path):
runner = CliRunner()
arguments_str = " ".join(arguments)
result = runner.invoke(pydanticgen.cli, f"{arguments_str} {kitchen_sink_path}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I've learned that passing a string as the second argument to runner.invoke doesn't work on Windows (because that signature relies on the shlex module under the hood). Gotta use a list of strings instead.

@sneakers-the-rat
Copy link
Collaborator

sneakers-the-rat commented Mar 19, 2024

oh sry wish i woulda seen this - i did this in #1927

edit: oh wait nevermind! i thought this was for just the parameter, which also wasn't working in general (it would just take the version of pydantic in the environment regardless of what was passed). didn't see it was was for supporting the underscore version. +1 to the reasons to have a good deprecations module #1957

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.

linkml 1.6.4 eliminates old pydantic_version cli parameter
3 participants