Skip to content

Vendorize Version #461

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

Merged
merged 3 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ $ pip install --user --upgrade --pre libtmux

- Remove unused `sphinx-click` development dependency

## libtmux 0.16.1 (2022-12-12)

### Fixes

- Remove reliance on `packaging.version.Version` (#461)

This is too critical of a package to pin a dependency as it may interfere with other packages the user relies on. In addition, libtmux doesn't need strict compatibility with `packaging`.

## libtmux 0.16.0 (2022-12-10)

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion src/libtmux/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def str_from_console(s: t.Union[str, bytes]) -> str:
import re
from typing import Iterator, List, Tuple

from packaging.version import Version
from libtmux._vendor.version import Version

###
### Legacy support for LooseVersion / LegacyVersion, e.g. 2.4-openbsd
Expand Down
Empty file added src/libtmux/_vendor/__init__.py
Empty file.
62 changes: 62 additions & 0 deletions src/libtmux/_vendor/_structures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# via https://github.com/pypa/packaging/blob/22.0/packaging/_structures.py
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.


class InfinityType:
def __repr__(self) -> str:
return "Infinity"

def __hash__(self) -> int:
return hash(repr(self))

def __lt__(self, other: object) -> bool:
return False

def __le__(self, other: object) -> bool:
return False

def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__)

def __gt__(self, other: object) -> bool:
return True

def __ge__(self, other: object) -> bool:
return True

def __neg__(self: object) -> "NegativeInfinityType":
return NegativeInfinity


Infinity = InfinityType()


class NegativeInfinityType:
def __repr__(self) -> str:
return "-Infinity"

def __hash__(self) -> int:
return hash(repr(self))

def __lt__(self, other: object) -> bool:
return True

def __le__(self, other: object) -> bool:
return True

def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__)

def __gt__(self, other: object) -> bool:
return False

def __ge__(self, other: object) -> bool:
return False

def __neg__(self: object) -> InfinityType:
return Infinity


NegativeInfinity = NegativeInfinityType()
Loading