Title: Only exclude `_version` from top-level Import Linter contracts by Copilot · Pull Request #1536 · usethis-python/usethis-python · GitHub
Open Graph Title: Only exclude `_version` from top-level Import Linter contracts by Copilot · Pull Request #1536 · usethis-python/usethis-python
X Title: Only exclude `_version` from top-level Import Linter contracts by Copilot · Pull Request #1536 · usethis-python/usethis-python
Description: _version was being excluded from all layer contracts, including submodule contracts. Since VCS plugins (setuptools-scm, hatch-vcs) only auto-generate _version.py at the package root, a.b._version should participate normally in the a.b contract.
Fix: Guard the _version exclusion in _get_module_layered_architecture with if "." not in module:, so it only applies to root packages
Test: Added test_version_not_excluded_in_submodule verifying _version stays in layers for subpackage contracts
Original prompt
This section details on the original issue you should resolve
Open Graph Description: _version was being excluded from all layer contracts, including submodule contracts. Since VCS plugins (setuptools-scm, hatch-vcs) only auto-generate _version.py at the package root, a.b._version s...
X Description: _version was being excluded from all layer contracts, including submodule contracts. Since VCS plugins (setuptools-scm, hatch-vcs) only auto-generate _version.py at the package root, a.b._version s...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1536
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a53d0885-c619-33d4-bf40-9f9624ad94c9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D954:68043:4AB8EB:690256:6A4D1E0A |
| html-safe-nonce | 07dc35c3cc12c41e66407813ae7fcc24f0169d912429991de62e2973fdd588ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTU0OjY4MDQzOjRBQjhFQjo2OTAyNTY6NkE0RDFFMEEiLCJ2aXNpdG9yX2lkIjoiNDk5Mjg2MjAzOTg1ODU1MjMzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5380244c123871494af8266466709a4b780bcf465d329a45be238f0018db884c |
| hovercard-subject-tag | pull_request:3446988459 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/usethis-python/usethis-python/pull/1536/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | _version was being excluded from all layer contracts, including submodule contracts. Since VCS plugins (setuptools-scm, hatch-vcs) only auto-generate _version.py at the package root, a.b._version s... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 93f17a978ee60bc4668e1d7b90e6bd2d622261fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width