Skip to content

Commit fcfb821

Browse files
authored
Merge pull request #30 from djhoese/build-overhaul
Switch build system to require Cython and build extensions on install
2 parents f28660d + 1abc1a1 commit fcfb821

24 files changed

+394
-31422
lines changed

.github/workflows/ci.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
continue-on-error: ${{ matrix.experimental }}
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
13+
python-version: ["3.7", "3.8"]
14+
experimental: [false]
15+
include:
16+
- python-version: "3.8"
17+
os: "ubuntu-latest"
18+
experimental: true
19+
20+
env:
21+
PYTHON_VERSION: ${{ matrix.python-version }}
22+
OS: ${{ matrix.os }}
23+
UNSTABLE: ${{ matrix.experimental }}
24+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
25+
26+
steps:
27+
- name: Checkout source
28+
uses: actions/checkout@v2
29+
30+
- name: Setup Conda Environment
31+
uses: conda-incubator/setup-miniconda@v2
32+
with:
33+
miniconda-version: "latest"
34+
python-version: ${{ matrix.python-version }}
35+
mamba-version: "*"
36+
channels: conda-forge,defaults
37+
environment-file: continuous_integration/environment.yaml
38+
activate-environment: test-environment
39+
40+
- name: Install unstable dependencies
41+
if: matrix.experimental == true
42+
shell: bash -l {0}
43+
run: |
44+
python -m pip install \
45+
-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \
46+
--no-deps --pre --upgrade \
47+
matplotlib \
48+
numpy \
49+
pandas \
50+
scipy; \
51+
python -m pip install \
52+
--no-deps --upgrade \
53+
git+https://github.com/dask/dask \
54+
git+https://github.com/dask/distributed \
55+
git+https://github.com/zarr-developers/zarr \
56+
git+https://github.com/pydata/bottleneck \
57+
git+https://github.com/pydata/xarray;
58+
59+
- name: Install geotiepoints
60+
shell: bash -l {0}
61+
run: |
62+
pip install -e .
63+
64+
- name: Run unit tests
65+
shell: bash -l {0}
66+
run: |
67+
pytest --cov=geotiepoints geotiepoints/tests --cov-report=xml --cov-report=
68+
69+
# FIXME: These fail
70+
# - name: Test website
71+
# shell: bash -l {0}
72+
# run: |
73+
# cd doc && mkdir doctest && sphinx-build -E -n -b doctest ./source ./doctest && cd ..
74+
75+
- name: Upload unittest coverage to Codecov
76+
uses: codecov/codecov-action@v1
77+
with:
78+
flags: unittests
79+
file: ./coverage.xml
80+
env_vars: OS,PYTHON_VERSION,UNSTABLE
81+
82+
- name: Coveralls Parallel
83+
uses: AndreMiras/coveralls-python-action@develop
84+
with:
85+
flag-name: run-${{ matrix.test_number }}
86+
parallel: true
87+
if: runner.os == 'Linux'
88+
89+
coveralls:
90+
needs: [test]
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: Coveralls Finished
94+
uses: AndreMiras/coveralls-python-action@develop
95+
with:
96+
parallel-finished: true
97+

