Skip to content

Minimally fix reportPrivateImportUsage in pyright for library users - #1596

Merged
willmcgugan merged 1 commit into
Textualize:masterfrom
GBeauregard:alt-pyright-fix
Oct 16, 2021
Merged

willmcgugan merged 1 commit into
Textualize:masterfrom
GBeauregard:alt-pyright-fix

Conversation

@GBeauregard

@GBeauregard GBeauregard commented Oct 15, 2021 •

Copy link
Copy Markdown
Contributor

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

This PR resolves #1523 and is an alternative to #1551

This PR uses the standard (PEP 484) of redundant imports to avoid signalling the API as private to type checkers. Please see the commit message for additional details.

It is standard (see PEP 484 stub file section) to mark redundantly
imported items as exported. This PR adds this redundant exporting to
files that incidentally import part of their own API in their __main__
sections to avoid accidentally indicating they should be private to type
checkers.
@codecov

codecov Bot commented Oct 15, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1596 (54deb75) into master (69f197c) will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1596      +/-   ##
==========================================
- Coverage   99.70%   99.69%   -0.02%     
==========================================
  Files          71       71              
  Lines        6854     6855       +1     
==========================================
  Hits         6834     6834              
- Misses         20       21       +1     
Flag Coverage Δ
unittests 99.69% <66.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rich/box.py 100.00% <ø> (ø)
rich/live.py 100.00% <ø> (ø)
rich/table.py 100.00% <ø> (ø)
rich/pager.py 90.00% <50.00%> (-10.00%) ⬇️
rich/measure.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dc08ea...54deb75. Read the comment docs.

@willmcgugan

Copy link
Copy Markdown
Member

Thanks

@willmcgugan
willmcgugan merged commit 6f5d071 into Textualize:master Oct 16, 2021
@GBeauregard
GBeauregard deleted the alt-pyright-fix branch October 16, 2021 17:10
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.

pyright: "Table" is not exported from module "rich.table"

2 participants