Skip to content

Commit

Permalink
pex: rely on system site-packages for RPM packages installed
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTereshenkov committed Apr 15, 2024
1 parent 91b1cf5 commit 61c6ca3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ python_distribution(
sdist=False,
generate_setup=False,
)

python_requirement(
name="python3-tabulate",
modules=[
"tabulate",
],
requirements=[
"python3-tabulate",
],
tags=[
"provided",
],
)
2 changes: 2 additions & 0 deletions cheeseshop/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import sys

import tabulate

import click
from loguru import logger

Expand Down
1 change: 1 addition & 0 deletions cheeseshop/cli/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# forbidden import
# from cheeseshop.repository.parsing.casts import from_none

import tabulate

def choices(option_type: Iterable) -> list[str]:
"""Get click option choices from an iterable."""
Expand Down
2 changes: 2 additions & 0 deletions cheeseshop/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import pkgutil

import tabulate

VERSION: str = (
pkgutil.get_data(__name__, "VERSION").decode().strip() # type: ignore[union-attr]
)
1 change: 1 addition & 0 deletions tests/cli/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python_tests(
"cheeseshop:project-version",
":cassettes",
],
extra_env_vars=["PEX_EXTRA_SYS_PATH"]
)

resources(
Expand Down
2 changes: 2 additions & 0 deletions tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
from cheeseshop.cli import cli
from cheeseshop.version import VERSION

import tabulate

def test_cli():
assert tabulate.tabulate("") == ""
runner = CliRunner()
result = runner.invoke(cli.cli, ["--version"])
assert result.exit_code == 0
Expand Down

0 comments on commit 61c6ca3

Please sign in to comment.