diff --git a/.github/workflows/build-and-upload-to-pypi.yml b/.github/workflows/build-and-upload-to-pypi.yml new file mode 100644 index 0000000..4e96401 --- /dev/null +++ b/.github/workflows/build-and-upload-to-pypi.yml @@ -0,0 +1,66 @@ +name: Build and upload to PyPI + +on: + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # Windows builds currently broken + #os: [ubuntu-20.04, windows-2019, macos-11] + os: [ubuntu-20.04, macos-11] + + steps: + - uses: actions/checkout@v3 + + - name: Checkout submodules + shell: bash + run: | + git submodule sync --recursive + git submodule update --init --force --recursive --depth=1 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.11.2 + env: + CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014' + CIBW_ARCHS: auto64 + CIBW_BUILD: 'cp3*' + CIBW_SKIP: '*-musllinux_*' + + - uses: actions/upload-artifact@v3 + with: + 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 + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml deleted file mode 100644 index 4b37d77..0000000 --- a/.github/workflows/build-linux.yml +++ /dev/null @@ -1,162 +0,0 @@ -name: Build for Linux - -on: - - push - - pull_request - -jobs: - build_wheels: - name: Build wheel on Linux - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - name: Install Python 3.11 - with: - python-version: "3.11" - - - uses: actions/setup-python@v4 - name: Install Python 3.10 - with: - python-version: "3.10" - - - uses: actions/setup-python@v4 - name: Install Python 3.9 - with: - python-version: "3.9" - - - uses: actions/setup-python@v4 - name: Install Python 3.8 - with: - python-version: "3.8" - - - uses: actions/setup-python@v4 - name: Install Python 3.7 - with: - python-version: "3.7" - - - uses: actions/setup-python@v4 - name: Install Python 3.6 - with: - python-version: "3.6" - - - name: Install cibuildwheel - run: | - python -m pip install cibuildwheel==1.6.3 - - - name: Checkout submodules - shell: bash - run: | - git submodule sync --recursive - git submodule update --init --force --recursive --depth=1 - - - name: Install dependencies - run: | - pip install -r requirements-dev.txt - - - name: Test for Python 3.11 - run: | - tox -e py311 - - - name: Test for Python 3.10 - run: | - tox -e py310 - - - name: Test for Python 3.9 - run: | - tox -e py39 - - - name: Test for Python 3.8 - run: | - tox -e py38 - - - name: Test for Python 3.7 - run: | - tox -e py37 - - - name: Test for Python 3.6 - run: | - tox -e py36 - - - name: Build wheel - if: contains(github.ref, 'tags/') - run: | - python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* - - - uses: actions/upload-artifact@v1 - if: contains(github.ref, 'tags/') - with: - name: wheels - path: ./wheelhouse - - build_wheels_aarch64: - name: Build wheels on ${{ matrix.os }}, ${{ matrix.arch }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-18.04] - arch: [aarch64] - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v1 - name: Install Python 3.8 - with: - python-version: "3.8" - - - name: Install cibuildwheel - run: | - python -m pip install cibuildwheel~=1.8.0 - - - uses: docker/setup-qemu-action@v1 - name: Set up QEMU - - - name: Checkout submodules - shell: bash - run: | - git submodule sync --recursive - git submodule update --init --force --recursive --depth=1 - - - name: Build wheel - if: contains(github.ref, 'tags/') - run: | - python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* - CIBW_ARCHS_LINUX: ${{ matrix.arch }} - CIBW_BEFORE_BUILD: python -m pip install --upgrade pip - && python -m pip install tox - CIBW_TEST_REQUIRES: tox - CIBW_TEST_COMMAND: cd /project - && python -m pip install -r requirements-dev.txt - && /opt/python/*/bin/tox -e py - - - uses: actions/upload-artifact@v1 - if: contains(github.ref, 'tags/') - with: - name: wheels - path: ./wheelhouse - - upload_pypi: - name: 'Upload packages' - needs: ['build_wheels', 'build_wheels_aarch64'] - runs-on: 'ubuntu-latest' - if: contains(github.ref, 'tags/') - steps: - - uses: actions/download-artifact@v3 - name: 'Download artifacts' - with: - name: wheels - path: ./wheelhouse - - - uses: pypa/gh-action-pypi-publish@release/v1 - name: "Publish package to PyPI" - with: - user: '__token__' - password: '${{ secrets.PYPI_API_TOKEN }}' - packages_dir: ./wheelhouse diff --git a/.github/workflows/build-darwin.yml b/.github/workflows/test-darwin.yml similarity index 59% rename from .github/workflows/build-darwin.yml rename to .github/workflows/test-darwin.yml index b354285..5c771a1 100644 --- a/.github/workflows/build-darwin.yml +++ b/.github/workflows/test-darwin.yml @@ -1,4 +1,4 @@ -name: Build for macOS +name: Test for macOS on: - push @@ -37,14 +37,9 @@ jobs: with: python-version: "3.7" - - uses: actions/setup-python@v4 - name: Install Python 3.6 - with: - python-version: "3.6" - - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==1.6.3 + python -m pip install cibuildwheel==2.11.2 - name: Checkout submodules shell: bash @@ -76,38 +71,8 @@ jobs: run: | tox -e py37 - - name: Test for Python 3.6 - run: | - tox -e py36 - - name: Build wheel - if: contains(github.ref, 'tags/') run: | python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* - - - uses: actions/upload-artifact@v1 - if: contains(github.ref, 'tags/') - with: - name: wheels - path: ./wheelhouse - - upload_pypi: - name: 'Upload packages' - needs: ['build_wheels'] - runs-on: 'ubuntu-latest' - if: contains(github.ref, 'tags/') - steps: - - uses: actions/download-artifact@v3 - name: 'Download artifacts' - with: - name: wheels - path: ./wheelhouse - - - uses: pypa/gh-action-pypi-publish@release/v1 - name: "Publish package to PyPI" - with: - user: '__token__' - password: '${{ secrets.PYPI_API_TOKEN }}' - packages_dir: ./wheelhouse + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml new file mode 100644 index 0000000..c1e8edd --- /dev/null +++ b/.github/workflows/test-linux.yml @@ -0,0 +1,78 @@ +name: Test for Linux + +on: + - push + - pull_request + +jobs: + build_wheels: + name: Build wheel on Linux + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + name: Install Python 3.11 + with: + python-version: "3.11" + + - uses: actions/setup-python@v4 + name: Install Python 3.10 + with: + python-version: "3.10" + + - uses: actions/setup-python@v4 + name: Install Python 3.9 + with: + python-version: "3.9" + + - uses: actions/setup-python@v4 + name: Install Python 3.8 + with: + python-version: "3.8" + + - uses: actions/setup-python@v4 + name: Install Python 3.7 + with: + python-version: "3.7" + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==2.11.2 + + - name: Checkout submodules + shell: bash + run: | + git submodule sync --recursive + git submodule update --init --force --recursive --depth=1 + + - name: Install dependencies + run: | + pip install -r requirements-dev.txt + + - name: Test for Python 3.11 + run: | + tox -e py311 + + - name: Test for Python 3.10 + run: | + tox -e py310 + + - name: Test for Python 3.9 + run: | + tox -e py39 + + - name: Test for Python 3.8 + run: | + tox -e py38 + + - name: Test for Python 3.7 + run: | + tox -e py37 + + - name: Build wheel + run: | + python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* diff --git a/.github/workflows/build-windows.yml b/.github/workflows/test-windows.yml similarity index 69% rename from .github/workflows/build-windows.yml rename to .github/workflows/test-windows.yml index b4c1a67..762fdae 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/test-windows.yml @@ -1,4 +1,4 @@ -name: Build for windows +name: Test for Windows on: - push @@ -48,15 +48,9 @@ jobs: python-version: "3.7" architecture: ${{ matrix.config.py-architecture }} - - uses: actions/setup-python@v4 - name: Install Python 3.6 - with: - python-version: "3.6" - architecture: ${{ matrix.config.py-architecture }} - - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==1.6.3 + python -m pip install cibuildwheel==2.11.2 - name: Checkout submodules shell: bash @@ -98,40 +92,9 @@ jobs: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.config.vs-arch }} tox -e py37 - - name: Test for Python 3.6 - shell: cmd - run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.config.vs-arch }} - tox -e py36 - - name: Build wheel - if: contains(github.ref, 'tags/') run: | python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* - - - uses: actions/upload-artifact@v1 - if: contains(github.ref, 'tags/') - with: - name: wheels - path: ./wheelhouse - - upload_pypi: - name: 'Upload packages' - needs: ['build_wheels'] - runs-on: 'ubuntu-latest' - if: contains(github.ref, 'tags/') - steps: - - uses: actions/download-artifact@v3 - name: 'Download artifacts' - with: - name: wheels - path: ./wheelhouse - - - uses: pypa/gh-action-pypi-publish@release/v1 - name: "Publish package to PyPI" - with: - user: '__token__' - password: '${{ secrets.PYPI_API_TOKEN }}' - packages_dir: ./wheelhouse + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* + CIBW_ARCHS: auto64 diff --git a/setup.py b/setup.py index 8d6c2f1..bb49a2e 100644 --- a/setup.py +++ b/setup.py @@ -116,7 +116,7 @@ def read(f): name='faust-cchardet', author='PyYoshi', author_email='myoshi321go@gmail.com', - url=r'https://github.com/PyYoshi/cChardet', + url=r'https://github.com/faust-streaming/cChardet', description='cChardet is high speed universal character encoding detector.', long_description='\n\n'.join((read('README.rst'), read('CHANGES.rst'))), version=version, diff --git a/src/cchardet/version.py b/src/cchardet/version.py index d3a156b..3087de1 100644 --- a/src/cchardet/version.py +++ b/src/cchardet/version.py @@ -1 +1 @@ -__version__ = '2.1.9' +__version__ = '2.1.10'