Skip to content

Conversation

PaliC
Copy link
Contributor

@PaliC PaliC commented Jul 5, 2022

Summary:
This pr addresses #82 and #44.

A C extension module behaves a bit differently than a normal python package as it does not contain a __path__ attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module and checks if the module we are looking for is in it's children.

For example, if we are importing torch._C._nn we check if the parent torch._C is a C extension module if necessary, and then check if torch._C._nn is a proper child of torch._C.

The corresponding PR in torch.package is pytorch/pytorch#80917

Differential Revision: D37630606

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Jul 5, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37630606

@codecov
Copy link

codecov bot commented Jul 5, 2022

Codecov Report

Merging #91 (81dc50e) into main (80fd3b3) will decrease coverage by 0.04%.
The diff coverage is 81.81%.

@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
- Coverage   88.99%   88.94%   -0.05%     
==========================================
  Files          65       65              
  Lines        3842     3862      +20     
==========================================
+ Hits         3419     3435      +16     
- Misses        423      427       +4     
Impacted Files Coverage Δ
multipy/package/package_importer_no_torch.py 83.23% <63.63%> (-0.77%) ⬇️
multipy/test/package/test_dependency_api.py 99.58% <100.00%> (+0.01%) ⬆️

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 80fd3b3...81dc50e. Read the comment docs.

PaliC added a commit to PaliC/multipy that referenced this pull request Jul 5, 2022
…multipy (pytorch#91)

Summary:
Pull Request resolved: pytorch#91

This pr addresses pytorch#82 and pytorch#44.

A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module  and checks if the module we are looking for is in it's children.

For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`.

The corresponding PR in torch.package is pytorch/pytorch#80917

Differential Revision: D37630606

fbshipit-source-id: 65e549b66550d676a0e766a5f0c38b417f038a20
@PaliC PaliC force-pushed the export-D37630606 branch from 3accf2e to 27873bb Compare July 5, 2022 22:43
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37630606

PaliC added a commit to PaliC/multipy that referenced this pull request Jul 6, 2022
…multipy (pytorch#91)

Summary:
Pull Request resolved: pytorch#91

This pr addresses pytorch#82 and pytorch#44.

A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module  and checks if the module we are looking for is in it's children.

For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`.

The corresponding PR in torch.package is pytorch/pytorch#80917

Differential Revision: D37630606

fbshipit-source-id: f18991665618291664a0b3b34c95f5dbb91247af
@PaliC PaliC force-pushed the export-D37630606 branch from 27873bb to d17166a Compare July 6, 2022 00:35
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37630606

PaliC added a commit to PaliC/multipy that referenced this pull request Jul 11, 2022
…multipy (pytorch#91)

Summary:
Pull Request resolved: pytorch#91

This pr addresses pytorch#82 and pytorch#44.

A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module  and checks if the module we are looking for is in it's children.

For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`.

The corresponding PR in torch.package is pytorch/pytorch#80917

Reviewed By: d4l3k

Differential Revision: D37630606

fbshipit-source-id: 19e6bb808b893aaab39790929e130eb0bbd62d91
@PaliC PaliC force-pushed the export-D37630606 branch from d17166a to 3df7a89 Compare July 11, 2022 17:52
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37630606

…multipy (pytorch#91)

Summary:
Pull Request resolved: pytorch#91

This pr addresses pytorch#82 and pytorch#44.

A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module  and checks if the module we are looking for is in it's children.

For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`.

The corresponding PR in torch.package is pytorch/pytorch#80917

Reviewed By: d4l3k

Differential Revision: D37630606

fbshipit-source-id: ee562573ea4c0bbc43facc5ae9a0fc4ad8f29cd6
@PaliC PaliC force-pushed the export-D37630606 branch from 3df7a89 to 81dc50e Compare July 11, 2022 18:00
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37630606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants