From 63bfc5a5b4c3a0338a035a01f938a1e70f45701c Mon Sep 17 00:00:00 2001 From: New Future Date: Wed, 14 Feb 2024 17:01:18 +0800 Subject: [PATCH] V3 (#423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix lint * 主版本移除python2支持 --- .github/workflows/build.yml | 7 +------ README.md | 2 +- run.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8d88ce2..053227d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,7 @@ jobs: # fail-fast: false matrix: os: [windows, macos, ubuntu] - python-version: ["2.7", "3.x"] + python-version: ["3.x"] runs-on: ${{ matrix.os }}-latest timeout-minutes: 8 steps: @@ -71,7 +71,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - if: matrix.python-version != '2.7' run: pip install pyinstaller # Prepare build version and cert @@ -85,17 +84,13 @@ jobs: - run: python ./run.py -h - name: Package binary - if: matrix.python-version != '2.7' run: python -O -m PyInstaller --noconfirm --clean .build/ddns.spec - run: ./dist/ddns || test -e config.json - if: matrix.python-version != '2.7' - run: ./dist/ddns -h - if: matrix.python-version != '2.7' # Upload build result - uses: actions/upload-artifact@v3 - if: matrix.python-version != '2.7' with: name: ${{ matrix.os }}-py${{ matrix.python-version }} path: dist/ diff --git a/README.md b/README.md index 296da247..303d89d5 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ - 兼容和跨平台: - [x] 可执行文件(无需 python 环境) - [x] 多系统兼容 ![cross platform](https://img.shields.io/badge/platform-windows_%7C%20linux_%7C%20osx-success.svg?style=social) - - [x] python2 和 python3 支持 ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ddns.svg?style=social) + - [x] python3 支持 ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ddns.svg?style=social)(2.x支持python2和python3) - [x] PIP 安装 ![PyPI - Wheel](https://img.shields.io/pypi/wheel/ddns.svg?style=social) - [x] Docker 支持(@NN708) - 域名支持: diff --git a/run.py b/run.py index 1773433c..5a707082 100755 --- a/run.py +++ b/run.py @@ -41,7 +41,7 @@ def get_ip(ip_type, index="default"): """ if index is False: # disabled return False - elif type(index) == list: # 如果获取到的规则是列表,则依次判断列表中每一个规则,直到找到一个可以正确获取到的IP + elif type(index) is list: # 如果获取到的规则是列表,则依次判断列表中每一个规则,直到找到一个可以正确获取到的IP value = None for i in index: value = get_ip(ip_type, i) diff --git a/setup.py b/setup.py index f808a93f..5c06ce07 100644 --- a/setup.py +++ b/setup.py @@ -135,7 +135,7 @@ # that you indicate whether you support Python 2, Python 3 or both. # These classifiers are *not* checked by 'pip install'. See instead # 'python_requires' below. - 'Programming Language :: Python :: 2.7', + # 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', ],