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

Introducing github actions (based on travis.yml) #256

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish Python distributions to PyPI and TestPyPI
env:
BOOST_PYTHON_LIB: boost_python
BOOST_SYSTEM_LIB: boost_system
BOOST_THREAD_LIB: boost_thread
MASON_BUILD: true
CCACHE_TEMPDIR: /tmp/.ccache-temp
CCACHE_COMPRESS: 1
PYTHONUSERBASE: $(pwd)/mason_packages/.link
PYTHONPATH: $(pwd)/mason_packages/.link/lib/python2.7/site-packages
on: [push, pull_request]
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
python-version:
- "2.7"
- "3.6"
- "3.8"
system:
- ubuntu-18.04
- ubuntu-20.04
runs-on: ${{matrix.system}}
name: Build and publish Python distribution
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Git Sumbodule Update
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: install dependencies
run: |
sudo apt-get install libboost-python-dev python3-cairo-dev python-cairo-dev clang postgresql
- name: Initialize Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Build binary wheel and a source tarball
run: |
pip install wheel pycairo nose PyPDF2
python setup.py sdist bdist_wheel
- name: Run tests
run: |
source scripts/setup_mason.sh
export PATH=$(pwd)/mason_packages/.link/bin:${PYTHONUSERBASE}/bin:${PATH}
mkdir -p ${PYTHONPATH}
python setup.py install --prefix ${PYTHONUSERBASE}
source mason-config.env
./mason_packages/.link/bin/postgres -k ${PGHOST} > postgres.log &
python test/run_tests.py
python test/visual.py -q
./mason_packages/.link/bin/pg_ctl -w stop
- uses: actions/upload-artifact@v3
with:
name: python_${{ matrix.python-version }}-${{matrix.system}}
path: ./dist/*.whl
93 changes: 0 additions & 93 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

[![Build Status](https://travis-ci.org/mapnik/python-mapnik.svg)](https://travis-ci.org/mapnik/python-mapnik)
[![Build Status](https://github.com/raven-wing/python-mapnik/actions/workflows/build.yml/badge.svg)](https://github.com/raven-wing/python-mapnik/actions)

Python bindings for Mapnik.

Expand Down
2 changes: 1 addition & 1 deletion src/mapnik_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#define PYCAIRO_NO_IMPORT
#include <py3cairo.h>
#else
#include <pycairo.h>
#include <pycairo/pycairo.h>
#endif
#include <cairo.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/mapnik_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void clear_cache()
#if PY_MAJOR_VERSION >= 3
#include <py3cairo.h>
#else
#include <pycairo.h>
#include <pycairo/pycairo.h>
static Pycairo_CAPI_t *Pycairo_CAPI;
#endif

Expand Down