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
pythonPackages.mimesis: init at 3.3.0 #79278
Conversation
@GrahamcOfBorg build pythonPackages.mimesis |
@GrahamcOfBorg build python3Packages.mimesis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to prevent python2 trying to evaluate
|
||
buildPythonPackage rec { | ||
pname = "mimesis"; | ||
version = "3.3.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "3.3.0"; | |
version = "3.3.0"; | |
disabled = isPy27; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, missed this package is Python 3. let me update
@@ -0,0 +1,30 @@ | |||
{ lib, buildPythonPackage, fetchFromGitHub, pytest, pytest-flake8, pytest-isort, pytest-mock, pytz }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ lib, buildPythonPackage, fetchFromGitHub, pytest, pytest-flake8, pytest-isort, pytest-mock, pytz }: | |
{ lib, buildPythonPackage, fetchFromGitHub, isPy27, pytest, pytest-flake8, pytest-isort, pytest-mock, pytz }: |
13220de
to
92072d7
Compare
checkPhase = '' | ||
# deselect test_download_image and test_stock_image: the tests require access to external network | ||
# deselect test_cpf_with_666_prefix: mocker cannot be used as context manager | ||
pytest tests -k 'not test_download_image and not test_stock_image and not test_cpf_with_666_prefix' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytest tests -k 'not test_download_image and not test_stock_image and not test_cpf_with_666_prefix' | |
pytest tests -k 'not test_download_image and not test_stock_image and not test_cpf_with_666_prefix and not port' |
for python3.8, error is with tests, not code.
=================================== FAILURES ===================================
_______________ TestInternet.test_port[PortRange.ALL-excepted0] ________________
self = <tests.test_providers.test_internet.TestInternet object at 0x7fff58800670>
net = <mimesis.providers.internet.Internet object at 0x7fff58810850>
range_ = <PortRange.ALL: (1, 65535)>, excepted = (1, 65535)
@pytest.mark.parametrize(
'range_, excepted', [
(PortRange.ALL, (1, 65535)),
(PortRange.EPHEMERAL, (49152, 65535)),
(PortRange.REGISTERED, (1024, 49151)),
],
)
def test_port(self, net, range_, excepted):
result = net.port(port_range=range_)
assert (result >= excepted[0]) and (result <= excepted[1])
with pytest.raises(NonEnumerableError):
> net.port('nill')
tests/test_providers/test_internet.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mimesis/providers/internet.py:270: in port
if port_range and port_range in PortRange:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <enum 'PortRange'>, member = 'nill'
def __contains__(cls, member):
if not isinstance(member, Enum):
> raise TypeError(
"unsupported operand type(s) for 'in': '%s' and '%s'" % (
type(member).__qualname__, cls.__class__.__qualname__))
E TypeError: unsupported operand type(s) for 'in': 'str' and 'EnumMeta'
/nix/store/jdl9dnmb5xciia6vhai8m6flvbhbwsf3-python3-3.8.1/lib/python3.8/enum.py:310: TypeError
____________ TestInternet.test_port[PortRange.EPHEMERAL-excepted1] _____________
self = <tests.test_providers.test_internet.TestInternet object at 0x7fff56783250>
net = <mimesis.providers.internet.Internet object at 0x7fff56783550>
range_ = <PortRange.EPHEMERAL: (49152, 65535)>, excepted = (49152, 65535)
@pytest.mark.parametrize(
'range_, excepted', [
(PortRange.ALL, (1, 65535)),
(PortRange.EPHEMERAL, (49152, 65535)),
(PortRange.REGISTERED, (1024, 49151)),
],
)
def test_port(self, net, range_, excepted):
result = net.port(port_range=range_)
assert (result >= excepted[0]) and (result <= excepted[1])
with pytest.raises(NonEnumerableError):
> net.port('nill')
tests/test_providers/test_internet.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mimesis/providers/internet.py:270: in port
if port_range and port_range in PortRange:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <enum 'PortRange'>, member = 'nill'
def __contains__(cls, member):
if not isinstance(member, Enum):
> raise TypeError(
"unsupported operand type(s) for 'in': '%s' and '%s'" % (
type(member).__qualname__, cls.__class__.__qualname__))
E TypeError: unsupported operand type(s) for 'in': 'str' and 'EnumMeta'
/nix/store/jdl9dnmb5xciia6vhai8m6flvbhbwsf3-python3-3.8.1/lib/python3.8/enum.py:310: TypeError
____________ TestInternet.test_port[PortRange.REGISTERED-excepted2] ____________
self = <tests.test_providers.test_internet.TestInternet object at 0x7fff56712400>
net = <mimesis.providers.internet.Internet object at 0x7fff56712370>
range_ = <PortRange.REGISTERED: (1024, 49151)>, excepted = (1024, 49151)
@pytest.mark.parametrize(
'range_, excepted', [
(PortRange.ALL, (1, 65535)),
(PortRange.EPHEMERAL, (49152, 65535)),
(PortRange.REGISTERED, (1024, 49151)),
],
)
def test_port(self, net, range_, excepted):
result = net.port(port_range=range_)
assert (result >= excepted[0]) and (result <= excepted[1])
with pytest.raises(NonEnumerableError):
> net.port('nill')
tests/test_providers/test_internet.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mimesis/providers/internet.py:270: in port
if port_range and port_range in PortRange:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <enum 'PortRange'>, member = 'nill'
def __contains__(cls, member):
if not isinstance(member, Enum):
> raise TypeError(
"unsupported operand type(s) for 'in': '%s' and '%s'" % (
type(member).__qualname__, cls.__class__.__qualname__))
E TypeError: unsupported operand type(s) for 'in': 'str' and 'EnumMeta'
/nix/store/jdl9dnmb5xciia6vhai8m6flvbhbwsf3-python3-3.8.1/lib/python3.8/enum.py:310: TypeError
=========== 3 failed, 4206 passed, 1 skipped, 5 deselected in 14.99s ===========
Closing do a cleanup on our end. |
Motivation for this change
Packaging Python module
mimesis
in Nix.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)