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

test_bdist_ext tests started failing with pytest 7.2 #186

Closed
jaraco opened this issue Oct 29, 2022 · 2 comments · Fixed by pypa/setuptools#4103
Closed

test_bdist_ext tests started failing with pytest 7.2 #186

jaraco opened this issue Oct 29, 2022 · 2 comments · Fixed by pypa/setuptools#4103

Comments

@jaraco
Copy link
Member

jaraco commented Oct 29, 2022

Tests have started failing with the release of pytest 7.2. Downgrading to pytest<7.2 works around the issue.

 distutils main $ tox -- -p no:cov -k test_build_ext -x
python installed: attrs==22.1.0,autocommand==2.2.1,black==22.10.0,click==8.1.3,coverage==6.5.0,distlib==0.3.6,docutils==0.19,exceptiongroup==1.0.0,filelock==3.8.0,flake8==4.0.1,inflect==6.0.2,iniconfig==1.1.1,jaraco.context==4.1.2,jaraco.envs==2.4.0,jaraco.functools==3.5.2,jaraco.path==3.4.0,jaraco.text==3.10.0,mccabe==0.6.1,more-itertools==9.0.0,mypy-extensions==0.4.3,packaging==21.3,path==16.5.0,pathspec==0.10.1,platformdirs==2.5.2,pluggy==1.0.0,py==1.11.0,pycodestyle==2.8.0,pydantic==1.10.2,pyfakefs==5.0.0,pyflakes==2.4.0,pyobjc==8.5.1,pyobjc-core==8.5.1,pyobjc-framework-Accessibility==8.5.1,pyobjc-framework-Accounts==8.5.1,pyobjc-framework-AddressBook==8.5.1,pyobjc-framework-AdServices==8.5.1,pyobjc-framework-AdSupport==8.5.1,pyobjc-framework-AppleScriptKit==8.5.1,pyobjc-framework-AppleScriptObjC==8.5.1,pyobjc-framework-ApplicationServices==8.5.1,pyobjc-framework-AppTrackingTransparency==8.5.1,pyobjc-framework-AudioVideoBridging==8.5.1,pyobjc-framework-AuthenticationServices==8.5.1,pyobjc-framework-AutomaticAssessmentConfiguration==8.5.1,pyobjc-framework-Automator==8.5.1,pyobjc-framework-AVFoundation==8.5.1,pyobjc-framework-AVKit==8.5.1,pyobjc-framework-BusinessChat==8.5.1,pyobjc-framework-CalendarStore==8.5.1,pyobjc-framework-CallKit==8.5.1,pyobjc-framework-CFNetwork==8.5.1,pyobjc-framework-ClassKit==8.5.1,pyobjc-framework-CloudKit==8.5.1,pyobjc-framework-Cocoa==8.5.1,pyobjc-framework-Collaboration==8.5.1,pyobjc-framework-ColorSync==8.5.1,pyobjc-framework-Contacts==8.5.1,pyobjc-framework-ContactsUI==8.5.1,pyobjc-framework-CoreAudio==8.5.1,pyobjc-framework-CoreAudioKit==8.5.1,pyobjc-framework-CoreBluetooth==8.5.1,pyobjc-framework-CoreData==8.5.1,pyobjc-framework-CoreHaptics==8.5.1,pyobjc-framework-CoreLocation==8.5.1,pyobjc-framework-CoreMedia==8.5.1,pyobjc-framework-CoreMediaIO==8.5.1,pyobjc-framework-CoreMIDI==8.5.1,pyobjc-framework-CoreML==8.5.1,pyobjc-framework-CoreMotion==8.5.1,pyobjc-framework-CoreServices==8.5.1,pyobjc-framework-CoreSpotlight==8.5.1,pyobjc-framework-CoreText==8.5.1,pyobjc-framework-CoreWLAN==8.5.1,pyobjc-framework-CryptoTokenKit==8.5.1,pyobjc-framework-DataDetection==8.5.1,pyobjc-framework-DeviceCheck==8.5.1,pyobjc-framework-DictionaryServices==8.5.1,pyobjc-framework-DiscRecording==8.5.1,pyobjc-framework-DiscRecordingUI==8.5.1,pyobjc-framework-DiskArbitration==8.5.1,pyobjc-framework-DVDPlayback==8.5.1,pyobjc-framework-EventKit==8.5.1,pyobjc-framework-ExceptionHandling==8.5.1,pyobjc-framework-ExecutionPolicy==8.5.1,pyobjc-framework-ExternalAccessory==8.5.1,pyobjc-framework-FileProvider==8.5.1,pyobjc-framework-FileProviderUI==8.5.1,pyobjc-framework-FinderSync==8.5.1,pyobjc-framework-FSEvents==8.5.1,pyobjc-framework-GameCenter==8.5.1,pyobjc-framework-GameController==8.5.1,pyobjc-framework-GameKit==8.5.1,pyobjc-framework-GameplayKit==8.5.1,pyobjc-framework-ImageCaptureCore==8.5.1,pyobjc-framework-IMServicePlugIn==8.5.1,pyobjc-framework-InputMethodKit==8.5.1,pyobjc-framework-InstallerPlugins==8.5.1,pyobjc-framework-InstantMessage==8.5.1,pyobjc-framework-Intents==8.5.1,pyobjc-framework-IntentsUI==8.5.1,pyobjc-framework-IOSurface==8.5.1,pyobjc-framework-iTunesLibrary==8.5.1,pyobjc-framework-KernelManagement==8.5.1,pyobjc-framework-LatentSemanticMapping==8.5.1,pyobjc-framework-LaunchServices==8.5.1,pyobjc-framework-libdispatch==8.5.1,pyobjc-framework-LinkPresentation==8.5.1,pyobjc-framework-LocalAuthentication==8.5.1,pyobjc-framework-LocalAuthenticationEmbeddedUI==8.5.1,pyobjc-framework-MailKit==8.5.1,pyobjc-framework-MapKit==8.5.1,pyobjc-framework-MediaAccessibility==8.5.1,pyobjc-framework-MediaLibrary==8.5.1,pyobjc-framework-MediaPlayer==8.5.1,pyobjc-framework-MediaToolbox==8.5.1,pyobjc-framework-Metal==8.5.1,pyobjc-framework-MetalKit==8.5.1,pyobjc-framework-MetalPerformanceShaders==8.5.1,pyobjc-framework-MetalPerformanceShadersGraph==8.5.1,pyobjc-framework-MetricKit==8.5.1,pyobjc-framework-MLCompute==8.5.1,pyobjc-framework-ModelIO==8.5.1,pyobjc-framework-MultipeerConnectivity==8.5.1,pyobjc-framework-NaturalLanguage==8.5.1,pyobjc-framework-NetFS==8.5.1,pyobjc-framework-Network==8.5.1,pyobjc-framework-NetworkExtension==8.5.1,pyobjc-framework-NotificationCenter==8.5.1,pyobjc-framework-OpenDirectory==8.5.1,pyobjc-framework-OSAKit==8.5.1,pyobjc-framework-OSLog==8.5.1,pyobjc-framework-PassKit==8.5.1,pyobjc-framework-PencilKit==8.5.1,pyobjc-framework-Photos==8.5.1,pyobjc-framework-PhotosUI==8.5.1,pyobjc-framework-PreferencePanes==8.5.1,pyobjc-framework-PushKit==8.5.1,pyobjc-framework-Quartz==8.5.1,pyobjc-framework-QuickLookThumbnailing==8.5.1,pyobjc-framework-ReplayKit==8.5.1,pyobjc-framework-SafariServices==8.5.1,pyobjc-framework-SceneKit==8.5.1,pyobjc-framework-ScreenCaptureKit==8.5.1,pyobjc-framework-ScreenSaver==8.5.1,pyobjc-framework-ScreenTime==8.5.1,pyobjc-framework-ScriptingBridge==8.5.1,pyobjc-framework-SearchKit==8.5.1,pyobjc-framework-Security==8.5.1,pyobjc-framework-SecurityFoundation==8.5.1,pyobjc-framework-SecurityInterface==8.5.1,pyobjc-framework-ServiceManagement==8.5.1,pyobjc-framework-ShazamKit==8.5.1,pyobjc-framework-Social==8.5.1,pyobjc-framework-SoundAnalysis==8.5.1,pyobjc-framework-Speech==8.5.1,pyobjc-framework-SpriteKit==8.5.1,pyobjc-framework-StoreKit==8.5.1,pyobjc-framework-SyncServices==8.5.1,pyobjc-framework-SystemConfiguration==8.5.1,pyobjc-framework-SystemExtensions==8.5.1,pyobjc-framework-UniformTypeIdentifiers==8.5.1,pyobjc-framework-UserNotifications==8.5.1,pyobjc-framework-UserNotificationsUI==8.5.1,pyobjc-framework-VideoSubscriberAccount==8.5.1,pyobjc-framework-VideoToolbox==8.5.1,pyobjc-framework-Virtualization==8.5.1,pyobjc-framework-Vision==8.5.1,pyobjc-framework-WebKit==8.5.1,pyparsing==3.0.9,pytest==7.2.0,pytest-black==0.3.12,pytest-cov==4.0.0,pytest-enabler==1.3.0,pytest-flake8==1.1.1,six==1.16.0,toml==0.10.2,tomli==2.0.1,tox==3.27.0,typing_extensions==4.4.0,virtualenv==20.16.6
python run-test-pre: PYTHONHASHSEED='646420586'
python run-test: commands[0] | pytest -p no:cov -k test_build_ext -x
================================================================= test session starts ==================================================================
platform darwin -- Python 3.10.8, pytest-7.2.0, pluggy-1.0.0
cachedir: .tox/python/.pytest_cache
rootdir: /Users/jaraco/code/pypa/distutils, configfile: pytest.ini
plugins: black-0.3.12, pyfakefs-5.0.0, flake8-1.1.1, enabler-1.3.0
collected 457 items / 427 deselected / 30 selected                                                                                                     

