Skip to content

Conversation

blink1073
Copy link
Member

Fails as expected when the c extension has an error now:

      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Ibson -I/Users/steve.silvester/workspace/mongo-python-driver/.tox/test/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c bson/_cbsonmodule.c -o build/temp.macosx-10.9-x86_64-cpython-37/bson/_cbsonmodule.o
      bson/_cbsonmodule.c:282:5: error: use of undeclared identifier 'a'
          a = b;
          ^
      bson/_cbsonmodule.c:282:9: error: use of undeclared identifier 'b'
          a = b;
              ^
      2 errors generated.
      /private/tmp/pip-build-env-4cfbi019/overlay/lib/python3.7/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
        config = read_configuration(filepath, True, ignore_option_errors, dist)
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pymongo
ERROR: Could not build wheels for pymongo, which is required to install pyproject.toml-based projects

test: exit 1 (4.24 seconds) /Users/steve.silvester/workspace/mongo-python-driver> python -I -m pip install --force-reinstall --no-deps /Users/steve.silvester/workspace/mongo-python-driver/.tox/.tmp/package/9/pymongo-4.5.0.dev0.tar.gz pid=44837
.pkg: _exit> python /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  test: FAIL code 1 (5.28 seconds)
  evaluation failed :( (5.36 seconds)

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Will this work when running with pypy? edit: I see the pypy tests are passing.

@blink1073 blink1073 merged commit 2a4dc9c into mongodb:master Jun 22, 2023
@blink1073 blink1073 deleted the PYTHON-3760 branch June 22, 2023 21:18
@casch-at
Copy link

casch-at commented Sep 20, 2023

Unfortunately this brakes installing pymongo within a tox environment where gcc is not available. I guess, I need to set the NO_EXT environment then?

EDIT:
Setting NO_EXT leads to different version, last working version is 4.4.1

$ export NO_EXT=1
$ pip install pymongo

Collecting pymongo
  Downloading https://pypi.sozvers.at/root/pypi/%2Bf/681/f252e43b3ef05/pymongo-4.5.0.tar.gz (848 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 848.7/848.7 kB 13.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-53sxbup9/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-53sxbup9/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-53sxbup9/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 119, in <module>
      ValueError: list.remove(x): x not in list
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

@ShaneHarvey
Copy link
Member

@cslux Thank you for the report, we'll fix this in https://jira.mongodb.org/browse/PYTHON-3968

@ShaneHarvey
Copy link
Member

I suspect the only workaround (until PYTHON-3968 is implemented) might be to temporarily unset the TOX_ENV_NAME var:

$ export _TOX_ENV_NAME=$TOX_ENV_NAME
$ unset TOX_ENV_NAME
$ pip install pymongo
$ export TOX_ENV_NAME=$_TOX_ENV_NAME
$ unset _TOX_ENV_NAME

ShaneHarvey added a commit to ShaneHarvey/mongo-python-driver that referenced this pull request Oct 27, 2023
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.

3 participants