Переглянути джерело

Merge pull request #400 from jangop/patch-1

Update dependencies
Daniel Gatis 2 роки тому
батько
коміт
3dea620428
5 змінених файлів з 27 додано та 25 видалено
  1. 6 2
      .github/workflows/lint_python.yml
  2. 1 1
      pyproject.toml
  3. 0 2
      rembg/bg.py
  4. 1 1
      rembg/cli.py
  5. 19 19
      setup.py

+ 6 - 2
.github/workflows/lint_python.yml

@@ -6,9 +6,13 @@ jobs:
     lint_python:
         runs-on: ubuntu-latest
         steps:
-            - uses: actions/checkout@v2
-            - uses: actions/setup-python@v2
+            - uses: actions/checkout@v3
+            - uses: actions/setup-python@v3
+              with:
+                python-version: "3.10"
             - run: pip install --upgrade pip wheel
+            - run: pip install --upgrade setuptools>65.5.0
+            - run: pip install .
             - run: pip install bandit black flake8 flake8-bugbear flake8-comprehensions isort safety mypy
             - run: mypy --install-types --non-interactive --ignore-missing-imports ./rembg
             - run: bandit --recursive --skip B101,B104,B310,B311,B303 --exclude ./rembg/_version.py ./rembg

+ 1 - 1
pyproject.toml

@@ -1,7 +1,7 @@
 [build-system]
 # These are the assumed default build requirements from pip:
 # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
-requires = ["setuptools>=40.8.0", "wheel"]
+requires = ["setuptools>=65.5.1", "wheel"]
 build-backend = "setuptools.build_meta"
 
 [versioneer]

+ 0 - 2
rembg/bg.py

@@ -37,7 +37,6 @@ def alpha_matting_cutout(
     background_threshold: int,
     erode_structure_size: int,
 ) -> PILImage:
-
     if img.mode == "RGBA" or img.mode == "CMYK":
         img = img.convert("RGB")
 
@@ -116,7 +115,6 @@ def remove(
     only_mask: bool = False,
     post_process_mask: bool = False,
 ) -> Union[bytes, PILImage, np.ndarray]:
-
     if isinstance(data, PILImage):
         return_type = ReturnType.PILLOW
         img = data

+ 1 - 1
rembg/cli.py

@@ -435,6 +435,6 @@ def s(port: int, log_level: str, threads: int) -> None:
         ),
         commons: CommonQueryPostParams = Depends(),
     ):
-        return await asyncify(im_without_bg)(file, commons)
+        return await asyncify(im_without_bg)(file, commons)  # type: ignore
 
     uvicorn.run(app, host="0.0.0.0", port=port, log_level=log_level)

+ 19 - 19
setup.py

@@ -37,24 +37,24 @@ setup(
     packages=["rembg"],
     python_requires=">3.7, <3.11",
     install_requires=[
-        "aiohttp~=3.8.1",
-        "asyncer~=0.0.2",
-        "click~=8.1.3",
-        "fastapi~=0.87.0",
-        "filetype~=1.2.0",
-        "pooch~=1.6.0",
-        "imagehash~=4.3.1",
-        "numpy~=1.23.5",
-        "onnxruntime~=1.13.1",
-        "opencv-python-headless~=4.6.0.66",
-        "pillow~=9.3.0",
-        "pymatting~=1.1.8",
-        "python-multipart~=0.0.5",
-        "scikit-image~=0.19.3",
-        "scipy~=1.9.3",
-        "tqdm~=4.64.1",
-        "uvicorn~=0.20.0",
-        "watchdog~=2.1.9",
+        "aiohttp>=3.8.1",
+        "asyncer>=0.0.2",
+        "click>=8.1.3",
+        "fastapi>=0.92.0",
+        "filetype>=1.2.0",
+        "pooch>=1.6.0",
+        "imagehash>=4.3.1",
+        "numpy>=1.23.5",
+        "onnxruntime>=1.13.1",
+        "opencv-python-headless>=4.6.0.66",
+        "pillow>=9.3.0",
+        "pymatting>=1.1.8",
+        "python-multipart>=0.0.5",
+        "scikit-image>=0.19.3",
+        "scipy>=1.9.3",
+        "tqdm>=4.64.1",
+        "uvicorn>=0.20.0",
+        "watchdog>=2.1.9",
     ],
     entry_points={
         "console_scripts": [
@@ -62,7 +62,7 @@ setup(
         ],
     },
     extras_require={
-        "gpu": ["onnxruntime-gpu~=1.13.1"],
+        "gpu": ["onnxruntime-gpu>=1.13.1"],
     },
     version=versioneer.get_version(),
     cmdclass=versioneer.get_cmdclass(),