diff --git a/.github/workflows/Pages.yml b/.github/workflows/Pages.yml index dd66784e..cc482129 100644 --- a/.github/workflows/Pages.yml +++ b/.github/workflows/Pages.yml @@ -20,26 +20,18 @@ jobs: build: runs-on: ubuntu-latest - env: - PYTHON_VER: "3.11" - steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup Python ${{ env.PYTHON_VER }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VER }} - - name: Install dependencies run: | - pip install -U pip -qq - pip install mkdocs-material mkdocstrings[python] -qq + pipx install pdm + pdm install -G doc --no-default --no-self - name: Build run: | - mkdocs build -d site -s + pdm run mkdocs build -d site -s - name: Upload Artifact uses: actions/upload-pages-artifact@v2 diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index 88f9afce..4d3b79d9 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -17,56 +17,53 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - - name: Install cibuildwheel - run: pip install cibuildwheel -qq - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse + uses: pypa/cibuildwheel@v2.15.0 env: - CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* pp38-* pp39-*" + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* pp38-* pp39-* pp310-*" CIBW_SKIP: "*-win32 *_i686 *_s390x *_ppc64le" - uses: actions/upload-artifact@v3 with: - name: dist path: ./wheelhouse/*.whl + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + publish: name: Publish - needs: build_wheels + needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: - name: publish + name: pypi - env: - PYTHON_VER: "3.11" + permissions: + id-token: write steps: - - name: Set up Python ${{ env.PYTHON_VER }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VER }} - - - name: Install dependencies - run: | - python -m pip install -U pip -qq - pip install -U twine -qq - - name: Download distributions uses: actions/download-artifact@v3 with: - name: dist + name: artifact path: dist - name: Publish to PyPI if: ${{ github.event_name == 'push' }} - run: twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} --disable-progress-bar + uses: pypa/gh-action-pypi-publish@release/v1 - name: Publish to TestPyPI if: ${{ github.event_name == 'workflow_dispatch' }} - run: twine upload -r testpypi dist/* -u __token__ -p ${{ secrets.TESTPYPI_TOKEN }} --disable-progress-bar + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.gitignore b/.gitignore index 17aaed5e..4730e97f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ !docs/** !tests !tests/** +!scripts +!scripts/** *.py[cd] __pycache__ diff --git a/README.md b/README.md index 86ee1647..b22db3a0 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ + + + +
diff --git a/aiotieba/__version__.py b/aiotieba/__version__.py index 975f6914..3bdbbae2 100644 --- a/aiotieba/__version__.py +++ b/aiotieba/__version__.py @@ -1 +1 @@ -__version__ = "3.7.1" +__version__ = "3.7.2" diff --git a/aiotieba/api/get_bawu_postlogs/_classdef.py b/aiotieba/api/get_bawu_postlogs/_classdef.py index 81bf8125..d03093a6 100644 --- a/aiotieba/api/get_bawu_postlogs/_classdef.py +++ b/aiotieba/api/get_bawu_postlogs/_classdef.py @@ -119,7 +119,7 @@ def __init__(self, data_tag: bs4.element.Tag) -> None: text_item = post_content_item.div self._text = text_item.string[12:] - self._medias = [Media_postlog(tag) for tag in text_item.next_sibling('a')] + self._medias = [Media_postlog(tag) for tag in text_item.next_sibling('a', class_=None)] op_type_item = left_cell_item.next_sibling self._op_type = op_type_item.string diff --git a/aiotieba/api/get_forum_detail/_classdef.py b/aiotieba/api/get_forum_detail/_classdef.py index 8e07a186..b3e89cd7 100644 --- a/aiotieba/api/get_forum_detail/_classdef.py +++ b/aiotieba/api/get_forum_detail/_classdef.py @@ -41,7 +41,7 @@ def __init__(self, data_proto: Optional[TypeMessage] = None) -> None: self._slogan = forum_proto.slogan self._member_num = forum_proto.member_count self._post_num = forum_proto.thread_count - self._has_bawu = bool(data_proto.election_tab.new_manager_status) + self._has_bawu = data_proto.election_tab.new_manager_status == 5 else: self._fid = 0 self._fname = '' diff --git a/aiotieba/const.py b/aiotieba/const.py index 18328a66..9b8ad1d7 100644 --- a/aiotieba/const.py +++ b/aiotieba/const.py @@ -1,4 +1,4 @@ -MAIN_VERSION = "12.45.7.0" +MAIN_VERSION = "12.46.3.0" POST_VERSION = "12.35.1.0" APP_SECURE_SCHEME = "https" diff --git a/aiotieba/helper/crypto/include/tbcrypto/_python.h b/aiotieba/helper/crypto/include/tbcrypto/pywrap.h similarity index 90% rename from aiotieba/helper/crypto/include/tbcrypto/_python.h rename to aiotieba/helper/crypto/include/tbcrypto/pywrap.h index 1640135a..7518799c 100644 --- a/aiotieba/helper/crypto/include/tbcrypto/_python.h +++ b/aiotieba/helper/crypto/include/tbcrypto/pywrap.h @@ -2,7 +2,9 @@ #define PY_SSIZE_T_CLEAN // use Py_ssize_t instead of int -#ifdef TBC_FORCE_PYTHON_NODEBUG +#ifdef TBC_PYTHON_DEBUG +#include