Title: Fix `usethis tool` failing in directories with leading dots by Copilot · Pull Request #1903 · usethis-python/usethis-python · GitHub
Open Graph Title: Fix `usethis tool` failing in directories with leading dots by Copilot · Pull Request #1903 · usethis-python/usethis-python
X Title: Fix `usethis tool` failing in directories with leading dots by Copilot · Pull Request #1903 · usethis-python/usethis-python
Description: Fix get_project_name_from_dir() in src/usethis/_file/dir.py to strip leading/trailing non-alphanumeric characters (., -, _) since package names must start and end with a letter or digit per PEP spec Fix ensure_pyproject_toml_via_uv() and opinionated_uv_init() in src/usethis/_backend/uv/init.py to pass --name with the sanitized project name from get_project_name_from_dir() Fix ensure_pyproject_toml_via_poetry() and opinionated_poetry_init() in src/usethis/_backend/poetry/init.py to use get_project_name_from_dir() instead of raw usethis_config.cpd().name Add tests for the leading-dot directory name case Fix Windows test failure: use synthetic paths instead of creating real directories (lesson filed as #1906) Fix basedpyright: replace PurePosixPath with Path/str (basedpyright rejects PurePosixPath for Path | str | None) Run full coverage and static checks (prek, basedpyright, CodeQL all pass) Skills used: usethis-file-create, usethis-qa-static-checks, usethis-python-test-full-coverage, usethis-lesson-create, usethis-github-issue-create Resolves #1925
Open Graph Description: Fix get_project_name_from_dir() in src/usethis/_file/dir.py to strip leading/trailing non-alphanumeric characters (., -, _) since package names must start and end with a letter or digit per PEP spe...
X Description: Fix get_project_name_from_dir() in src/usethis/_file/dir.py to strip leading/trailing non-alphanumeric characters (., -, _) since package names must start and end with a letter or digit per PEP spe...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1903
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:41ee8d33-105d-7436-973b-d882f9160252 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D9BC:19E229:12367E9:194FD82:6A4DE375 |
| html-safe-nonce | 16ab419539da5ee4354f8ef562418b44df6f1333a6c9d1f628817eebcd654458 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUJDOjE5RTIyOToxMjM2N0U5OjE5NEZEODI6NkE0REUzNzUiLCJ2aXNpdG9yX2lkIjoiNjQ1MDU5ODYzMTg4Nzk4NzU3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f130fb8b8dc6f382c34e7a61b00aff438c87510a4eaa5fb995a7a9cc615edec8 |
| hovercard-subject-tag | pull_request:3507022607 |
| 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/1903/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 | Fix get_project_name_from_dir() in src/usethis/_file/dir.py to strip leading/trailing non-alphanumeric characters (., -, _) since package names must start and end with a letter or digit per PEP spe... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| 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 | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width