Skip to content

Commit

Permalink
Merge pull request #9 from Everlaw/feature/publish-wheels
Browse files Browse the repository at this point in the history
Publish wheels
  • Loading branch information
kmurphy4 authored Oct 24, 2024
2 parents 0b6edfc + d0baf4c commit ae1631c
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 304 deletions.
9 changes: 9 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"schedule:weekly"
],
"timezone": "America/Los_Angeles",
"includePaths": [".github/**"]
}
165 changes: 0 additions & 165 deletions .github/workflows/build.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/build_freebsd.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/build_shared.yml

This file was deleted.

59 changes: 29 additions & 30 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
# Build wheel from source using tox.
name: build_wheel
on: [push, pull_request]
on: [push]
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'
runs-on: [self-hosted, libpff]
steps:
- uses: actions/checkout@v4
- 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
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- 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 && make sources >/dev/null
- name: Build Python wheel
- name: Create virtual environment
run: |
rm -rf venv
python3 -m venv venv
echo "$(pwd)/venv/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: |
python3 -m pip install \
'build' \
'mypy' \
'setuptools>=65' \
'wheel'
- name: Build libpff-python wheel
run: |
python3 -m build --no-isolation --outdir=dist --wheel
python3 -m pip install --no-index --find-links=dist libpff-python
python3 tests/runtests.py
- name: Build pypff-stubs wheel
working-directory: stubs
run: |
python3 -m build --outdir=dist --wheel
python3 -m pip install --no-index --find-links=dist pypff-stubs
mypy --strict -c 'import pypff; reveal_type(pypff.file)'
- name: Upload wheels
run: |
tox -e${{ matrix.toxenv }}
./upload-wheel.sh dist/libpff_python*.whl
./upload-wheel.sh stubs/dist/pypff_stubs*.whl
2 changes: 2 additions & 0 deletions stubs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
*.egg-info/
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class attachment(item):
### Methods
def __name__(self) -> str: ...

def __doc__(self) -> str: ...

def get_size(self) -> int:
"""
Retrieves the attachment data size.
Expand Down
5 changes: 2 additions & 3 deletions pypff-stubs/pypff/file.pyi → stubs/pypff-stubs/file.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Type stubs for pypff_file, defined in [1]
[1] https://github.com/Everlaw/libpff/blob/master/pypff/pypff_file.c
"""
from typing import Any
from typing import IO
from .folder import folder
from .item import item
Expand Down Expand Up @@ -46,8 +47,6 @@ class file:

def __name__(self) -> str: ...

def __doc__(self) -> str: ...

def signal_abort(self) -> None:
"""
Signals the file to abort the current activity.
Expand All @@ -58,7 +57,7 @@ class file:
Opens a file.
"""

def open_file_object(self, file_object: IO, mode: str = "r") -> None:
def open_file_object(self, file_object: IO[Any], mode: str = "r") -> None:
"""
Opens a file using a file-like object.
"""
Expand Down
3 changes: 0 additions & 3 deletions pypff-stubs/pypff/folder.pyi → stubs/pypff-stubs/folder.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Type stubs file for pypff_folder, defined in [1]
[1] https://github.com/Everlaw/libpff/blob/master/pypff/pypff_folder.c
"""
from .folder import folder
from .item import item
from .items import items
from .message import message
Expand All @@ -29,8 +28,6 @@ class folder(item):
### Methods
def __name__(self) -> str: ...

def __doc__(self) -> str: ...

def get_name(self) -> str:
"""
Retreives the name.
Expand Down
2 changes: 0 additions & 2 deletions pypff-stubs/pypff/item.pyi → stubs/pypff-stubs/item.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class item:

def __name__(self) -> str: ...

def __doc__(self) -> str: ...

def get_identifier(self) -> int:
"""
Retrieves the identifier.
Expand Down
2 changes: 0 additions & 2 deletions pypff-stubs/pypff/items.pyi → stubs/pypff-stubs/items.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ class items:
def __getitem__(self) -> item: ...

def __name__(self) -> str: ...

def __doc__(self) -> str: ...
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class message(item):
### Methods
def __name__(self) -> str: ...

def __doc__(self) -> str: ...

def get_subject(self) -> str:
"""
Retrieves the subject.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ class record_entries:
def __getitem__(self) -> record_entry: ...

def __name__(self) -> str: ...

def __doc__(self) -> str: ...
Loading

0 comments on commit ae1631c

Please sign in to comment.