Skip to content

Commit

Permalink
Merge branch 'pytroll:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
benburrill authored Apr 13, 2023
2 parents 4ce50c7 + aa0d0e8 commit 5671e66
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 177 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
push:
branches: [main, "maint/*"]
pull_request:
branches: [main, "maint/*"]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
BUILDMODE: [CIBUILDWHEEL, ASTROPY]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: Set up QEMU
if: ${{ matrix.os == 'ubuntu-latest' && matrix.BUILDMODE == 'CIBUILDWHEEL' }}
id: qemu
uses: docker/setup-qemu-action@v1

- name: Setup Conda Environment
if: ${{ matrix.BUILDMODE == 'ASTROPY' }}
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
python-version: ${{ matrix.python-version }}
environment-file: ci/environment.yaml
activate-environment: test-environment

- name: Run tests
if: ${{ matrix.BUILDMODE == 'ASTROPY' }}
shell: bash -l {0}
run: |
pip install -e .
python selftest.py
- name: Build wheel
if: ${{ matrix.BUILDMODE == 'CIBUILDWHEEL' }}
env:
CIBW_TEST_COMMAND: python {project}/selftest.py
CIBW_BEFORE_BUILD_LINUX: yum install -y freetype-devel
CIBW_SKIP: pp* *-musllinux*
CIBW_TEST_REQUIRES: numpy pillow pytest
CIBW_ARCHS_LINUX: auto aarch64
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
- name: upload
if: ${{ matrix.BUILDMODE == 'CIBUILDWHEEL' }}
uses: actions/upload-artifact@v2
with:
name: wheelhouse
path: "wheelhouse/*.whl"

publish:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: sdist
run: python setup.py sdist

- name: download
uses: actions/download-artifact@v2

- name: Install dependencies
run: python -m pip install twine

- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine upload --skip-existing dist/*.tar.gz
python -m twine upload --skip-existing wheelhouse/*.whl
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# The aggdraw Library

## Version 1.3.13

- Rebuild for python 3.10 wheels and switch to GitHub Actions

## Version 1.3.12

- Rebuild for python 3.8 wheels

## Version 1.3.11

- Force rebuild to fix freetype linking in OSX wheels
Expand Down
12 changes: 7 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
The aggdraw module
==================

.. image:: https://travis-ci.org/pytroll/aggdraw.svg?branch=main
:target: https://travis-ci.org/pytroll/aggdraw

.. image:: https://ci.appveyor.com/api/projects/status/9g7qt1kitwxya7u4/branch/main?svg=true
:target: https://ci.appveyor.com/project/pytroll/aggdraw/branch/main
.. image:: https://github.com/pytroll/aggdraw/workflows/CI/badge.svg?branch=main
:target: https://github.com/pytroll/aggdraw/actions?query=workflow%3A%22CI%22

----------------------------------------------------------------------
agg 2.4 notes
----------------------------------------------------------------------

aggdraw was ported to agg 2.4 and extended by

Dov Grobgeld <[email protected]>
2016-05-30 Mon

This port is planned for released as 1.4.0, but currently produces different
results from previous versions and the causes of these differences have not
been tracked down.

----------------------------------------------------------------------
Original README
----------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion aggdraw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
#define M_PI 3.1415926535897931
#endif

#define PY_SSIZE_T_CLEAN 1

#include "Python.h"
#if PY_MAJOR_VERSION >= 3
#define IS_PY3K
Expand Down Expand Up @@ -1605,7 +1607,8 @@ const char *draw_frombytes_doc = "Copies data from a string buffer to the drawin
static PyObject*
draw_frombytes(DrawObject* self, PyObject* args)
{
char* data = NULL; int data_size;
char* data = NULL;
Py_ssize_t data_size;
if (!PyArg_ParseTuple(args, "s#:frombytes", &data, &data_size))
return NULL;

Expand Down
56 changes: 0 additions & 56 deletions appveyor.yml

This file was deleted.

6 changes: 0 additions & 6 deletions ci/appveyor-twine.ps1

This file was deleted.

7 changes: 7 additions & 0 deletions ci/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: test-environment
channels:
- conda-forge
dependencies:
- numpy
- pillow
- pytest
38 changes: 0 additions & 38 deletions ci/travis-build.sh

This file was deleted.

14 changes: 0 additions & 14 deletions ci/travis-install.sh

This file was deleted.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["packaging", "setuptools"]
build-backend = "setuptools.build_meta"
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
import sys
import subprocess
import platform
from distutils.sysconfig import get_config_var
from distutils.version import LooseVersion
from sysconfig import get_config_var

try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
from packaging.version import Version
from setuptools import setup, Extension

VERSION = "1.3.12"
VERSION = "1.3.13"

SUMMARY = "High quality drawing interface for PIL."

Expand All @@ -48,9 +45,12 @@ def is_platform_mac():
# MACOSX_DEPLOYMENT_TARGET before calling setup.py
if is_platform_mac():
if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ:
current_system = LooseVersion(platform.mac_ver()[0])
python_target = LooseVersion(get_config_var('MACOSX_DEPLOYMENT_TARGET'))
if python_target < '10.9' and current_system >= '10.9':
current_system = Version(platform.mac_ver()[0])
python_target = Version(get_config_var('MACOSX_DEPLOYMENT_TARGET'))
if (
python_target < Version('10.9') and
current_system >= Version('10.9')
):
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'


Expand Down

0 comments on commit 5671e66

Please sign in to comment.