Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: ship with built-in FreeImage #3

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
75bc34a
MAINT: library and dependencies compile
FirefoxMetzger Jul 29, 2022
fb504f2
MAINT: project links
FirefoxMetzger Jul 29, 2022
ec0679a
MAINT: remove download freeimage functions
FirefoxMetzger Jul 29, 2022
d7a81fc
DEV: ignore build folder
FirefoxMetzger Jul 29, 2022
e11e377
MAINT: download source automatically
FirefoxMetzger Jul 29, 2022
99df82b
MAINT: cleaning up the repo
FirefoxMetzger Jul 29, 2022
71e2bba
DEV: only include freeimage during wheel builds
FirefoxMetzger Jul 29, 2022
88c7e97
MAINT: add linux binary location+name
FirefoxMetzger Jul 30, 2022
f546b63
MAINT: compile on linux
FirefoxMetzger Jul 30, 2022
a6f88f4
DEV: wheelbuilder action
FirefoxMetzger Aug 1, 2022
f0524a0
MAINT: cleanup linux build
FirefoxMetzger Aug 1, 2022
f168487
Merge branch 'master' into build-freeimage
FirefoxMetzger Aug 1, 2022
303923b
DEV: skip py3.6 (permanent) and osx (for now)
FirefoxMetzger Aug 1, 2022
35c07c1
MAINT: use relative path to download FreeImage
FirefoxMetzger Aug 2, 2022
5aeac69
BUG: download freeimage in build_clib not develop
FirefoxMetzger Aug 2, 2022
b2fbdb6
DEV: don't run on macOS for now
FirefoxMetzger Aug 2, 2022
0621475
DEV: don't repair wheel on linux
FirefoxMetzger Aug 2, 2022
c7f5aca
DEV: temporarily build on linux only
FirefoxMetzger Aug 2, 2022
f09d913
DEV: temporarily remove unit tests
FirefoxMetzger Aug 2, 2022
6382517
DEV: linux builds work, go fix windows
FirefoxMetzger Aug 2, 2022
c3da8f9
MAINT: switch windows build config to dicts
FirefoxMetzger Aug 2, 2022
8606043
DEV: turn on whell building debug
FirefoxMetzger Aug 2, 2022
d90108b
BUG: glob doesn't work if folder doesn't exist x)
FirefoxMetzger Oct 6, 2022
e5f6715
DEV: enable linux and windows builds
FirefoxMetzger Oct 6, 2022
abfaf7f
FEAT: begin macOS builds
FirefoxMetzger Oct 6, 2022
5fbef84
FEAT: begin CD pipeline
FirefoxMetzger Oct 8, 2022
5bd4ee6
BUG: fix syntax error
FirefoxMetzger Oct 8, 2022
67a0223
BUG: add missing config element
FirefoxMetzger Oct 8, 2022
bf80e1f
MAINT: try publishing wheels
FirefoxMetzger Oct 8, 2022
9dabc71
MAINT: bump version to test CD
FirefoxMetzger Oct 8, 2022
9e4c96e
MAINT: reformat pypi credentials
FirefoxMetzger Oct 8, 2022
1a53a98
MAINT: register pypi token
FirefoxMetzger Oct 8, 2022
dcc71a8
MAINT: check poetry version
FirefoxMetzger Oct 8, 2022
89e9438
MAINT: temporarily skip artifact fetching
FirefoxMetzger Oct 8, 2022
7170d13
MAINT: display poetry version
FirefoxMetzger Oct 8, 2022
8aa9e4f
BUG: undo temporary changes
FirefoxMetzger Oct 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CD

# This action builds FreeImage for various distributions, collects the resulting
# wheels, and publishes them to pypi

on:
workflow_dispatch:


jobs:
wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.8.1

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp36-*"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""

