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

Raise NotImplementedError if using wrong class #135

Merged
merged 11 commits into from Feb 17, 2022

Commits on Feb 14, 2022

  1. Raise PlatformMismatchError if using wrong class

    Instead of leaving abstract methods without definition when running on
    the other platform (Unix vs Windows), define them and raise a
    PlatformMismatchError if called on the wrong platform.
    
    This fixes pylint warnings such as
       Abstract class 'WindowsFileLock' with abstract methods instantiated
       Abstract class 'UnixFileLock' with abstract methods instantiated
    
    Fixes tox-dev#102
    vonschultz committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    e5fdb3d View commit details
    Browse the repository at this point in the history
  2. Remove unused ABC import

    vonschultz committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    a2fa785 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2022

  1. Use NotImplementedError, not PlatformMismatchError

    Instead of defining a custom exception, PlatformMismatchError, use the
    standard NotImplementedError.
    vonschultz committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    62f649f View commit details
    Browse the repository at this point in the history
  2. Add tests and a note in the change log

    Add tests of UnixFileLock on Windows systems and WindowsFileLock on
    non-Windows systems, to make sure they are not abstract (but still
    raise NotImplementedError). This avoids pylint errors in code using
    filelock.
    
    Also added a note to the change log.
    vonschultz committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    1d61cdb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    039dc57 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8954719 View commit details
    Browse the repository at this point in the history
  5. Tell flake8 that isabstract is not a misspelling

    The Python standard library module "inspect" has a function called
    "isabstract". That is not a spelling mistake. Silence flake8 SC200
    warning about "isabstract".
    vonschultz committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    6d1f52f View commit details
    Browse the repository at this point in the history
  6. Make the wrong-platform tests a single test

    Make a single test, and select lock_type based on sys.platform.
    vonschultz committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    dc782e2 View commit details
    Browse the repository at this point in the history
  7. Set release date to today

    Next minor release, and today's release date in the change log.
    vonschultz committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    a2458d9 View commit details
    Browse the repository at this point in the history
  8. Move isabstract check before lock instantiation

    To make it a bit clearer, move the preliminary check of abstractness
    before the instantiation of a lock, so that the creation of the lock
    and the pytest.raises(NotImplementedError) are adjacent.
    vonschultz committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    399576e View commit details
    Browse the repository at this point in the history
  9. PR feedback

    Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
    gaborbernat committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    4f0e020 View commit details
    Browse the repository at this point in the history