Skip to content

Add ability to dynamically import namespaces from types in the tsd client#235

Merged
rogebrd merged 7 commits intomainfrom
add_import_gen
May 17, 2021
Merged

Add ability to dynamically import namespaces from types in the tsd client#235
rogebrd merged 7 commits intomainfrom
add_import_gen

Conversation

@rogebrd
Copy link
Copy Markdown
Contributor

@rogebrd rogebrd commented May 17, 2021

Checklist

General Contributing

  • Have you read the Code of Conduct and signed the CLA?

Is This a Code Change?

  • Non-code related change (markdown/git settings etc)
  • Code Change
  • Example/Test Code Change

Validation

  • Have you ran tox?
  • Do the tests pass?

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2021

Codecov Report

Merging #235 (60678bb) into main (76986cb) will decrease coverage by 0.07%.
The diff coverage is 19.04%.

❗ Current head 60678bb differs from pull request most recent head 0cbf06d. Consider uploading reports for the commit 0cbf06d to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #235      +/-   ##
==========================================
- Coverage   51.72%   51.64%   -0.08%     
==========================================
  Files          37       37              
  Lines        8370     8390      +20     
  Branches     1786     1789       +3     
==========================================
+ Hits         4329     4333       +4     
- Misses       3727     3743      +16     
  Partials      314      314              
Flag Coverage Δ
unit 51.64% <19.04%> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
stone/backends/tsd_client.py 55.43% <19.04%> (-9.85%) ⬇️

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 76986cb...0cbf06d. Read the comment docs.

@rogebrd rogebrd requested a review from eugeneyche May 17, 2021 19:36
Copy link
Copy Markdown

@eugeneyche eugeneyche left a comment

Choose a reason for hiding this comment

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

Overall looks good; accepting; consider addressing typo comment.

import_template_string = self.args.import_template_string
import_from_file = self.args.types_file
# /*IMPORT*/
i_match = re.search("/\\*%s\\*/" % (import_template_string), template)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LOL this seems super manual, but I see it used in other places. Have we considered using an actual template language library?

Comment thread stone/backends/tsd_client.py Outdated
'--types-file',
type=str,
default='',
help=('If using the --import-namespaces flag, this if the file that contains '
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: think this comment has a typo

@rogebrd rogebrd merged commit 35121e8 into main May 17, 2021
@rogebrd rogebrd deleted the add_import_gen branch May 17, 2021 20:39
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