Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add aSocketPath type forlinux systems#10378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

theunkn0wn1
Copy link
Contributor

@theunkn0wn1theunkn0wn1 commentedSep 10, 2024
edited by pydantic-hookybot
Loading

Change Summary

The existing FilePath type does not accept sockets, as they fail thePath.is_file(self) check.
As such, I added a newSocketPath type and corresponding validator usingPath.is_socket(self).

Related issue number

fix#10376

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review,please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer:@sydney-runkle

@github-actionsgithub-actionsbot added the relnotes-fixUsed for bugfixes. labelSep 10, 2024
@codspeed-hqCodSpeed HQ
Copy link

codspeed-hqbot commentedSep 10, 2024
edited
Loading

CodSpeed Performance Report

Merging#10378 willnot alter performance

Comparingtheunkn0wn1:user/theunkn0wn1/validate_socket (b874a82) withmain (7daa2cd)

Summary

✅ 49 untouched benchmarks

@theunkn0wn1
Copy link
ContributorAuthor

Test will need to be skipped on windows; as it doesn't have sockets to begin with.
Not sure why the tests are failing on mac.

Copy link
Member

@ViicosViicos left a comment
edited
Loading

Choose a reason for hiding this comment

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

I'm wondering if we should do something like:

Edit: Seems like on Windows,is_socket returnsFalse, so maybe it's safe to not add these kind of conditions.

@ViicosViicos changed the titleAdd a SocketPath typeAdd aSocketPath typeSep 12, 2024
@sydney-runkle
Copy link
Contributor

Looking good though, happy to support this once we get tests passing, etc :).

theunkn0wn1 reacted with heart emoji

@theunkn0wn1
Copy link
ContributorAuthor

ok for the issue with the Mac tests - pytest seems to be configured wrong, the temporary paths its generating with its fixture exceed the maximum length of a socket name on that platform.
Only way i can see to fix that would be to change the pytest config to use a more sensible base directory.
the trouble? i don't have a mac to test with and don't know what a sensible base path for that platform is.
Can I ask for some pointers here?

@Viicos
Copy link
Member

ok for the issue with the Mac tests - pytest seems to be configured wrong, the temporary paths its generating with its fixture exceed the maximum length of a socket name on that platform.
Only way i can see to fix that would be to change the pytest config to use a more sensible base directory.
the trouble? i don't have a mac to test with and don't know what a sensible base path for that platform is.
Can I ask for some pointers here?

I'm ok only running the test on Linux. The goal isn't to test that creating sockets works, but to ensure thatvalidate_socket works as expected when encountering a socket path.

theunkn0wn1 reacted with heart emoji

@theunkn0wn1theunkn0wn1force-pushed theuser/theunkn0wn1/validate_socket branch 2 times, most recently from62fdf62 to10d4ce8CompareSeptember 13, 2024 19:58
@theunkn0wn1theunkn0wn1force-pushed theuser/theunkn0wn1/validate_socket branch from10d4ce8 tob874a82CompareSeptember 13, 2024 20:03
@theunkn0wn1
Copy link
ContributorAuthor

Added condition to skip new test if not linux.
squashed commits to one.
rebased against tip of upstream main. :)

@github-actionsGitHub Actions
Copy link
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  types.py1277
Project Total 

This report was generated bypython-coverage-comment-action

@theunkn0wn1
Copy link
ContributorAuthor

please review :)

pydantic-hooky[bot] reacted with thumbs up emoji

Copy link
Contributor

@sydney-runklesydney-runkle left a comment

Choose a reason for hiding this comment

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

Great, thanks!

theunkn0wn1 reacted with heart emoji
@sydney-runklesydney-runkle changed the titleAdd aSocketPath typeAdd aSocketPath type forlinux systemsSep 14, 2024
@sydney-runklesydney-runkle merged commit5d5b8af intopydantic:mainSep 14, 2024
59 checks passed
@theunkn0wn1theunkn0wn1 deleted the user/theunkn0wn1/validate_socket branchSeptember 24, 2024 18:12
@theunkn0wn1
Copy link
ContributorAuthor

@sydney-runkle when can i expect this change to be released? 😇

@sydney-runkle
Copy link
Contributor

@theunkn0wn1, with our 2.10 release in late October! Feel free to install from main in the meantime :)

theunkn0wn1 reacted with eyes emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ViicosViicosViicos left review comments

@sydney-runklesydney-runklesydney-runkle approved these changes

Assignees

@sydney-runklesydney-runkle

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Pydantic FilePath does not accept sockets
3 participants
@theunkn0wn1@sydney-runkle@Viicos

[8]ページ先頭

©2009-2025 Movatter.jp