From b0fff4c63cb63744f0821c0b15470ad36ae95a92 Mon Sep 17 00:00:00 2001 From: Zac Bowling Date: Tue, 17 Dec 2024 17:33:46 -0800 Subject: [PATCH 1/5] Create python-publish.yml --- .github/workflows/python-publish.yml | 67 ++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..881d8a4 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,67 @@ +name: Build and upload to PyPI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # macos-13 is an intel runner, macos-14 is apple silicon + os: [ubuntu-latest, macos-13, macos-14] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.22.0 + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build sdist + run: pipx run build --sdist + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - name: Download artifacts from other jobs + uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - name: Publish to Pypi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From 20ddba0ee0775cb3b0b4e626bc3e35bcfd54dde0 Mon Sep 17 00:00:00 2001 From: Zac Bowling Date: Wed, 18 Dec 2024 08:47:44 -0800 Subject: [PATCH 2/5] Modernize setuptools --- pyproject.toml | 31 ++++++++++++++++++++++++++++++- setup.py | 45 ++------------------------------------------- 2 files changed, 32 insertions(+), 44 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2bf5ec8..1a74270 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,32 @@ [build-system] -requires = ["setuptools", "wheel", "Cython"] +requires = ["setuptools>=75.6.0", "wheel", "cython>=0.29"] build-backend = "setuptools.build_meta" + +[project] +name = "faster-fifo" +version = "1.4.7" +description = "A faster alternative to Python's standard multiprocessing.Queue (IPC FIFO queue)" +readme = {file = "README.md", content-type = "text/markdown"} +requires-python = ">=3.8" +license = {text = "MIT"} +authors = [ + {name = "Aleksei Petrenko"}, + {name = "Tushar Kumar"} +] +keywords = ["multiprocessing", "data structures"] +urls = { homepage = "https://github.com/alex-petrenko/faster-fifo" } + +[project.optional-dependencies] +dev = ["twine", "numpy>=1.18.1,<2.0"] + +[tool.setuptools] +ext-modules = [ + { name='faster_fifo', sources=['faster_fifo.pyx', 'cpp_faster_fifo/cpp_lib/faster_fifo.cpp'], language='c++', extra-compile-args=['-std=c++11'], include-dirs=['cpp_faster_fifo/cpp_lib']} +] + +[tool.setuptools.packages.find] +where = ["./"] +include = ["faster_fifo*"] + +[tool.cython] +language_level = 3 diff --git a/setup.py b/setup.py index 03ce1fd..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,44 +1,3 @@ -import setuptools -from Cython.Build import cythonize -from setuptools import setup, Extension +from setuptools import setup - -extensions = [ - Extension( - name='faster_fifo', - sources=['faster_fifo.pyx', 'cpp_faster_fifo/cpp_lib/faster_fifo.cpp'], - language='c++', - extra_compile_args=['-std=c++11'], - include_dirs=['cpp_faster_fifo/cpp_lib'], - ), -] - -with open('README.md', 'r') as fh: - long_description = fh.read() - -setup( - # Information - name='faster-fifo', - version='1.4.7', - url='https://github.com/alex-petrenko/faster-fifo', - author='Aleksei Petrenko & Tushar Kumar', - license='MIT', - keywords='multiprocessing data structures', - description='A faster alternative to Python\'s standard multiprocessing.Queue (IPC FIFO queue)', - long_description=long_description, - long_description_content_type='text/markdown', - - # Build instructions - ext_modules=cythonize(extensions), - install_requires=[ - 'setuptools>=45.2.0', - 'cython>=0.29' - ], - extras_require={ - 'dev': ['twine', 'numpy>=1.18.1,<2.0'], - }, - python_requires='>=3.6', - - packages=setuptools.find_packages(where='./', include='faster_fifo*'), - # install_requires=["pip>=19.3"], -) +setup() From 883546658d9db3acbff64e3c8a92ec503434eec6 Mon Sep 17 00:00:00 2001 From: Zac Bowling Date: Wed, 18 Dec 2024 09:03:37 -0800 Subject: [PATCH 3/5] Bump version number and dependabot warnings --- .github/dependabot.yml | 0 pyproject.toml | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 1a74270..4b57dde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "faster-fifo" -version = "1.4.7" +version = "1.5.0" description = "A faster alternative to Python's standard multiprocessing.Queue (IPC FIFO queue)" readme = {file = "README.md", content-type = "text/markdown"} -requires-python = ">=3.8" +requires-python = ">=3.9" license = {text = "MIT"} authors = [ {name = "Aleksei Petrenko"}, @@ -30,3 +30,7 @@ include = ["faster_fifo*"] [tool.cython] language_level = 3 + +[tool.cibuildwheel] +# Skip CPython 3.6, CPython 3.7, and CPython 3.8 +skip = ["cp36-*", "cp37-*", "cp38-*"] \ No newline at end of file From b5992b7dde0c0c852d099343c9c97e581e8f6e37 Mon Sep 17 00:00:00 2001 From: Zac Bowling Date: Wed, 18 Dec 2024 09:05:39 -0800 Subject: [PATCH 4/5] Update test-ci workflow to match current versions --- .github/dependabot.yml | 6 ++++++ .github/workflows/test-ci.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e69de29..ca79ca5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index fdeb527..bff30e6 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] os: ['ubuntu-latest', 'macos-latest'] runs-on: ${{ matrix.os }} steps: From 7aced4a70c4934da432cb1914dbe78f78be51990 Mon Sep 17 00:00:00 2001 From: Zac Bowling Date: Wed, 18 Dec 2024 09:15:05 -0800 Subject: [PATCH 5/5] Skip PyPy wheel builds --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4b57dde..d325332 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,4 +33,5 @@ language_level = 3 [tool.cibuildwheel] # Skip CPython 3.6, CPython 3.7, and CPython 3.8 -skip = ["cp36-*", "cp37-*", "cp38-*"] \ No newline at end of file +# Also skip PyPy on all Python versions because of setuptools bug +skip = ["cp36-*", "cp37-*", "cp38-*", "pp*"] \ No newline at end of file