mirror of
https://github.com/ZGCA-Forge/Elevator.git
synced 2026-02-04 21:35:17 +00:00
Update ci
This commit is contained in:
143
pyproject.toml
143
pyproject.toml
@@ -1,45 +1,56 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
|
||||
requires = ["setuptools>=61.0", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "elevator-saga"
|
||||
name = "elevatorpy"
|
||||
dynamic = ["version"]
|
||||
description = "Python implementation of Elevator Saga game with PyEE event system"
|
||||
readme = "README_CN.md"
|
||||
license = {text = "MIT"}
|
||||
description = "Python implementation of Elevator Saga game with event system"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
license = {file = "LICENSE"}
|
||||
authors = [
|
||||
{name = "Elevator Saga Team"},
|
||||
{name = "ZGCA-Forge Team", email = "zgca@zgca.com"}
|
||||
]
|
||||
keywords = ["elevator", "simulation", "game", "event-driven", "optimization"]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
"Intended Audience :: Education",
|
||||
"Intended Audience :: Education",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Topic :: Games/Entertainment :: Simulation",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
]
|
||||
requires-python = ">=3.12"
|
||||
|
||||
dependencies = [
|
||||
"pyee>=11.0.0",
|
||||
"numpy>=1.20.0",
|
||||
"matplotlib>=3.5.0",
|
||||
"seaborn>=0.11.0",
|
||||
"pandas>=1.3.0",
|
||||
"flask",
|
||||
"flask>=2.0.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=6.0",
|
||||
"pytest-cov",
|
||||
"black",
|
||||
"flake8",
|
||||
"isort",
|
||||
"mypy",
|
||||
"pytest>=7.0.0",
|
||||
"pytest-cov>=4.0.0",
|
||||
"black>=22.0.0",
|
||||
"isort>=5.0.0",
|
||||
"mypy>=1.0.0",
|
||||
"flake8>=6.0.0",
|
||||
"pre-commit>=2.20.0",
|
||||
"bump2version>=1.0.0",
|
||||
]
|
||||
docs = [
|
||||
"sphinx>=5.0.0",
|
||||
"sphinx-rtd-theme>=1.0.0",
|
||||
"myst-parser>=0.18.0",
|
||||
]
|
||||
all = [
|
||||
"elevatorpy[dev,docs]",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
@@ -50,66 +61,38 @@ elevator-grader = "elevator_saga.grader.grader:main"
|
||||
elevator-batch-test = "elevator_saga.grader.batch_runner:main"
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/yourusername/elevator-saga"
|
||||
Issues = "https://github.com/yourusername/elevator-saga/issues"
|
||||
|
||||
[tool.setuptools_scm]
|
||||
write_to = "elevator_saga/_version.py"
|
||||
Homepage = "https://github.com/ZGCA-Forge/Elevator"
|
||||
Documentation = "https://zgca-forge.github.io/Elevator/"
|
||||
Repository = "https://github.com/ZGCA-Forge/Elevator"
|
||||
Issues = "https://github.com/ZGCA-Forge/Elevator/issues"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["."]
|
||||
include = ["elevator_saga*"]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "elevator_saga.__version__"}
|
||||
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
target-version = ['py312']
|
||||
include = '\.pyi?$'
|
||||
extend-exclude = '''
|
||||
/(
|
||||
# directories
|
||||
\.eggs
|
||||
| \.git
|
||||
| \.hg
|
||||
| \.mypy_cache
|
||||
| \.tox
|
||||
| \.venv
|
||||
| _build
|
||||
| buck-out
|
||||
| build
|
||||
| dist
|
||||
)/
|
||||
'''
|
||||
target-version = ['py310', 'py311', 'py312']
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
line_length = 120
|
||||
multi_line_output = 3
|
||||
include_trailing_comma = true
|
||||
force_grid_wrap = 0
|
||||
use_parentheses = true
|
||||
ensure_newline_before_comments = true
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.12"
|
||||
python_version = "3.10"
|
||||
warn_return_any = true
|
||||
warn_unused_configs = true
|
||||
disallow_untyped_defs = true
|
||||
disallow_incomplete_defs = true
|
||||
check_untyped_defs = true
|
||||
disallow_untyped_decorators = true
|
||||
no_implicit_optional = true
|
||||
warn_redundant_casts = true
|
||||
warn_unused_ignores = true
|
||||
warn_no_return = true
|
||||
warn_unreachable = true
|
||||
strict_equality = true
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
"pyee.*",
|
||||
"matplotlib.*",
|
||||
"seaborn.*",
|
||||
"pandas.*",
|
||||
"numpy.*",
|
||||
"flask.*",
|
||||
]
|
||||
@@ -117,38 +100,20 @@ ignore_missing_imports = true
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
python_files = ["test_*.py", "*_test.py"]
|
||||
python_classes = ["Test*"]
|
||||
python_functions = ["test_*"]
|
||||
addopts = [
|
||||
"--strict-markers",
|
||||
"--strict-config",
|
||||
"--verbose",
|
||||
]
|
||||
markers = [
|
||||
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
||||
"integration: marks tests as integration tests",
|
||||
python_files = "test_*.py"
|
||||
python_classes = "Test*"
|
||||
python_functions = "test_*"
|
||||
addopts = "-v --tb=short --strict-markers --strict-config -ra --color=yes"
|
||||
|
||||
filterwarnings = [
|
||||
"ignore::DeprecationWarning",
|
||||
"ignore::PendingDeprecationWarning",
|
||||
]
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["elevator_saga"]
|
||||
omit = [
|
||||
"*/tests/*",
|
||||
"*/test_*",
|
||||
"*/__pycache__/*",
|
||||
"*/.*",
|
||||
]
|
||||
|
||||
[tool.coverage.report]
|
||||
exclude_lines = [
|
||||
"pragma: no cover",
|
||||
"def __repr__",
|
||||
"if self.debug:",
|
||||
"if settings.DEBUG",
|
||||
"raise AssertionError",
|
||||
"raise NotImplementedError",
|
||||
"if 0:",
|
||||
"if __name__ == .__main__.:",
|
||||
"class .*\\bProtocol\\):",
|
||||
"@(abc\\.)?abstractmethod",
|
||||
]
|
||||
[tool.bandit]
|
||||
exclude_dirs = ["tests", "test_*.py", "*_test.py", ".venv", "venv", "build", "dist"]
|
||||
# B101: assert语句用于类型检查和开发时验证,不是安全问题
|
||||
# B601: shell命令参数化,在受控环境中使用
|
||||
# B310: urllib.urlopen用于连接受控的API服务器,URL来源可信
|
||||
# B311: random模块用于生成电梯流量模拟数据,非加密用途
|
||||
skips = ["B101", "B601", "B310", "B311"]
|
||||
|
||||
Reference in New Issue
Block a user