René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:41ee8d33-105d-7436-973b-d882f9160252
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD9BC:19E229:12367E9:194FD82:6A4DE375
html-safe-nonce16ab419539da5ee4354f8ef562418b44df6f1333a6c9d1f628817eebcd654458
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUJDOjE5RTIyOToxMjM2N0U5OjE5NEZEODI6NkE0REUzNzUiLCJ2aXNpdG9yX2lkIjoiNjQ1MDU5ODYzMTg4Nzk4NzU3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf130fb8b8dc6f382c34e7a61b00aff438c87510a4eaa5fb995a7a9cc615edec8
hovercard-subject-tagpull_request:3507022607
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/usethis-python/usethis-python/pull/1903/files
twitter:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
og:image:altFix 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git
octolytics-dimension-user_id216362695
octolytics-dimension-user_loginusethis-python
octolytics-dimension-repository_id842189705
octolytics-dimension-repository_nwousethis-python/usethis-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id842189705
octolytics-dimension-repository_network_root_nwousethis-python/usethis-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/usethis-python/usethis-python/pull/1903/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fusethis-python%2Fusethis-python%2Fpull%2F1903%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fusethis-python%2Fusethis-python%2Fpull%2F1903%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=usethis-python%2Fusethis-python
Reloadhttps://github.com/usethis-python/usethis-python/pull/1903/files
Reloadhttps://github.com/usethis-python/usethis-python/pull/1903/files
Reloadhttps://github.com/usethis-python/usethis-python/pull/1903/files
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1903/files
usethis-python https://github.com/usethis-python
usethis-pythonhttps://github.com/usethis-python/usethis-python
Notifications https://github.com/login?return_to=%2Fusethis-python%2Fusethis-python
Fork 5 https://github.com/login?return_to=%2Fusethis-python%2Fusethis-python
Star 19 https://github.com/login?return_to=%2Fusethis-python%2Fusethis-python
Code https://github.com/usethis-python/usethis-python
Issues 163 https://github.com/usethis-python/usethis-python/issues
Pull requests 4 https://github.com/usethis-python/usethis-python/pulls
Actions https://github.com/usethis-python/usethis-python/actions
Security and quality 0 https://github.com/usethis-python/usethis-python/security
Insights https://github.com/usethis-python/usethis-python/pulse
Code https://github.com/usethis-python/usethis-python
Issues https://github.com/usethis-python/usethis-python/issues
Pull requests https://github.com/usethis-python/usethis-python/pulls
Actions https://github.com/usethis-python/usethis-python/actions
Security and quality https://github.com/usethis-python/usethis-python/security
Insights https://github.com/usethis-python/usethis-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fusethis-python%2Fusethis-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fusethis-python%2Fusethis-python%2Fissues%2Fnew%2Fchoose
nathanjmcdougallhttps://github.com/nathanjmcdougall
mainhttps://github.com/usethis-python/usethis-python/tree/main
copilot/fix-usethis-tool-bughttps://github.com/usethis-python/usethis-python/tree/copilot/fix-usethis-tool-bug
Conversation 6 https://github.com/usethis-python/usethis-python/pull/1903
Commits 4 https://github.com/usethis-python/usethis-python/pull/1903/commits
Checks 20 https://github.com/usethis-python/usethis-python/pull/1903/checks
Files changed https://github.com/usethis-python/usethis-python/pull/1903/files
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1903/files
Fix usethis tool failing in directories with leading dots https://github.com/usethis-python/usethis-python/pull/1903/files#top
Show all changes 4 commits https://github.com/usethis-python/usethis-python/pull/1903/files
55d1cc0 Initial plan Copilot Apr 9, 2026 https://github.com/usethis-python/usethis-python/pull/1903/commits/55d1cc06ad86ab1073134e4b57529464c017f1d1
78128a6 Fix uv/poetry init failing in directories with leading dots in their … Copilot Apr 9, 2026 https://github.com/usethis-python/usethis-python/pull/1903/commits/78128a6b918be279be45e6368e4e3e2b1265a36e
220589e Fix Windows test failure: use PurePosixPath instead of real directories Copilot Apr 9, 2026 https://github.com/usethis-python/usethis-python/pull/1903/commits/220589e86dc58eb21043594ea21921a61e7b89c2
42f76be Fix basedpyright: replace PurePosixPath with Path/str in tests Copilot Apr 9, 2026 https://github.com/usethis-python/usethis-python/pull/1903/commits/42f76be72110590a9878d21604dd2ef6f4b2ed23
Clear filters https://github.com/usethis-python/usethis-python/pull/1903/files
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1903/files
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1903/files
init.py https://github.com/usethis-python/usethis-python/pull/1903/files#diff-acf2e77cbc44764c8b93511b3c0e0af2377e2fe3bad9cf92c510f74f056c998c
init.py https://github.com/usethis-python/usethis-python/pull/1903/files#diff-55ae7138d53cf727c4a91614ddcad0ea0d01414c371cfa69489111ca0da77991
dir.py https://github.com/usethis-python/usethis-python/pull/1903/files#diff-5c8e94517477d364989ce4b12e37a0ad2a6386bd3eb6be6ed4efbafdcb525380
test_init.py https://github.com/usethis-python/usethis-python/pull/1903/files#diff-db2f23eae96e06566ee7511176303a6c33a9f2028439af3e4baa302e9758dc15
test_valid.py https://github.com/usethis-python/usethis-python/pull/1903/files#diff-8fc99ab7b1be93710f01cf49feeea1add0b92134e285ea335b0015a0375874f3
test_dir.py https://github.com/usethis-python/usethis-python/pull/1903/files#diff-9f4c78ef5b5240e380885cf76f286833de2e46747f176c9a264f2072f0ed559a
src/usethis/_backend/poetry/init.pyhttps://github.com/usethis-python/usethis-python/pull/1903/files#diff-acf2e77cbc44764c8b93511b3c0e0af2377e2fe3bad9cf92c510f74f056c998c
View file https://github.com/usethis-python/usethis-python/blob/42f76be72110590a9878d21604dd2ef6f4b2ed23/src/usethis/_backend/poetry/init.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1903/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-acf2e77cbc44764c8b93511b3c0e0af2377e2fe3bad9cf92c510f74f056c998c
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-acf2e77cbc44764c8b93511b3c0e0af2377e2fe3bad9cf92c510f74f056c998c
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-acf2e77cbc44764c8b93511b3c0e0af2377e2fe3bad9cf92c510f74f056c998c
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-acf2e77cbc44764c8b93511b3c0e0af2377e2fe3bad9cf92c510f74f056c998c
src/usethis/_backend/uv/init.pyhttps://github.com/usethis-python/usethis-python/pull/1903/files#diff-55ae7138d53cf727c4a91614ddcad0ea0d01414c371cfa69489111ca0da77991
View file https://github.com/usethis-python/usethis-python/blob/42f76be72110590a9878d21604dd2ef6f4b2ed23/src/usethis/_backend/uv/init.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1903/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-55ae7138d53cf727c4a91614ddcad0ea0d01414c371cfa69489111ca0da77991
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-55ae7138d53cf727c4a91614ddcad0ea0d01414c371cfa69489111ca0da77991
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-55ae7138d53cf727c4a91614ddcad0ea0d01414c371cfa69489111ca0da77991
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-55ae7138d53cf727c4a91614ddcad0ea0d01414c371cfa69489111ca0da77991
src/usethis/_file/dir.pyhttps://github.com/usethis-python/usethis-python/pull/1903/files#diff-5c8e94517477d364989ce4b12e37a0ad2a6386bd3eb6be6ed4efbafdcb525380
View file https://github.com/usethis-python/usethis-python/blob/42f76be72110590a9878d21604dd2ef6f4b2ed23/src/usethis/_file/dir.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1903/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-5c8e94517477d364989ce4b12e37a0ad2a6386bd3eb6be6ed4efbafdcb525380
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-5c8e94517477d364989ce4b12e37a0ad2a6386bd3eb6be6ed4efbafdcb525380
tests/usethis/_backend/uv/test_init.pyhttps://github.com/usethis-python/usethis-python/pull/1903/files#diff-db2f23eae96e06566ee7511176303a6c33a9f2028439af3e4baa302e9758dc15
View file https://github.com/usethis-python/usethis-python/blob/42f76be72110590a9878d21604dd2ef6f4b2ed23/tests/usethis/_backend/uv/test_init.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1903/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-db2f23eae96e06566ee7511176303a6c33a9f2028439af3e4baa302e9758dc15
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-db2f23eae96e06566ee7511176303a6c33a9f2028439af3e4baa302e9758dc15
tests/usethis/_file/pyproject_toml/test_valid.pyhttps://github.com/usethis-python/usethis-python/pull/1903/files#diff-8fc99ab7b1be93710f01cf49feeea1add0b92134e285ea335b0015a0375874f3
View file https://github.com/usethis-python/usethis-python/blob/42f76be72110590a9878d21604dd2ef6f4b2ed23/tests/usethis/_file/pyproject_toml/test_valid.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1903/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-8fc99ab7b1be93710f01cf49feeea1add0b92134e285ea335b0015a0375874f3
https://github.com/usethis-python/usethis-python/pull/1903/files#diff-8fc99ab7b1be93710f01cf49feeea1add0b92134e285ea335b0015a0375874f3
tests/usethis/_file/test_dir.pyhttps://github.com/usethis-python/usethis-python/pull/1903/files#diff-9f4c78ef5b5240e380885cf76f286833de2e46747f176c9a264f2072f0ed559a
View file https://github.com/usethis-python/usethis-python/blob/42f76be72110590a9878d21604dd2ef6f4b2ed23/tests/usethis/_file/test_dir.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1903/{{ revealButtonHref }}
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1903/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.