diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 4838754..d468d15 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.x' - name: Install dependencies @@ -22,44 +22,18 @@ jobs: run: | python setup.py sdist - build-manylinux: + build-wheels: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel - pip install -r dev-requirements.txt - - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' - system-packages: 'libdrm-devel' - build-requirements: 'cython' - - build-musllinux: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel - pip install -r dev-requirements.txt - - name: Build musllinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.7.1-musllinux_1_1_x86_64 - with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' - pre-build-command: 'apk add libdrm-dev' - build-requirements: 'cython' + pip install cibuildwheel==2.16.2 + - name: Build Python wheels + run: python -m cibuildwheel --output-dir wheelhouse diff --git a/.github/workflows/python-deploy.yml b/.github/workflows/python-deploy.yml index 57954e8..09a2a49 100644 --- a/.github/workflows/python-deploy.yml +++ b/.github/workflows/python-deploy.yml @@ -9,9 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.x' - name: Install dependencies @@ -27,70 +27,35 @@ jobs: mkdir output cp dist/*.tar.gz output - name: Publish - uses: pypa/gh-action-pypi-publish@v1.8.6 + uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: output/ - deploy-manylinux: + deploy-wheels: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine - pip install -r dev-requirements.txt - - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' - system-packages: 'libdrm-devel' - build-requirements: 'cython' + pip install cibuildwheel==2.16.2 + - name: Build Python wheels + run: python -m cibuildwheel --output-dir wheelhouse - name: Copy files run: | mkdir output - cp dist/*-manylinux*.whl output + cp wheelhouse/*.whl output - name: Publish - uses: pypa/gh-action-pypi-publish@v1.8.6 + uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: output/ - deploy-musllinux: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - pip install -r dev-requirements.txt - - name: Build musllinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.7.1-musllinux_1_1_x86_64 - with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' - pre-build-command: 'apk add libdrm-dev' - build-requirements: 'cython' - - name: Copy files - run: | - mkdir output - cp dist/*-musllinux*.whl output - - name: Publish - uses: pypa/gh-action-pypi-publish@v1.8.6 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - packages-dir: output/ diff --git a/README.md b/README.md index 3b2819f..20c6c8e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Only Linux is supported, using the AMDGPU driver. The library is written using Cython, meaning that Cython and and a C compiler are needed to build and install from source. Additionally, libdrm development headers are required. -Precompiled wheels for Python 3.7-3.11 are the default method of install. This means that you don't need Cython or any other dependencies to install it normally. +Precompiled wheels for Python 3.8-3.12 are the default method of install. This means that you don't need Cython or any other dependencies to install it normally. ## Usage diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6f5d724 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = ["setuptools", "wheel", "cython>=3"] +build-backend = "setuptools.build_meta" + +[tool.cibuildwheel.linux] +archs = ["x86_64"] \ No newline at end of file diff --git a/setup.py b/setup.py index 06d8733..3a8d512 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ long_description_content_type="text/markdown", url="https://github.com/mark9064/pyamdgpuinfo", packages=setuptools.find_packages(), - python_requires=">=3.7", + python_requires=">=3.8", ext_modules=cythonize(EXTENSIONS, language_level="3str"), zip_safe=False, classifiers=[