distutils/tests/test_build_ext.py ssE

======================================================================== ERRORS ========================================================================
____________________________________________________ ERROR at setup of TestBuildExt.test_build_ext _____________________________________________________

request = <SubRequest 'user_site_dir' for <Function test_build_ext>>

    @pytest.fixture()
    def user_site_dir(request):
        self = request.instance
>       self.tmp_dir = self.mkdtemp()

distutils/tests/test_build_ext.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <distutils.tests.test_build_ext.TestBuildExt object at 0x1027d4430>

    def mkdtemp(self):
        """Create a temporary directory that will be cleaned up.
    
        Returns the path of the directory.
        """
        d = tempfile.mkdtemp()
>       self.tempdirs.append(d)
E       AttributeError: 'TestBuildExt' object has no attribute 'tempdirs'

distutils/tests/support.py:26: AttributeError
=============================================================== short test summary info ================================================================
ERROR distutils/tests/test_build_ext.py::TestBuildExt::test_build_ext - AttributeError: 'TestBuildExt' object has no attribute 'tempdirs'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================== 2 skipped, 427 deselected, 1 error in 0.24s ======================================================
ERROR: InvocationError for command /Users/jaraco/code/pypa/distutils/.tox/python/bin/pytest -p no:cov -k test_build_ext -x (exited with code 1)
_______________________________________________________________________ summary ________________________________________________________________________
ERROR:   python: commands failed
@jaraco
Copy link
Member Author

