Skip to content

Commit

Permalink
Merge latest state
Browse files Browse the repository at this point in the history
  • Loading branch information
markurtz committed Aug 24, 2024
2 parents 0bb6db5 + bb00361 commit 8c25a1c
Show file tree
Hide file tree
Showing 88 changed files with 8,805 additions and 2,508 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
publish:
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
env:
GUIDELLM_BUILD_TYPE: nightly
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -68,4 +71,3 @@ jobs:
with:
publish_pypi: true
publish_pypi_internal: true
build_type: nightly
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
name: Build & Publish the distribution
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
env:
GUIDELLM_BUILD_TYPE: release
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -70,4 +73,3 @@ jobs:
with:
publish_pypi: true
publish_pypi_internal: true
build_type: release
4 changes: 3 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
name: Build & Publish the distribution
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
env:
GUIDELLM_BUILD_TYPE: release
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -69,4 +72,3 @@ jobs:
with:
publish_pypi: false
publish_pypi_internal: true
build_type: release
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,21 @@ repos:
# main dependencies
click,
datasets,
ftfy,
loguru,
numpy,
openai,
pydantic,
pydantic_settings,
pyyaml,
requests,
rich,
transformers,

# dev dependencies
pytest,
pydantic_settings,
requests-mock,

# types
types-click,
Expand Down
32 changes: 23 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,32 @@ urls = { homepage = "https://github.com/neuralmagic/guidellm" }
dependencies = [
"click",
"datasets",
"ftfy>=6.0.0",
"loguru",
"numpy",
"openai",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
"pyyaml>=6.0.0",
"requests",
"rich",
"transformers",
]

[project.optional-dependencies]
dev = [
# general and configurations
"pre-commit~=3.5.0",
"scipy~=1.10",
"sphinx~=7.1.2",
"tox~=4.16.0",

# testing
"pytest~=8.2.2",
"pytest-asyncio~=0.23.8",
"pytest-cov~=5.0.0",
"pytest-mock~=3.14.0",
"pytest-rerunfailures~=14.0",
"requests-mock~=1.12.1",

# code quality
Expand Down Expand Up @@ -83,7 +88,7 @@ profile = "black"
files = ["src/guidellm", "tests"]
python_version = '3.8'
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_ignores = false
show_error_codes = true
namespace_packages = true
exclude = ["venv", ".tox"]
Expand All @@ -92,22 +97,27 @@ exclude = ["venv", ".tox"]
# Check: https://mypy.readthedocs.io/en/latest/config_file.html#import-discovery
follow_imports = 'silent'

[[tool.mypy.overrides]]
module = ["transformers.*", "datasets.*"]
ignore_missing_imports=true


[tool.ruff]
line-length = 88
indent-width = 4
exclude = ["build", "dist", "env", ".venv"]
lint.ignore = [

[tool.ruff.format]
quote-style = "double"
indent-style = "space"

[tool.ruff.lint]
ignore = [
"PLR0913",
"TCH001",
"COM812",
"ISC001",
"TCH002",
"PLW1514", # allow Path.open without encoding

]
lint.select = [
select = [
# Rules reference: https://docs.astral.sh/ruff/rules/

# Code Style / Formatting
Expand All @@ -127,11 +137,11 @@ lint.select = [
"Q", # flake8-quotes: enforces consistent use of single or double quotes
"TCH", # flake8-type-checking: enforces type checking practices and standards
"TID", # flake8-tidy-imports: enforces tidy and well-organized imports
"RUF022", # flake8-ruff: enforce sorting of __all__ in modules

# Code Structure / Complexity
"C4", # flake8-comprehensions: improves readability and performance of list, set, and dict comprehensions
"C90", # mccabe: checks for overly complex code using cyclomatic complexity
"FBT", # flake8-boolean-trap: prevents the use of boolean traps in function arguments and calls
"ISC", # flake8-implicit-str-concat: prevents implicit string concatenation
"PIE", # flake8-pie: identifies and corrects common code inefficiencies and mistakes
"R", # Refactor: suggests improvements to code structure and readability
Expand Down Expand Up @@ -164,7 +174,6 @@ lint.select = [
"tests/**/*.py" = [
"S101", # asserts allowed in tests
"ARG", # Unused function args allowed in tests
"FBT", # Booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
"PLR2004", # Magic value used in comparison
"TCH002", # No import only type checking in tests
"SLF001", # enable private member access in tests
Expand All @@ -173,8 +182,13 @@ lint.select = [
"PT011", # allow generic exceptions in tests
"N806", # allow uppercase variable names in tests
"PGH003", # allow general ignores in tests
"S106", # allow hardcoded passwords in tests
"PLR0915", # allow complext statements in tests
]

[tool.ruff.lint.isort]
known-first-party = ["guidellm", "tests"]


[tool.pytest.ini_options]
addopts = '-s -vvv --cache-clear'
Expand Down
13 changes: 12 additions & 1 deletion src/guidellm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,15 @@
evaluating and benchmarking large language models (LLMs).
"""

from .logger import configure_logger, logger # noqa: F401
import os

import transformers # type: ignore # noqa: PGH003

from .config import settings
from .logger import configure_logger, logger

__all__ = ["configure_logger", "logger", "settings"]


os.environ["TOKENIZERS_PARALLELISM"] = "false" # Silence warnings for tokenizers
transformers.logging.set_verbosity_error() # Silence warnings for transformers
Loading

0 comments on commit 8c25a1c

Please sign in to comment.