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

refactor: restructure a little and add tests #2

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

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Oct 19, 2023

Some more refactoring. We don't have a public API, so leaving everything inside __main__ for now.

Add support for -h in addition to --help.

Also stubbing out new and init.

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #2 (023f72f) into main (ac6fdfc) will increase coverage by 55.96%.
The diff coverage is 87.93%.

@@             Coverage Diff             @@
##             main       #2       +/-   ##
===========================================
+ Coverage   29.75%   85.71%   +55.96%     
===========================================
  Files          10       11        +1     
  Lines         121      140       +19     
===========================================
+ Hits           36      120       +84     
+ Misses         85       20       -65     
Files Coverage Δ
src/scikit_build_cli/__init__.py 100.00% <100.00%> (ø)
src/scikit_build_cli/commands/build.py 85.71% <100.00%> (+85.71%) ⬆️
src/scikit_build_cli/commands/configure.py 85.71% <100.00%> (+85.71%) ⬆️
src/scikit_build_cli/commands/dynamic_metadata.py 88.88% <100.00%> (+88.88%) ⬆️
src/scikit_build_cli/commands/install.py 85.71% <100.00%> (+85.71%) ⬆️
src/scikit_build_cli/commands/metadata.py 88.88% <100.00%> (+88.88%) ⬆️
src/scikit_build_cli/commands/init.py 88.88% <88.88%> (ø)
src/scikit_build_cli/commands/new.py 88.88% <88.88%> (ø)
src/scikit_build_cli/__main__.py 86.11% <85.29%> (+86.11%) ⬆️

... and 1 file with indirect coverage changes

@henryiii henryiii force-pushed the henryiii/refactor/main branch 2 times, most recently from aba081e to 64cf9ed Compare October 19, 2023 16:20
Signed-off-by: Henry Schreiner <[email protected]>
Copy link
Collaborator

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

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

Should add/refactor docs in this PR as well?

@click.pass_context
def init(ctx: click.Context) -> None: # noqa: ARG001
"""
Add scikit-build to an existing project
Copy link
Collaborator

Choose a reason for hiding this comment

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

Existing CMake or Python project? Or have to have both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not totally sure. :) I was thinking it could be like new but not overwrite existing files, and maybe adapt to some extent to what is already written.

Copy link
Collaborator

Choose a reason for hiding this comment

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

CMake wise it could ve tricky as everyone is having a different format. We would need a build-dir if we want to do some parsing to find the libraries that link to python-devel. Or we could add_subdirectory with an example path.

Python-side though should be easier to introspect, but custom setup.py might be harder to figure out the intent?

Or we could assume the project is either pure-python or pure-cmake for this case? That could be the simplest to support.

@henryiii
Copy link
Contributor Author

Should add/refactor docs in this PR as well?

Good question, I'm fine either way.

@@ -10,6 +10,7 @@ def __dir__() -> list[str]:


@click.command()
@click.help_option("--help", "-h")
@click.pass_context
def metadata(ctx: click.Context) -> None: # noqa: ARG001
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was thinking, this might make more sense to be dist_info and rename the dynamica_metadata to metadata? Are there any metadata outside of dist-info that might make it confusing?

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.

2 participants