Skip to content

Commit 0286df3

Browse files
authored
Automatisation de la production de wheels (#1)
Passage de l'intégration continue à Github
1 parent 0de2d9b commit 0286df3

File tree

11 files changed

+436
-34
lines changed

11 files changed

+436
-34
lines changed

.github/workflows/build-conda.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Use Setup-Miniconda From Marketplace
2+
on: [push]
3+
4+
jobs:
5+
miniconda:
6+
name: Miniconda ${{ matrix.os }}
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: ["ubuntu-latest", "windows-latest"]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: conda-incubator/setup-miniconda@v2
14+
with:
15+
activate-environment: test
16+
environment-file: requirements.txt
17+
python-version: 3.8
18+
auto-activate-base: false
19+
- shell: bash -l {0}
20+
run: |
21+
conda info
22+
conda list
23+
- name: Conda build
24+
run: |
25+
conda install conda-build
26+
conda develop .
27+
# conda build recipe
28+
# - name: Lint
29+
# shell: bash -l {0}
30+
# run: |
31+
# conda install flake8
32+
# python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
33+
# python -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
# - name: Run pytest
35+
# shell: bash -l {0}
36+
# run: |
37+
# conda install pytest
38+
# pytest
39+
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
name: Build wheels and archive (Pypy approach)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- v[0-9]+.[0-9]+.x
8+
- build-anaconda
9+
tags:
10+
- v*
11+
12+
13+
jobs:
14+
build_linux_37_and_above_wheels:
15+
name: Build python ${{ matrix.cibw_python }} wheels on ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-18.04]
21+
cibw_python: [ "cp37-*", "cp38-*", "cp39-*" ]
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
- uses: actions/setup-python@v2
27+
name: Install Python
28+
with:
29+
python-version: '3.7'
30+
- name: Set up QEMU
31+
uses: docker/setup-qemu-action@v1
32+
with:
33+
platforms: arm64
34+
- name: Install cibuildwheel
35+
run: |
36+
python -m pip install --upgrade pip
37+
python -m pip install -r requirements.txt
38+
python -m pip install cibuildwheel
39+
- name: Build the wheel
40+
run: |
41+
python -m cibuildwheel --output-dir dist
42+
env:
43+
CIBW_BUILD: ${{ matrix.cibw_python }}
44+
CIBW_ARCHS_LINUX: auto aarch64
45+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
46+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
47+
# CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
48+
# CIBW_TEST_COMMAND: pytest --pyargs skimage
49+
- uses: actions/upload-artifact@v2
50+
with:
51+
name: wheels
52+
path: ./dist/*.whl
53+
54+
build_macos_wheels:
55+
name: Build wheels on ${{ matrix.os }}
56+
runs-on: ${{ matrix.os }}
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
os: [macos-latest]
61+
62+
steps:
63+
- uses: actions/checkout@v2
64+
with:
65+
fetch-depth: 0
66+
67+
- uses: actions/setup-python@v2
68+
name: Install Python
69+
with:
70+
python-version: '3.7'
71+
72+
- name: Install cibuildwheel
73+
run: |
74+
python -m pip install cibuildwheel
75+
- name: Build wheels for CPython 3.9 and Mac OS
76+
run: |
77+
brew install libomp
78+
python -m cibuildwheel --output-dir dist
79+
env:
80+
CIBW_BUILD: "cp39-*"
81+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
82+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
83+
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.3
84+
CC: /usr/bin/clang
85+
CXX: /usr/bin/clang++
86+
CPPFLAGS: "-Xpreprocessor -fopenmp"
87+
CFLAGS: "-Wno-implicit-function-declaration -I/usr/local/opt/libomp/include"
88+
CXXFLAGS: "-I/usr/local/opt/libomp/include"
89+
LDFLAGS: "-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
90+
# CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
91+
# CIBW_TEST_COMMAND: pytest --pyargs skimage
92+
93+
- name: Build wheels for CPython (MacOS)
94+
if: matrix.os == 'macos-latest'
95+
run: |
96+
brew install libomp
97+
python -m cibuildwheel --output-dir dist
98+
env:
99+
CIBW_BUILD: "cp3?-*"
100+
CIBW_SKIP: "cp35-* cp36-* cp39-*"
101+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
102+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
103+
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.16
104+
CC: /usr/bin/clang
105+
CXX: /usr/bin/clang++
106+
CPPFLAGS: "-Xpreprocessor -fopenmp"
107+
CFLAGS: "-Wno-implicit-function-declaration -I/usr/local/opt/libomp/include"
108+
CXXFLAGS: "-I/usr/local/opt/libomp/include"
109+
LDFLAGS: "-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
110+
# CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
111+
# CIBW_TEST_COMMAND: pytest --pyargs skimage
112+
113+
- name: Build wheels for CPython 3.6
114+
run: |
115+
python -m cibuildwheel --output-dir dist
116+
env:
117+
CIBW_BUILD: "cp36-*"
118+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
119+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
120+
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.16
121+
if: >
122+
startsWith(github.ref, 'refs/heads/v0.17') ||
123+
startsWith(github.ref, 'refs/tags/v0.17')
124+
- uses: actions/upload-artifact@v2
125+
with:
126+
name: wheels
127+
path: ./dist/*.whl
128+
129+
build_windows_wheels:
130+
name: Build wheels on ${{ matrix.os }}
131+
runs-on: ${{ matrix.os }}
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
os: [windows-latest]
136+
137+
steps:
138+
- uses: actions/checkout@v2
139+
with:
140+
fetch-depth: 0
141+
142+
- uses: actions/setup-python@v2
143+
name: Install Python
144+
with:
145+
python-version: '3.7'
146+
147+
- name: Install cibuildwheel
148+
run: |
149+
python -m pip install cibuildwheel
150+
- name: Build wheels for CPython 3.9 (Linux and Windows)
151+
run: |
152+
python -m cibuildwheel --output-dir dist
153+
env:
154+
CIBW_BUILD: "cp39-*"
155+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
156+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
157+
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.3
158+
# CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
159+
# CIBW_TEST_COMMAND: pytest --pyargs skimage
160+
161+
- name: Build Windows wheels for CPython
162+
run: |
163+
python -m cibuildwheel --output-dir dist
164+
env:
165+
CIBW_BUILD: "cp3?-*"
166+
CIBW_SKIP: "cp35-* cp36-* cp39-*"
167+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
168+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
169+
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.16
170+
# CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
171+
# CIBW_TEST_COMMAND: pytest --pyargs skimage
172+
173+
- name: Build wheels for CPython 3.6
174+
run: |
175+
python -m cibuildwheel --output-dir dist
176+
env:
177+
CIBW_BUILD: "cp36-*"
178+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
179+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
180+
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.16
181+
if: >
182+
startsWith(github.ref, 'refs/heads/v0.17') ||
183+
startsWith(github.ref, 'refs/tags/v0.17')
184+
- uses: actions/upload-artifact@v2
185+
with:
186+
name: wheels
187+
path: ./dist/*.whl
188+
189+
190+
build_sdist:
191+
name: Build source distribution
192+
runs-on: ubuntu-latest
193+
strategy:
194+
matrix:
195+
python-version: [3.5, 3.6, 3.7, 3.8]
196+
steps:
197+
- uses: actions/checkout@v2
198+
199+
- uses: actions/setup-python@v2
200+
name: Install Python
201+
with:
202+
python-version: ${{ matrix.python-version }}
203+
204+
- name: Install cibuildwheel
205+
run: |
206+
python -m pip install --upgrade pip
207+
python -m pip install -r requirements.txt
208+
python -m pip install cibuildwheel
209+
pip install --upgrade cython
210+
211+
- name: Build sdist
212+
run: python setup.py sdist
213+
214+
- uses: actions/upload-artifact@v2
215+
with:
216+
path: dist/*.tar.gz
217+
name: distribution_archive
218+
219+
220+
# conda_build:
221+
# needs: [build_linux_37_and_above_wheels, build_macos_wheels, build_windows_wheels]
222+
# runs-on: ubuntu-latest
223+
# strategy:
224+
# matrix:
225+
# python-version: [3.5, 3.6, 3.7, 3.8]
226+
227+
# upload_all:
228+
# needs: [make_sdist]
229+
# runs-on: ubuntu-latest
230+
# if: github.event_name == 'release'
231+
#
232+
# - uses: actions/download-artifact@v2
233+
# with:
234+
# name: artifact
235+
# path: dist
236+
#
237+
# - uses: pypa/[email protected]
238+
# with:
239+
# user: __token__
240+
# password: ${{ secrets.pypi_password }}
241+

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata
5+
6+
btbpy.Rproj

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@
66

77
### Contributions
88

9-
Developer and maintainer of `btbpy` package
10-
Julien Jamme, <[email protected]>
9+
Developer and maintainer of `btbpy` package :
10+
11+
* Julien Jamme, <[email protected]>
12+
* [Lino Galiana](https://github.com/linogaliana/)
13+
* François Sémécurbe
1114

1215
Authors and Contributors of R `btb` package:
1316
Arlindo Dos Santos [cre],
14-
Francois Semecurbe [drt, aut],
17+
François Sémécurbe [drt, aut],
1518
Auriane Renaud [ctb],
1619
Farida Marouchi [ctb]
1720
Joachim Timoteo [ctb]
1821

1922
#### What do `btbpy` and `btb` do ?
2023

21-
The kernelSmoothing() function allows you to square and smooth geolocated data. It calculates a classical kernel smoothing (conservative) or a geographically weighted median. There are only two major call modes of the function. The smoothing with quantiles method is not available on the btbpy package.
22-
The first call mode is kernelSmoothing(obs, epsg, cellsize, bandwith) for a classical kernel smoothing and automatic grid.
23-
The second call mode is kernelSmoothing(obs, epsg, cellsize, bandwith, centroids) for a classical kernel smoothing and user grid.
24+
The `kernelSmoothing()` function allows you to square and smooth geolocated data. It calculates a classical kernel smoothing (conservative) or a geographically weighted median. There are only two major call modes of the function. The smoothing with quantiles method is not available on the `btbpy` package.
25+
The first call mode is `kernelSmoothing(obs, epsg, cellsize, bandwith)` for a classical kernel smoothing and automatic grid.
26+
The second call mode is `kernelSmoothing(obs, epsg, cellsize, bandwith, centroids)` for a classical kernel smoothing and user grid.
2427

2528
Geographically weighted summary statistics : a framework for localised exploratory data analysis, C.Brunsdon & al., in Computers, Environment and Urban Systems C.Brunsdon & al. (2002) <doi:10.1016/S0198-9715(01)00009-6>,
2629
Statistical Analysis of Spatial and Spatio-Temporal Point Patterns, Third Edition, Diggle, pp. 83-86, (2003) <doi:10.1080/13658816.2014.937718>.

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel",
5+
"Cython>=0.28.5",
6+
7+
# use oldest-supported-numpy which provides the oldest numpy version with
8+
# wheels on PyPI
9+
#
10+
# see: https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg
11+
"oldest-supported-numpy"
12+
13+
]
14+
build-backend = "setuptools.build_meta"

recipe/bld.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"%PYTHON%" setup.py install
2+
if errorlevel 1 exit 1

recipe/bld.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$PYTHON setup.py install # Python command to install the script.

recipe/meta.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{% set name = "btbpy" %}
2+
{% set version = "0.0.1" %}
3+
4+
package:
5+
name: {{ name|lower }}
6+
version: {{ version }}
7+
8+
# source:
9+
# url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
10+
# sha256: 339175849a62412e6e445be40b1c392ad1194b7c97746492010e7d3e26045814
11+
12+
build:
13+
skip: true # [win]
14+
number: 0
15+
script: {{ PYTHON }} -m pip install btbpy/ -vv
16+
17+
requirements:
18+
build:
19+
- {{ compiler('cxx') }}
20+
host:
21+
- python
22+
- pip
23+
- Cython
24+
- numpy
25+
- pandas
26+
- geopandas
27+
run:
28+
- python
29+
- Cython
30+
- numpy
31+
- pandas
32+
- geopandas
33+
34+
test:
35+
imports:
36+
- btbpy
37+
38+
about:
39+
home: "https://github.com/linogaliana/btbpy"
40+
license: GPL-3.0+
41+
license_family: GPL
42+
license_file: LICENSE
43+
summary: "Kernel and density smoothing"
44+
doc_url: https://btbpy.readthedocs.io/
45+
46+
extra:
47+
recipe-maintainers:
48+
- linogaliana

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
numpy
2+
Cython
3+
pandas
4+
geopandas

0 commit comments

Comments
 (0)