Skip to content

Commit

Permalink
Update dependences; Support python^3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDing committed May 10, 2024
1 parent 543afbb commit 4a2d204
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 63 deletions.
41 changes: 16 additions & 25 deletions .github/workflows/main.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,48 @@
name: BaiduPCS-Py Build & Test

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master
- release/*

jobs:
build-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.12"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true

- name: Install dependencies
run: |
poetry run pip3 install setuptools
poetry install --no-root
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Format check with black
run: poetry run black --check .

- name: Typecheck at Windows
run: |
poetry run ruff check baidupcs_py
poetry run mypy -p baidupcs_py --ignore-missing-imports --warn-unreachable --implicit-optional --allow-redefinition --disable-error-code abstract --disable-error-code attr-defined
if: matrix.os == 'windows-latest'

- name: Typecheck at Linux
run: |
poetry run ruff check baidupcs_py
poetry run mypy -p baidupcs_py --ignore-missing-imports --warn-unreachable --implicit-optional --allow-redefinition --disable-error-code abstract
if: matrix.os == 'ubuntu-latest'

- name: Format check
run: poetry run ruff format --check .
- name: Typecheck
run: poetry run ruff check baidupcs_py
- name: Test with pytest
run: |
poetry run python build.py build_ext --inplace
poetry run pytest -s tests/test_common.py
poetry run pytest -v -s
- name: Test package
run: |
poetry build -f sdist
Expand Down
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
typecheck:
ruff check baidupcs_py
mypy -p baidupcs_py \
--ignore-missing-imports \
--warn-unreachable \
--implicit-optional \
--allow-redefinition \
--disable-error-code abstract

format-check:
black --check .
ruff format --check .

format:
black .
ruff format .

build-pyx:
python3 build.py build_ext --inplace
Expand Down
63 changes: 33 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,50 @@ classifiers = [
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
build = "build.py"

[tool.black]
line-length = 119

[tool.ruff]
lint.ignore = ["E501", "E402", "F401", "F403", "F841"]
line-length = 119

[tool.poetry.dependencies]
python = ">=3.7, <3.11"
requests = ">=2.28"
requests-toolbelt = ">=0.10"
rich = ">=12.6"
pillow = ">=9.3"
python = "^3.8"
requests = ">=2"
requests-toolbelt = ">=1.0"
rich = ">=13.7"
pillow = ">=10.1"
click = ">=8.1"
typing-extensions = ">=4.4"
aget = ">=0.1"
chardet = ">=5.0"
fastapi = ">=0.87"
uvicorn = ">=0.19"
typing-extensions = ">=4.8"
aget = ">=0.2"
chardet = ">=5.2"
fastapi = ">=0.104"
uvicorn = ">=0.24"
jinja2 = ">=3.1"
cryptography = ">=38.0"
cython = ">=0.29"
cryptography = ">=41.0"
cython = ">=3.0"
passlib = ">=1.7"

[tool.poetry.scripts]
BaiduPCS-Py = 'baidupcs_py.app:main'

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.2"
mypy = "^1.1.1"
black = "^23.1.0"
ruff = "^0.0.257"
setuptools = "^67.6.0"
cython = "^0.29.33"
pytest = ">=7.4"
ruff = ">=0.3"
setuptools = ">=69.0"
cython = ">=3.0"

[build-system]
requires = ["cython", "wheel", "setuptools"]
[tool.poetry.build]
script = "build.py"
generate-setup-file = true

[tool.black]
line-length = 119
[tool.poetry.scripts]
BaiduPCS-Py = 'baidupcs_py.app:main'

[tool.ruff]
ignore = ["E501", "F401", "F841", "E402"]
line-length = 119
[build-system]
requires = ["poetry-core", "cython", "wheel", "setuptools"]

0 comments on commit 4a2d204

Please sign in to comment.