Skip to content

Commit

Permalink
[build] Move setup.cfg into pyproject.toml using ini2toml
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmlnkn committed Sep 16, 2024
1 parent f060afb commit 15db35c
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 93 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/wheels-rapidgzip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ jobs:
CIBW_BEFORE_ALL_LINUX: "uname -a; apk add nasm"
CIBW_BUILD_VERBOSITY: 2
CIBW_BUILD: "*musllinux*"
# Skip Python 3.6 because it is EOL and because pyproject.toml requires setuptools > 61,
# which is only available for Python >= 3.7.
CIBW_SKIP: "*cp36-*"

run: python -m cibuildwheel --output-dir dist python/rapidgzip

Expand All @@ -107,7 +110,9 @@ jobs:
brew install nasm;
export PATH="$PATH:/usr/local/bin"
CIBW_BUILD_VERBOSITY: 2
CIBW_SKIP: "*musllinux*"
# Skip Python 3.6 because it is EOL and because pyproject.toml requires setuptools > 61,
# which is only available for Python >= 3.7.
CIBW_SKIP: "*{cp36-,musllinux}*"

run: python -m cibuildwheel --output-dir dist python/rapidgzip

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
env:
CIBW_ARCHS: ${{ matrix.archs }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux-image }}
# Skip Python 3.6 because it is EOL and because pyproject.toml requires setuptools > 61,
# which is only available for Python >= 3.7.
CIBW_SKIP: "*cp36-*"
run: python -m cibuildwheel --output-dir dist python/indexed_bzip2

- name: Check Wheels
Expand Down
49 changes: 48 additions & 1 deletion python/indexed_bzip2/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,53 @@
[build-system]
# Use setuptools >= 43 because it automatically includes pyproject.toml in source distribution
# Use setuptools >= 46.5 to use attr: package.__version__
# Use setuptools >= 61 for pyproject.toml support
# Use setuptools < 72 because of this: https://github.com/pypa/distutils/issues/283
# https://setuptools.readthedocs.io/en/latest/history.html#id284
requires = ["setuptools >= 46.4.0, < 72", "wheel", "cython >= 0.29.24"]
requires = ["setuptools >= 61.2, < 72", "wheel", "cython >= 0.29.24"]

[project]
name = "indexed_bzip2"
version = "1.6.0"
description = "Fast random access to bzip2 files"
authors = [{name = "Maximilian Knespel", email = "mxmlnkn@github.de"}]
license = {text = "MIT"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: C++",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Archiving",
"Topic :: System :: Archiving :: Compression",
]
urls = {Homepage = "https://github.com/mxmlnkn/indexed_bzip2"}
requires-python = ">= 3.7"

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.scripts]
ibzip2 = "indexed_bzip2:cli"

[tool.setuptools]
py-modules = ["indexed_bzip2"]
license-files = [
"LICENSE-APACHE",
"LICENSE-MIT",
]
45 changes: 0 additions & 45 deletions python/indexed_bzip2/setup.cfg

This file was deleted.

50 changes: 49 additions & 1 deletion python/rapidgzip/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,59 @@
[build-system]
# Use setuptools >= 43 because it automatically includes pyproject.toml in source distribution
# Use setuptools >= 46.5 to use attr: package.__version__
# Use setuptools >= 61 for pyproject.toml support
# Use setuptools < 72 because of this: https://github.com/pypa/distutils/issues/283
# Use setuptools < 74 because of removed msvccompiler:
# https://github.com/pypa/setuptools/issues/4612
# https://github.com/pypa/setuptools/issues/3532
# https://github.com/pypa/setuptools/pull/3505
# https://github.com/zhisong/pyoculus/issues/10
# https://setuptools.readthedocs.io/en/latest/history.html#id284
requires = ["setuptools >= 46.4.0, < 72", "wheel", "cython >= 0.29.24"]
requires = ["setuptools >= 61.2, < 72", "wheel", "cython >= 0.29.24"]
build-backend = "setuptools.build_meta"

[project]
name = "rapidgzip"
version = "0.14.2"
description = "Parallel random access to gzip files"
authors = [{name = "Maximilian Knespel", email = "mxmlnkn@github.de"}]
license = {text = "MIT"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Development Status :: 3 - Alpha",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: C++",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Archiving",
"Topic :: System :: Archiving :: Compression",
]
urls = {Homepage = "https://github.com/mxmlnkn/rapidgzip"}
requires-python = ">= 3.7"

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.scripts]
rapidgzip = "rapidgzip:cli"

[tool.setuptools]
py-modules = ["rapidgzip"]
license-files = [
"LICENSE-APACHE",
"LICENSE-MIT",
]
45 changes: 0 additions & 45 deletions python/rapidgzip/setup.cfg

This file was deleted.

3 changes: 3 additions & 0 deletions python/rapidgzip/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from setuptools.extension import Extension
from setuptools.command.build_ext import build_ext

# For nasm_extension, which is in the same folder as this setup.py during the build process.
sys.path.append(os.path.dirname(__file__))

# This fallback is only for jinja, which is used by conda to analyze this setup.py before any build environment
# is set up.
try:
Expand Down

0 comments on commit 15db35c

Please sign in to comment.