GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-94751: Install, import and run the test C++ extension (MVP) by encukou · Pull Request #94754 · python/cpython

Conversation

@encukou

@encukou encukou commented Jul 11, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This is a quick-and-dirty way to run the C++ tests. It can definitely be improved in the future, but it should fail when things go wrong.

  • Run test functions on import (yes, this can definitely be improved)
  • Fudge setuptools metadata (name & version) to make the extension installable
  • Install and import the extension in test_cppext
  • Issue: test_cppext does not import/run the C++ extension #94751

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@encukou
bpo-94751: Install, import and run the test C++ extension (MVP)
f3d66db
- Run test functions on import (yes, this can definitely be improved)
- Fudge setuptools metadata (name & version) to make the extension
  installable
- Install and import the extension in test_cppext
@encukou encukou added tests Tests in the Lib/test dir skip news needs backport to 3.11 only security fixes labels Jul 11, 2022
@bedevere-bot bedevere-bot added the awaiting core review label Jul 11, 2022
@encukou encukou changed the title bpo-94751: Install, import and run the test C++ extension (MVP) gh-94751: Install, import and run the test C++ extension (MVP) Jul 11, 2022
@encukou
Fix refcounting
a615602
@encukou encukou mentioned this pull request Jul 11, 2022
_PyObject_CAST breaks code which assumed a static/dynamic casting #94731
Closed
@da-woods

da-woods commented Jul 11, 2022

Copy link
Copy Markdown
Contributor

It looks good to me as based on a quick read through. I think it's definitely worth running the tests rather than assuming that it's fine if it compiles.

It looks like '-X', 'showrefcount', is just going to require inspecting by eye? That's probably reasonable to defer for a future improvement, but it obviously reduces the chance of it catching any issues.

encukou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Jul 11, 2022

Copy link
Copy Markdown
Member Author

Thank you!

It looks like '-X', 'showrefcount', is just going to require inspecting by eye? That's probably reasonable to defer for a future improvement

Yes. I filed #94755 for the future improvement.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2022
@bedevere-bot

bedevere-bot commented Jul 11, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit a615602 🤖

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2022
@encukou
encukou merged commit ec5db53 into python:main Jul 12, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label Jul 12, 2022
@miss-islington

miss-islington commented Jul 12, 2022

Copy link
Copy Markdown
Contributor

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou
encukou deleted the cppext-run branch July 12, 2022 15:06
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 12, 2022
@encukou @miss-islington
pythongh-94751: Install, import and run the test C++ extension (MVP) (p…
1ab009d
…ythonGH-94754)

This is a quick-and-dirty way to run the C++ tests.
It can definitely be improved in the future, but it should fail when things go wrong.

- Run test functions on import (yes, this can definitely be improved)
- Fudge setuptools metadata (name & version) to make the extension installable
- Install and import the extension in test_cppext
(cherry picked from commit ec5db53)

Co-authored-by: Petr Viktorin <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 12, 2022
@bedevere-bot

bedevere-bot commented Jul 12, 2022

Copy link
Copy Markdown

GH-94780 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@da-woods

da-woods commented Jul 13, 2022

Copy link
Copy Markdown
Contributor

I'm seeing segfaults on from test_cppext on what should be an unrelated PR https://github.com/python/cpython/runs/7316060423?check_suite_focus=true

======================================================================
ERROR: test_build_cpp03 (test.test_cppext.TestCPPExt.test_build_cpp03)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_cppext.py", line 23, in test_build_cpp03
    self.check_build(True, '_testcpp03ext')
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_cppext.py", line 33, in check_build
    self._check_build(std_cpp03, extension_name)
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_cppext.py", line 95, in _check_build
    run_cmd('Import', cmd)
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_cppext.py", line 58, in run_cmd
    subprocess.run(cmd, check=True)
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/subprocess.py", line 558, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['env/bin/python', '-X', 'dev', '-X', 'showrefcount', '-c', 'import _testcpp03ext']' died with <Signals.SIGSEGV: 11>.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou added a commit that referenced this pull request Jul 13, 2022
@miss-islington @encukou
gh-94751: Install, import and run the test C++ extension (MVP) (GH-94754
ffbd6ae
) (#94780)

This is a quick-and-dirty way to run the C++ tests.
It can definitely be improved in the future, but it should fail when things go wrong.

- Run test functions on import (yes, this can definitely be improved)
- Fudge setuptools metadata (name & version) to make the extension installable
- Install and import the extension in test_cppext
(cherry picked from commit ec5db53)

Co-authored-by: Petr Viktorin <[email protected]>
@encukou

encukou commented Jul 13, 2022

Copy link
Copy Markdown
Member Author

You've accidentally included the failing reproducer in that unrelated PR.

Context switching is hard! Thanks for doing it to come up with the reproducer :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@encukou @da-woods @bedevere-bot @miss-islington
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.