Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-43352: Add a Barrier object in asyncio lib #24903

Merged
merged 101 commits into from
Mar 25, 2022

Conversation

YvesDup
Copy link
Contributor

@YvesDup YvesDup commented Mar 17, 2021

bpo-43352: Add a Barrier object in asyncio lib

Copy design of object Barrier from threading, same features

Modified files are:

file lib/asyncio/locks.py

  • Add Barrier and BrokenBarrierError objects
  • Added these 2 previous objects to 'all' variable

file lib/test/test_asyncio/test_locks.py

  • Add a BarrierTests object
  • Modify STR_RGX_REPR to integrate 'repr' of Barrier
  • Add a new test with Barrier in 'LockTest.test_lock_doesnt_accept_loop_parameter'

I am not familiar with git, so all files with .rst.bak extension are not in the scope of this PR

Just see https://bugs.python.org/issue37945, so the following paragraph can be deleted
"""
All tests (Win10 Python x64) are done and succesfull except one: python -m test -v test_locale
I am surprised about this error because, asyncio and locale are not linked, or are they ?
Please, how to proceed about this failure ? Open a new issue on bpo ?
a log file is available.
Thank for help
"""

https://bugs.python.org/issue43352

YvesDup added 7 commits March 16, 2021 10:51
Add a Barrier object to asyncio synchronized primitives
Change after run make patchcheck
run make patchcheck
Add comment when testing self._state
Change if to while instruction  in _block method
Refactoring all test names of BarrierTests to be more readable
Add a method cancel_coros
Refactoring and simplifyiing some tests
Correction of RGX_REPR
after run python.bat Tools\scripts\patchcheck.py
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@YvesDup

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@YvesDup YvesDup changed the title Fix issue 43352 bpo-43352: Add a Barrier object in asyncio lib Mar 17, 2021
@rhettinger
Copy link
Contributor

Please post a clean PR. The current version touches 23 files, most of which are new bak files.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@YvesDup
Copy link
Contributor Author

YvesDup commented Mar 31, 2021

PR was cleaned, stayed only 2 files now

@berkerpeksag berkerpeksag removed their request for review March 31, 2021 22:43

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@rhettinger
Copy link
Contributor

Please update the documentation.

@rhettinger rhettinger removed their request for review April 3, 2021 22:20
@YvesDup
Copy link
Contributor Author

YvesDup commented Apr 5, 2021

@rhettinger I am a rookie on cpython.
Which documentation are talking about ? Are they files about asyncio files as https://github.com/python/cpython/blob/master/Doc/library/asyncio-api-index.rst and https://github.com/python/cpython/blob/master/Doc/library/asyncio-sync.rst ?
Thank you to help me to this first time
Yves

Add  Barrier object as a clone of threading.Barrier
@asvetlov
Copy link
Contributor

Sorry, bad merge with master

asvetlov and others added 3 commits March 25, 2022 16:13

Verified

This commit was signed with the committer’s verified signature.
asvetlov Andrew Svetlov

Verified

This commit was signed with the committer’s verified signature.
asvetlov Andrew Svetlov
@asvetlov asvetlov added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 25, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @asvetlov for commit 3c30290 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 25, 2022
@asvetlov
Copy link
Contributor

Merged. Thanks for your patience, @YvesDup

@YvesDup
Copy link
Contributor Author

YvesDup commented Mar 28, 2022

A very big thank you to @asvetlov and @1st1 for your support and all the work done together on this PR, my first one !!

Thanks to @eamanu for your review, and a special thanks to @JulienPalard for his help especially on the good practices on cpython world.

PS: @asvetlov should I do something else, or just close this PR ?

@asvetlov
Copy link
Contributor

Everything is done. PR is merged, https://bugs.python.org/issue43352 is closed.
The last thing you can do is drop related branch on GitHub, it is up to you.

@YvesDup YvesDup deleted the fix-issue-43352 branch March 29, 2022 10:15
@YvesDup
Copy link
Contributor Author

YvesDup commented May 17, 2022

@asvetlov Please can tell me how to add a paragraph in whatnew 3.11#asyncio about this new feature ?
Thank you

@gvanrossum
Copy link
Member

@YvesDup Just submit a PR for Doc/whatsnew/3.11.rst that adds the desired text, and tell the reviewer to mark it for backport to 3.11.

@gvanrossum
Copy link
Member

You can reference the same issue (now migrated to #87518).

@YvesDup
Copy link
Contributor Author

YvesDup commented May 18, 2022

@gvanrossum Job in progress. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants