diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..af441f6 --- /dev/null +++ b/.github/workflows/black.yml @@ -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" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 542c865..355e5e5 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: Lint, Test and Report +name: Test and Report on: push: @@ -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 diff --git a/README.md b/README.md index 4379015..71d7587 100644 --- a/README.md +++ b/README.md @@ -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 库。 主要功能:样本量和检验效能的计算,以及给定参数下估算所需效应量大小。 diff --git a/pyproject.toml b/pyproject.toml index 89458a7..ea9c490 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] @@ -19,20 +27,13 @@ requires = [ build-backend = "setuptools.build_meta" [project] -authors = [ - { name = "Snoopy1866", email = "openpower2024@gmail.com" } -] -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 = "openpower2024@gmail.com" } +] keywords = [ "power", "power-analysis", @@ -50,9 +51,14 @@ 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" @@ -60,3 +66,7 @@ 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__" } diff --git a/requirements-dev.txt b/requirements-dev.txt index f63629d..774770c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ scipy>=1.12.0 -black==24.8.0 +black~=24.0 pytest==8.3.2 pytest-cov==5.0.0