.github/workflows/deploy.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Deploy sdist and wheels
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
release:
8+
types:
9+
- published
10+
11+
jobs:
12+
build_sdist:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout source
16+
uses: actions/checkout@v2
17+
18+
- name: Create sdist
19+
shell: bash -l {0}
20+
run: |
21+
pip install -q build
22+
python -m build -s
23+
24+
- name: Upload sdist to build artifacts
25+
uses: actions/upload-artifact@v2
26+
with:
27+
name: sdist
28+
path: dist/*.tar.gz
29+
30+
31+
build_wheels:
32+
runs-on: ${{ matrix.os }}
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os: [windows-latest, macos-latest]
37+
python-version: [3.6, 3.7, 3.8, 3.9]
38+
include:
39+
# Using pythons inside a docker image to provide all the Linux
40+
# python-versions permutations.
41+
- name: manylinux 64-bit
42+
os: ubuntu-latest
43+
python-version: 3.8
44+
docker-image: manylinux1_x86_64
45+
- name: manylinux 32-bit
46+
os: ubuntu-latest
47+
python-version: 3.8
48+
docker-image: manylinux1_i686
49+
50+
steps:
51+
- uses: actions/checkout@v2
52+
- run: |
53+
git fetch --prune --unshallow
54+
55+
- name: Set up Python ${{ matrix.python-version }}
56+
uses: actions/setup-python@v1
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
60+
- name: Install dependencies
61+
run: |
62+
python -m pip install -U -q pip Cython wheel setuptools twine numpy build
63+
64+
- name: Build and install macOS/Windows wheel
65+
if: matrix.os != 'ubuntu-latest'
66+
# see https://setuptools.readthedocs.io/en/latest/build_meta.html
67+
run: |
68+
python -m build
69+
pip install --find-links=./dist/ python-geotiepoints
70+
71+
- name: Build Linux wheels inside docker
72+
if: matrix.os == 'ubuntu-latest'
73+
run: |
74+
docker run \
75+
-e PLAT=${{ matrix.docker-image }} \
76+
-e USE_OMP=1 \
77+
-v `pwd`:/io \
78+
quay.io/pypa/${{ matrix.docker-image }} \
79+
/io/continuous_integration/build-manylinux-wheels.sh
80+
81+
- name: Upload wheel(s) as build artifacts
82+
uses: actions/upload-artifact@v2
83+
with:
84+
name: wheels
85+
path: dist/*.whl
86+
87+
upload_test_pypi:
88+
needs: [build_sdist, build_wheels]
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Download sdist artifact
92+
uses: actions/download-artifact@v2
93+
with:
94+
name: sdist
95+
path: dist
96+
- name: Download wheels artifact
97+
uses: actions/download-artifact@v2
98+
with:
99+
name: wheels
100+
path: dist
101+
- name: Publish package to PyPI
102+
uses: pypa/gh-action-pypi-publish@v1.4.1
103+
with:
104+
user: __token__
105+
password: ${{ secrets.test_pypi_password }}
106+
repository_url: https://test.pypi.org/legacy/
107+
108+
upload_pypi:
109+
needs: [build_sdist, build_wheels]
110+
runs-on: ubuntu-latest
111+
steps:
112+
- name: Download sdist artifact
113+
uses: actions/download-artifact@v2
114+
with:
115+
name: sdist
116+
path: dist
117+
- name: Download wheels artifact
118+
uses: actions/download-artifact@v2
119+
with:
120+
name: wheels
121+
path: dist
122+
- name: Publish package to PyPI
123+
if: github.event.action == 'published'
124+
uses: pypa/gh-action-pypi-publish@v1.4.1
125+
with:
126+
user: __token__
127+
password: ${{ secrets.pypi_password }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ pip-log.txt
2525

2626
#Mr Developer
2727
.mr.developer.cfg
28+
29+
# Don't include the C files in the repository
30+
geotiepoints/*.c

.travis.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
include docs/Makefile
2-
recursive-include docs/source *
1+
include doc/Makefile
2+
recursive-include doc/source *
33
include LICENSE.txt
44
include geotiepoints/multilinear_cython.pyx
55
include versioneer.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
python-geotiepoints
22
===================
33

4-
[![Build Status](https://travis-ci.org/pytroll/python-geotiepoints.svg?branch=master)](https://travis-ci.org/pytroll/python-geotiepoints)
4+
[![Build Status](https://github.com/pytroll/python-geotiepoints/workflows/CI/badge.svg?branch=master)](https://github.com/pytroll/python-geotiepoints/actions?query=workflow%3A%22CI%22)
55
[![Coverage Status](https://coveralls.io/repos/github/pytroll/python-geotiepoints/badge.svg?branch=master)](https://coveralls.io/github/pytroll/python-geotiepoints?branch=master)
66
[![Code Health](https://landscape.io/github/pytroll/python-geotiepoints/master/landscape.svg?style=flat)](https://landscape.io/github/pytroll/python-geotiepoints/master)
77

RELEASING.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,35 @@
22

33
prerequisites: `pip install loghub setuptools twine`
44

5-
65
1. checkout master
76
2. pull from repo
87
3. run the unittests
98
4. run `loghub` and update the `CHANGELOG.md` file:
109

1110
```
12-
loghub pytroll/python-geotiepoints -u <username> -st v1.1.6 -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes"
11+
loghub pytroll/python-geotiepoints --token $LOGHUB_GITHUB_TOKEN -st v0.8.0 -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes -plg backwards-incompatibility "Backward incompatible changes" -plg refactor "Refactoring"
1312
```
1413

14+
This uses a `LOGHUB_GITHUB_TOKEN` environment variable. This must be created
15+
on GitHub and it is recommended that you add it to your `.bashrc` or
16+
`.bash_profile` or equivalent.
17+
1518
Don't forget to commit!
1619

1720
5. Create a tag with the new version number, starting with a 'v', eg:
1821

1922
```
20-
git tag v0.22.45
23+
git tag -a v0.22.45 -m "Version 0.22.45"
2124
```
2225

2326
See [semver.org](http://semver.org/) on how to write a version number.
2427

25-
26-
2728
6. push changes to github `git push --follow-tags`
28-
7. Verify travis tests passed and deployed sdist and wheel to PyPI
29+
7. Verify github action unittests passed.
30+
8. Create a "Release" on GitHub by going to
31+
https://github.com/pytroll/python-geotiepoints/releases and clicking "Draft a new release".
32+
On the next page enter the newly created tag in the "Tag version" field,
33+
"Version X.Y.Z" in the "Release title" field, and paste the markdown from
34+
the changelog (the portion under the version section header) in the
35+
"Describe this release" box. Finally click "Publish release".
36+
9. Verify the GitHub actions for deployment succeed and the release is on PyPI.

appveyor.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)