jaraco commented Oct 29, 2022

I suspect the issue is that this fixture isn't being invoked or is being invoked too late.

@jaraco
Copy link
Member Author

jaraco commented Oct 29, 2022

You should be able to replicate the issue by checking out e414cdf and running tox.

clrpackages pushed a commit to clearlinux-pkgs/pypi-setuptools that referenced this issue Nov 22, 2022
…version 65.6.0

Anderson Bravalheri (6):
      Fix misspelling in docs/userguide/development_mode.rst
      Highlight in docs: 'attr' directive needs MANIFEST.in config / SCM plugin
      Ensure pyproject.toml accepts UTF-8 in maintainers
      Minor stylistic change
      Minor stylistic change
      Minor stylistic change

Jason R. Coombs (39):
      Remove docstring in distutils
      Prefer partition for splitting a string.
      Remove readme
      Prefer relative imports for better portability.
      No need to save 'threshold' on the instance.
      Use monkeypatch to set log and threshold.
      Extract fixture for capturing logs in _util modules.
      Expand 'logs' fixture to support features needed by LoggingSilencer.
      Consolidate fixture for capturing logs. Removes LoggingSilencer.
      Prefer capsys to test.support.captured*
      Fix broken test
      Prefer caplog to mocking the logging interface.
      GHA pretty env (#67)
      or maybe not
      Remove setting of dll_libraries in Mingw32CCompiler. One call superseded the other, and the result was redundant with what happens in the parent call.
      Short circuit when MSC version is not found.
      Prefer partition to find.
      Work with ints uniformally.
      Replace if/else with a lookup.
      Move lookup out of the function
      Prefer regex search to string manipulation.
      Use RangeMap to define the ranges in one place.
      Use try/except when assigning msc_ver.
      👹 Feed the hobgoblins (delint).
      Re-paste RangeMap with newlines restored (unsure what made them disappear).
      Pin pytest to <7.2. Workaround for pypa/distutils#186.
      In TempdirManager, use pathlib and more_itertools to more simply write the text.
      Rewrite init/for/append loop as comprehension and if/else as tertiary statement.
      Pin mypy to '<0.990' due to realpython/pytest-mypy#141
      Remove the hyperlink for the Python versions badge. The PyPI badge is a better anchor for the hyperlink.
      Apply explicit_package_bases for mypy and unpin the version. Ref python/mypy#14057.
      Replace bespoke logging facility with logging module, available since Python 2.3.
      Avoid use of the distutils.log module.
      Log to the root logger, as that's the one Setuptools patches/validates.
      ⚫ Fade to black.
      Skip test under xdist as it fails after migrating to Python logging. Ref pypa/distutils#183. Workaround for pytest/pytest-xdist#843.
      Skip an additional test under xdist. Ref pypa/distutils#183. Expanded workaround for pytest-dev/pytest-xdist#843.
      Update changelog.
      Bump version: 65.5.1 → 65.6.0

Sviatoslav Sydorenko (8):
      Make the `check` job a central gate in the CI
      Allow skipping `integration-test` unconditionally
      Upload accurate coverage flags from unit tests job
      Use job id as a coverage flag
      Report coverage from Cygwin jobs
      Explicitly point Codecov at `coverage.xml`
      Use an absolute path for codecov uploads
      Add a test for maintainers w/ international emails

Zach Burnett (1):
      rename `.readthedocs.yml` to `.readthedocs.yaml` (RTD docs indicate that `.readthedocs.yml` will be deprecated) (#68)

shripadbadithe (1):
      Fix typo in docs/userguide/development_mode.rst
@jaraco jaraco closed this as completed in 5a8ca1b Jul 1, 2023
clrpackages pushed a commit to clearlinux-pkgs/pypi-setuptools that referenced this issue Nov 28, 2023
…version 69.0.2

Anderson Bravalheri (50):
      Temporarily disable overdue deprecations
      Remove sphinx-hoverxref
      Unify passenv with pass_env in tox.ini so we don't have trouble with TOX_OVERRIDE
      Docs: use Python 3.11 inventory to avoid errors with distutils references
      Refactor type files tests in test_build_py
      Avoid running build_py in tests to speed up process
      Mark feature as experimental in docs
      Avoid modifying dict in test_build_py
      Apply suggestions from code review
      Fix failing CI (#4110)
      Re-enable deprecation warning enforcement
      Remove deprecation warning from _normalization.best_effort_version
      Remove egg_base option from dist_info
      Ensure tags generated by egg_info are valid
      Remove 'requires' and 'license_file' from setup.cfg
      Improve explanation of difference between safe_version and best_effort_version
      Remove deprecation warning for config_settings --global-option
      Remove deprecation warning for invalid versions in setuptools.dist
      Add news fragments
      Xfail on deprecated bdist_rpm tests
      Be strict on missing 'dynamic' in pyproject.toml
      Enforce namespace-packages are not used in pyproject.toml
      Use custom class for InvalidConfigError
      Add newsfragments for latest removals
      Update newsfragments
      Fix lint errors
      Add workaround for unreleased PyNaCl
      Only pass `--build-option` to `bdist_wheel` in build_meta
      Remove no longer valid tests for config_settings and editable installs
      Add news fragment
      Update guides on datafiles
      Add note abot using namespace packages for data files
      Add note about dynamic configs via attr and imports
      Use InvalidConfigError instead of ValueError in build_meta
      Remove deprecated handling of build-option passed as global-option
      Relax validation of --global-option in build_meta
      Add newsfragment
      Mark flaky test on  with xfail
      Add pragma for xfail condition
      Add reference to PR number in xfail message
      Fix lint error
      Add missing contextmanager to decorator
      Use wrapper for decorator instead of contextlib
      Bump version: 68.2.2 → 69.0.0
      Allow imports of setuptools.dep_util.newer_group with deprecation warning
      Add newsfragment
      Bump version: 69.0.0 → 69.0.1
      Improve warning visibility with due date and reference url
      Add news fragment
      Bump version: 69.0.1 → 69.0.2

Avasam (4):
      Re-export `distutils.dep_util` in `setuptools.dep_util`
      Added towncrier file
      Added towncrier file
      Update newsfragments/4069.feature.rst

Danie-1 (1):
      Use generators

Daniel Naylor (11):
      Include type information by default
      Add newsfragment
      Revert "Use generators"
      Revert "Include type information by default"
      Rename newsfragment file
      Add tests to check type information is included by default
      Format test with black
      Include type information by default
      Move tests from test_build_meta to test_build_py
      Fix test on windows by replacing os.sep
      Fix typo in docs

Daniel Nunes (1):
      Added tests for newer_pairwise_group().

Dimitri Papadopoulos (8):
      Fix typo found by codespell
      Fix a couple typos found by codespell
      Update URLs in documentation: http:// → https://
      io.open() → open()
      IOError → OSError
      "yield from", instead of "yield" in a loop
      socket.error → OSError
      @functools.lru_cache() → @functools.lru_cache

Jason R. Coombs (36):
      Rely on pytest as found in pytest-dev/pytest#11155. Fixes pypa/distutils#186.
      Pin against sphinx 7.2.5 as workaround for sphinx/sphinx-doc#11662. Closes jaraco/skeleton#88.
      Allow GITHUB_* settings to pass through to tests.
      Remove spinner disablement. If it's not already fixed upstream, that's where it should be fixed.
      Clean up 'color' environment variables.
      Add diff-cover check to Github Actions CI. Closes jaraco/skeleton#90.
      Add descriptions to the tox environments. Closes jaraco/skeleton#91.
      Add FORCE_COLOR to the TOX_OVERRIDE for GHA. Requires tox 4.11.1. Closes jaraco/skeleton#89.
      Prefer ``pass_env`` in tox config. Preferred failure mode for tox-dev/tox#3127 and closes jaraco/skeleton#92.
      Clean up docstrings and remove crufty comments. Replace integer literals with booleans.
      "Refactor to newer_group to utilize higher level constructs ("any"), re-use _newer logic, and avoid complexity in branching."
      Prefer os.path.getmtime
      Inline check for target presence.
      Add test for newer_pairwise, bringing coverage in dep_util to 100%.
      Replace for/append loop with a filter function (newer_pair).
      Replace explicit list check with zip(strict=True). Allows inputs to be iterables.
      Extract a 'starfilter', similar to itertools.starmap, to generalize the concept of filtering results over a sequence of tuples.
      Replace '_starfilter' with 'jaraco.functools.splat'.
      Move dep_util to _modified and mark dep_util as deprecated.
      Extend tests for newer_pairwise and fix failed expectation when no files are newer.
      Add newer_pairwise_group (inspired by setuptools.dep_util).
      Modernize test_newer_pairwise_group by using tmp_path and a SimpleNamespace.
      Remove latent references in docs.
      Limit sphinxlint jobs to 1. Workaround for sphinx-contrib/sphinx-lint#83.
      Replace git version with released version. Ref #186.
      Disable cygwin tests for now. Ref pypa/setuptools#3921
      Disable integration test due to known breakage from deprecation warnings.
      Allow diffcov to fail also, as it requires the tests to pass on the latest Python to succeed.
      Remove newsfragment
      Copy concurrency setting from setuptools
      Rely on distutils._modified and deprecated setuptools.dep_util.
      Add news fragment.
      Use 'setuptools.modified' as the consolidated module for modified file functions.
      Fallback when SETUPTOOLS_USE_DISTUTILS=stdlib
      Make the example pyproject.toml valid toml so it doesn't crash docs builds. Closes #4118.
      Exclude setuptools.modified from test collection to avoid early import.

Jean Abou Samra (5):
      Import PUG guide to MANIFEST.in
      Add the more complete list
      Revise list of default included files
      Add warning about other setuptools versions
      Link to the new pyproject.toml guide the PUG

Miro Hrončok (1):
      Fix setuptools.depends:get_module_constant() on Python 3.13.0a1
This issue was closed.
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 a pull request may close this issue.

1 participant