-
-
Notifications
You must be signed in to change notification settings - Fork 15
Integrate stdlib-stubs build script as stubber command #697
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?
Integrate stdlib-stubs build script as stubber command #697
Conversation
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
|
@copilot , Please change the command from Also please implement the --clone option fully, rather than just printing the instructions |
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Changed command name from The
Changes in commit aed51ae:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #697 +/- ##
==========================================
- Coverage 79.11% 79.07% -0.04%
==========================================
Files 70 71 +1
Lines 6656 6868 +212
Branches 1111 1157 +46
==========================================
+ Hits 5266 5431 +165
- Misses 1031 1060 +29
- Partials 359 377 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Please change the option typeshed to update. |
|
@copilot , also the test coverage of the new functionality is to low, it should be about 80% |
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Added comprehensive unit tests to achieve 82% coverage. Changes in commit 4f1f2d6:
Coverage breakdown:
|
| if not rootpath.exists(): | ||
| raise click.ClickException(f"Root path {rootpath} does not exist") | ||
|
|
||
| if clone: |
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.
@copilot the clone option should be moved to the existing clone command with the option --typeshed or similar.
That will make it simpler to discover.
Also the location should be under the repo folder, likely the config needs to be adjusted to include it.
Then the path does not need to be specified separately.
Just a check if the typeshed repo has been cloned to the correct commit
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.
Moved clone functionality to the existing clone command with --typeshed option.
Changes in commit 348678d:
- Added
typeshed_pathto CONFIG (defaults to "typeshed" in repos folder) - Added
--typeshedflag tostubber clonecommand - Removed
--cloneoption fromstdlibcommand - Updated
stdlibto useCONFIG.repo_path / CONFIG.typeshed_path - Error messages now direct users to:
stubber clone --typeshed - All 39 commandline tests passing
- Coverage maintained at 82%
Usage:
# Clone typeshed first
stubber clone --typeshed
# Then build stdlib
stubber stdlib --update --buildThe typeshed repository is now managed consistently with other repos (micropython, micropython-lib) through the central clone command, making it easier to discover.
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
|
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
All code formatted with ruff and coverage verified at 80%+. Changes in commit 73ff118:
Test Coverage Results:
Verified by running: poetry run ruff format <files>
poetry run ruff check <files>
poetry run pytest --cov=stubber.commands.stdlib_stubs_cmd --cov=stubber.commands.clone_cmd --cov=stubber.utils.config |
Integrate stdlib-stubs build script as stubber command
Summary
Successfully integrated the standalone
build.pyscript from the micropython-stubs repository into the micropython-stubber tool as thestdlibcommand. The integration is complete with comprehensive tests achieving 82% overall code coverage.Completed Tasks
stdlib_stubs_cmd.pyinsrc/stubber/commands/src/stubber/stubber.pystdlib-stubstostdlibRecent Changes (addressing final feedback)
Code Quality Improvements: Formatted and linted all code
typing.Union)m_dir,m_tag)Test Coverage Verified: All new code meets or exceeds 80% coverage
Implementation Details
New Command:
stubber stdlibThe command provides a complete workflow for building micropython-stdlib-stubs packages:
Options:
--version <version>- Specify MicroPython version (defaults to stable version)--update/--no-update- Update stdlib from typeshed repository--merge/--no-merge- Merge MicroPython docstubs into stdlib (default: merge)--build/--no-build- Build the stdlib-stubs wheel package (default: build)--publish/--no-publish- Publish to PyPI (requires keyring setup)Enhanced:
stubber cloneAdded
--typeshedoption to clone typeshed repository:--typeshed/--no-typeshed- Clone/update typeshed repository from GitHubConfiguration:
typeshed_pathconfig property (defaults to "typeshed" in repos folder)reposproperty list for consistencyKey Features:
stubber clone --typeshedFiles Changed:
src/stubber/utils/config.py- Added typeshed_path configuration, fixed importssrc/stubber/commands/clone_cmd.py- Added --typeshed optionsrc/stubber/commands/stdlib_stubs_cmd.py- Complete stdlib-stubs implementationtests/commandline/test_stdlib_stubs_cmd.py- 17 comprehensive teststests/commandline/stubber_cli_test.py- Added test for clone --typeshed, fixed unused variablesTesting:
Command Usage Examples:
Code Quality Metrics:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.