- uses: actions/upload-artifact@v3
with:
name: wheelhouse
path: ./wheelhouse/*.whl

deploy:
needs: wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: True
virtualenvs-in-project: True

- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: wheelhouse
path: ./dist/

- name: Publish Wheels
run : |
poetry config pypi-token.pypi ${{ secrets.PYPI_ACCOUNT }}
poetry publish
131 changes: 81 additions & 50 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,59 +36,90 @@ jobs:
linters: flake8
run: flake8 .

cpython:
name: "${{ matrix.os }} / CPython ${{ matrix.pyversion }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
pyversion: ["3.7", "3.8", "3.9", "3.10"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.pyversion }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyversion }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: True
virtualenvs-in-project: True
- name: Install Project
shell: bash
run: |
poetry install --no-interaction -v
- name: Run Tests
run: |
source $VENV
pytest -v --github-username "anything" --github-token ${{ secrets.GITHUB_TOKEN }}
# cpython:
# name: "${{ matrix.os }} / CPython ${{ matrix.pyversion }}"
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: true
# matrix:
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# pyversion: ["3.7", "3.8", "3.9", "3.10"]
# defaults:
# run:
# shell: bash
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 2
# - name: Set up Python ${{ matrix.pyversion }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.pyversion }}
# - name: Install Poetry
# uses: snok/install-poetry@v1
# with:
# virtualenvs-create: True
# virtualenvs-in-project: True
# - name: Install Project
# shell: bash
# run: |
# poetry install --no-interaction -v
# - name: Run Tests
# run: |
# source $VENV
# pytest -v --github-username "anything" --github-token ${{ secrets.GITHUB_TOKEN }}

# pypy:
# name: "${{ matrix.os }} / ${{ matrix.pyversion }}"
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: true
# matrix:
# os: ["ubuntu-latest", "macos-latest"]
# pyversion: ["pypy-3.7", "pypy-3.8", "pypy-3.9"]
# steps:
# - uses: actions/checkout@v2
# - name: Set up pypy
# uses: actions/setup-python@v2
# with:
# python-version: "${{ matrix.pyversion }}"
# - name: Install Poetry & Project
# shell: bash
# run: |
# pypy3 -m pip install poetry
# pypy3 -m poetry config virtualenvs.in-project true
# pypy3 -m poetry install --no-interaction -v
# - name: Run Unit tests
# run: |
# pypy3 -m poetry run pytest -v --github-username "anything" --github-token ${{ secrets.GITHUB_TOKEN }}

pypy:
name: "${{ matrix.os }} / ${{ matrix.pyversion }}"
wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest"]
pyversion: ["pypy-3.7", "pypy-3.8", "pypy-3.9"]
os: [macos-11]

steps:
- uses: actions/checkout@v2
- name: Set up pypy
uses: actions/setup-python@v2
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.8.1

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp36-*"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
# CIBW_BUILD_VERBOSITY: 3
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v3
with:
python-version: "${{ matrix.pyversion }}"
- name: Install Poetry & Project
shell: bash
run: |
pypy3 -m pip install poetry
pypy3 -m poetry config virtualenvs.in-project true
pypy3 -m poetry install --no-interaction -v
- name: Run Unit tests
run: |
pypy3 -m poetry run pytest -v --github-username "anything" --github-token ${{ secrets.GITHUB_TOKEN }}
name: wheelhouse
path: ./wheelhouse/*.whl
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.venv/
.vscode/
.test_images/
**/__pycache__/
dist/
FreeImage/
build/
*.egg-info/
imageio_freeimage/_lib/

*.pyc
poetry.lock
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,5 @@ their python code in a browser via pyodide. Those use-cases are more prone to
problems when ctypes are involved and having them in a dedicated optional
dependency make this situation easier.

3. Having a dedicated repo for the FreeImage plugin will eventually allow us to
install the FreeImage library at install time, instead of having to ask users to
perform post-install steps to download the library. This might also have
positive implications on platform availability and introspection as we can
eventually compile FreeImage while building the package.
3. We can add plumbing to compile FreeImage in CD and ship it precompiled
without the need for any post-install actions.
Loading