Skip to content

Commit

Permalink
Applied updates and changes for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Oct 22, 2023
1 parent 6ca131f commit c983c1e
Show file tree
Hide file tree
Showing 18 changed files with 471 additions and 414 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Build wheel from source using tox.
name: build_wheel
on: [push, pull_request]
permissions: read-all
jobs:
build_wheel:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- python-version: '3.7'
toxenv: 'py37'
- python-version: '3.8'
toxenv: 'py38'
- python-version: '3.9'
toxenv: 'py39'
- python-version: '3.10'
toxenv: 'py310'
- python-version: '3.11'
toxenv: 'py311'
- python-version: '3.12'
toxenv: 'py312'
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo add-apt-repository universe &&
sudo add-apt-repository -y ppa:deadsnakes/ppa &&
sudo apt-get update &&
sudo apt-get install -y autoconf automake autopoint build-essential git libtool pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools
- name: Install tox
run: |
python3 -m pip install tox
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- name: Prepare build
run: |
./synclibs.sh --use-head && ./autogen.sh && ./configure
- name: Build Python wheel
run: |
tox -e${{ matrix.toxenv }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Files to ignore by git
#
# Version: 20230405
# Version: 20230926

# Generic auto-generated build files
*~
Expand All @@ -25,10 +25,13 @@
*.swp
*.Tpo
*.trs
*.whl
/*.egg-info/
__pycache__
.deps
.dirstamp
.libs
.tox
INSTALL
Makefile
Makefile.bcc
Expand Down Expand Up @@ -125,6 +128,7 @@ stamp-h[1-9]
/libpff/libpff.rc
/libpff/libpff_definitions.h
/pypff-python[23]/*.[ch]
/setup.cfg
/jpff/classnoinst.stamp
/pfftools/*.exe
/pfftools/pffexport
Expand Down
13 changes: 13 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,24 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
HOMEBREW_NO_INSTALL_CLEANUP: 1
CC: clang
CFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CONFIGURE_OPTIONS: ""
- TARGET: macos-x64-gcc
BUILD_ENVIRONMENT: xcode
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
HOMEBREW_NO_INSTALL_CLEANUP: 1
CC: gcc
CFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CONFIGURE_OPTIONS: ""
- TARGET: macos-x64-gcc-python
BUILD_ENVIRONMENT: xcode
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
PYTHON: "/usr/local/opt/[email protected]/bin/python3"
PYTHON_CONFIG: "/usr/local/opt/[email protected]/bin/python3-config"
HOMEBREW_NO_INSTALL_CLEANUP: 1
CC: gcc
CFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CONFIGURE_OPTIONS: "--enable-python"
Expand All @@ -105,6 +111,7 @@ environment:
PYTHON: "/usr/local/opt/[email protected]/bin/python3"
PYTHON_CONFIG: "/usr/local/opt/[email protected]/bin/python3-config"
HOMEBREW_NO_INSTALL_CLEANUP: 1
CC: gcc
CFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CONFIGURE_OPTIONS: "--disable-dependency-tracking --prefix=/usr/local --enable-python --with-pyprefix"
Expand Down Expand Up @@ -140,6 +147,12 @@ environment:
HOMEBREW_NO_INSTALL_CLEANUP: 1
PYTHON_VERSION: 3.11
TOXENV: py311
- TARGET: macos-tox-py312
BUILD_ENVIRONMENT: python-tox
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
HOMEBREW_NO_INSTALL_CLEANUP: 1
PYTHON_VERSION: 3.12
TOXENV: py312
- TARGET: cygwin64-gcc
BUILD_ENVIRONMENT: cygwin64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libpff],
[20230906],
[20231022],
[[email protected]])

AC_CONFIG_SRCDIR(
Expand Down Expand Up @@ -219,6 +219,7 @@ AC_CONFIG_FILES([dpkg/changelog])
AC_CONFIG_FILES([libpff/libpff.rc])
AC_CONFIG_FILES([libpff.pc])
AC_CONFIG_FILES([libpff.spec])
AC_CONFIG_FILES([setup.cfg])
dnl Generate a source configuration file
AC_CONFIG_HEADERS([common/config.h])

Expand Down
10 changes: 5 additions & 5 deletions m4/python.m4
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
dnl Functions for Python bindings
dnl
dnl Version: 20211114
dnl Version: 20230923

dnl Function to check if the python binary is available
dnl "python${PYTHON_VERSION} python python# python#.#"
AC_DEFUN([AX_PROG_PYTHON],
[AS_IF(
[test "x${PYTHON_VERSION}" != x],
[ax_python_progs="python${PYTHON_VERSION}"],
[ax_python_progs="python python3 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5"])
[ax_python_progs="python python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5"])
AC_CHECK_PROGS(
[PYTHON],
[$ax_python_progs])
Expand Down Expand Up @@ -58,7 +58,7 @@ AC_DEFUN([AX_PROG_PYTHON2],
dnl Function to check if the python3 binary is available
dnl "python3 python3.#"
AC_DEFUN([AX_PROG_PYTHON3],
[ax_python3_progs="python3 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"
[ax_python3_progs="python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"
AC_CHECK_PROGS(
[PYTHON3],
[$ax_python3_progs])
Expand Down Expand Up @@ -95,7 +95,7 @@ AC_DEFUN([AX_PROG_PYTHON_CONFIG],
[test "x${PYTHON_CONFIG}" = x],
[AC_CHECK_PROGS(
[PYTHON_CONFIG],
[python-config python3-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config python2-config python2.7-config python2.6-config python2.5-config])
[python-config python3-config python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config python2-config python2.7-config python2.6-config python2.5-config])
])
AS_IF(
[test "x${PYTHON_CONFIG}" = x],
Expand Down Expand Up @@ -131,7 +131,7 @@ AC_DEFUN([AX_PROG_PYTHON3_CONFIG],
[test "x${PYTHON3_CONFIG}" = x],
[AC_CHECK_PROGS(
[PYTHON3_CONFIG],
[python3-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config])
[python3-config python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config])
])
AS_IF(
[test "x${PYTHON3_CONFIG}" = x],
Expand Down
6 changes: 3 additions & 3 deletions pypff/pypff_file_object_io_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ int pypff_file_object_io_handle_free(
Py_DecRef(
( *file_object_io_handle )->file_object );

PyGILState_Release(
gil_state );

PyMem_Free(
*file_object_io_handle );

*file_object_io_handle = NULL;

PyGILState_Release(
gil_state );
}
return( 1 );
}
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

13 changes: 13 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
[metadata]
name = libpff-python
version = 20231022
description = Python bindings module for libpff
long_description = Python bindings module for libpff
author = Joachim Metz
author_email = [email protected]
license = GNU Lesser General Public License v3 or later (LGPLv3+)
license_files = COPYING COPYING.LESSER
classifiers =
Development Status :: 3 - Alpha
Programming Language :: Python

[options]
python_requires = >=3.7
15 changes: 15 additions & 0 deletions setup.cfg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[metadata]
name = libpff-python
version = @VERSION@
description = Python bindings module for libpff
long_description = Python bindings module for libpff
author = Joachim Metz
author_email = [email protected]
license = GNU Lesser General Public License v3 or later (LGPLv3+)
license_files = COPYING COPYING.LESSER
classifiers =
Development Status :: 3 - Alpha
Programming Language :: Python

[options]
python_requires = >=3.7
Loading

0 comments on commit c983c1e

Please sign in to comment.