Skip to content

Commit

Permalink
chore(ci): black format (#28)
Browse files Browse the repository at this point in the history
单独分离 Lint 工作流
  • Loading branch information
Snoopy1866 authored Sep 23, 2024
1 parent d5bbdc9 commit cb3a0ac
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 19 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --diff --color --verbose"
6 changes: 1 addition & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint, Test and Report
name: Test and Report

on:
push:
Expand Down Expand Up @@ -30,10 +30,6 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Linter
run: |
black src --check --verbose
- name: Run Tests
run: |
pytest --cov --cov-report=xml
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
![PyPI - Status](https://img.shields.io/pypi/status/PyStatPower)
![PyPI - Downloads](https://img.shields.io/pypi/dw/pystatpower)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

PyStatPower 是一个专注于统计领域功效分析的开源的 Python 库。

主要功能:样本量和检验效能的计算,以及给定参数下估算所需效应量大小。
Expand Down
36 changes: 23 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ testpaths = [
]
pythonpath = ["src"]


# black configuration
[tool.black]
line-length = 120
target-version = [
"py310",
"py311",
"py312"
]
required-version = "24"


# build configuration
[build-system]
Expand All @@ -19,20 +27,13 @@ requires = [
build-backend = "setuptools.build_meta"

[project]
authors = [
{ name = "Snoopy1866", email = "[email protected]" }
]
dynamic = [
"version"
]
name = "pystatpower"
dependencies = [
"scipy"
]
requires-python = ">=3.10"
description = "A Power Analysis Toolkit for Python"
readme = { file = "README.md", content-type = "text/markdown" }
license = { text = "GPL-3.0" }
requires-python = ">=3.10"
authors = [
{ name = "Snoopy1866", email = "[email protected]" }
]
keywords = [
"power",
"power-analysis",
Expand All @@ -50,13 +51,22 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Mathematics"
]
dependencies = [
"scipy>=1.12.0"
]
readme = { file = "README.md", content-type = "text/markdown" }
dynamic = [
"version"
]

[tool.setuptools.dynamic]
version = { attr = "pystatpower.__version__" }

[project.urls]
Homepage = "https://github.com/PyStatPower/PyStatPower"
Documentation = "https://github.com/PyStatPower/PyStatPower/blob/main/README.md"
Repository = "https://github.com/PyStatPower/PyStatPower.git"
Issues = "https://github.com/PyStatPower/PyStatPower/issues"
Changelog = "https://github.com/PyStatPower/PyStatPower/blob/main/CHANGELOG.md"


[tool.setuptools.dynamic]
version = { attr = "pystatpower.__version__" }
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scipy>=1.12.0

black==24.8.0
black~=24.0
pytest==8.3.2
pytest-cov==5.0.0

0 comments on commit cb3a0ac

Please sign in to comment.