Skip to content

Commit 5e09e54

Browse files
committed
test building wheels
don't use conda activate only install libpython on windows some debuggy stuff moar debugging bash on windows? don't waste ci time setup requires extension helpers follow celerite and install vcpython27 abandon conda skip py 3.5 build re-enable sdist reenable windows/linux install pep517 package build windows with conda working on windows wheels wtf try check output with shell on windoes where is gsl-config allow manually specifying gsl version and prefix via env vars hopefully debug build install reqs astropy hack don't fail fast first get 3.7 working not shallow sep hackery get all git history for scm path hack check oops 'with' hmmm attempt normpath
1 parent 69d30a9 commit 5e09e54

File tree

3 files changed

+113
-59
lines changed

3 files changed

+113
-59
lines changed

.github/workflows/wheels.yml

+95-46
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,105 @@
11
name: Wheels
22
on:
3-
release:
4-
types:
5-
- published
3+
# release:
4+
# types:
5+
# - published
66
push:
77
branches:
88
- wheeltest
99

1010
env:
1111
CIBW_BUILD: "cp3?-*"
12-
CIBW_SKIP: "*-win32 *-manylinux_i686"
12+
CIBW_SKIP: "*-win32 *-manylinux_i686 cp35-*"
1313
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
1414

1515
jobs:
16-
build_wheels:
17-
name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }}
18-
runs-on: ${{ matrix.os }}
16+
# build_nix_wheels:
17+
# name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }}
18+
# runs-on: ${{ matrix.os }}
19+
# strategy:
20+
# fail-fast: false
21+
# matrix:
22+
# os: [ubuntu-18.04, macos-latest]
23+
24+
# steps:
25+
# - uses: actions/checkout@v2
26+
# with:
27+
# fetch-depth: 0
28+
# - uses: actions/setup-python@v2
29+
# name: Install Python
30+
# with:
31+
# # Note: cibuildwheel builds for many Python versions beyond this one
32+
# python-version: "3.7"
33+
34+
# # Mac:
35+
# - name: Setup Mac
36+
# if: runner.os == 'macOS'
37+
# run: |
38+
# brew install gsl
39+
40+
# # Ubuntu:
41+
# - name: Setup Linux
42+
# if: runner.os == 'Linux'
43+
# run: |
44+
# sudo apt-get install gsl-bin libgsl0-dev
45+
46+
# - name: Build wheels
47+
# run: |
48+
# python -m pip install cibuildwheel==1.5.2
49+
# python -m cibuildwheel --output-dir wheelhouse
50+
51+
# - uses: actions/upload-artifact@v2
52+
# with:
53+
# path: ./wheelhouse/*.whl
54+
55+
build_win_wheels:
56+
name: Build ${{ matrix.python-version }} wheels on Windows
57+
runs-on: windows-latest
1958
strategy:
2059
matrix:
21-
os: [ubuntu-18.04, windows-latest, macos-latest]
22-
python-version: ["3.7", "3.8"]
60+
# python-version: [3.6, 3.7, 3.8]
61+
python-version: [3.7]
62+
fail-fast: false
2363

2464
steps:
2565
- uses: actions/checkout@v2
2666
with:
27-
submodules: true
28-
67+
fetch-depth: 0
2968
- uses: goanpeca/setup-miniconda@v1
3069
with:
3170
auto-update-conda: true
3271
python-version: ${{ matrix.python-version }}
72+
activate-environment: gala-wheels
3373

3474
- name: Install dependencies
75+
shell: bash -l {0}
3576
run: |
36-
conda create -n gala-wheels python=${{ matrix.python-version }} -q -c conda-forge
37-
conda activate gala-wheels
3877
conda install -c conda-forge -q gsl libpython
39-
python -m pip install cibuildwheel==1.5.1
78+
gsl-config --version
4079
41-
- name: Install Visual C++ for Python 3.7
42-
if: runner.os == 'Windows'
43-
run: |
44-
choco install vcpython37 -f -y
80+
# - name: Set environment variables on Windows
81+
# shell: bash -l {0}
82+
# run: |
83+
# # echo ::set-env name=INCLUDE::$CONDA_PREFIX\\Library\\include
84+
# # echo ::set-env name=LIB::$CONDA_PREFIX\\Library\\lib
85+
# # echo ::set-env name=LIBPATH::$CONDA_PREFIX\\Library\\lib
86+
# gsl-config --version
4587

4688
- name: Build wheels
89+
shell: bash -l {0}
4790
run: |
48-
python -m cibuildwheel --output-dir wheelhouse
91+
which gsl-config
92+
export GALA_GSL_VERSION=$(gsl-config --version)
93+
# export GALA_GSL_PREFIX=$(gsl-config --prefix)
94+
export GALA_GSL_PREFIX="/c/Miniconda/envs/gala-wheels/Library/"
95+
# pip install pep517
96+
# python -m pep517.build -o wheelhouse .
97+
98+
pip install setuptools setuptools_scm wheel extension-helpers
99+
conda install astropy # because there is no wheel for py38 on windows!
100+
pip install -r requirements.txt
101+
python setup.py build_ext
102+
python setup.py bdist_wheel
49103
50104
- uses: actions/upload-artifact@v2
51105
with:
@@ -57,39 +111,34 @@ jobs:
57111
steps:
58112
- uses: actions/checkout@v2
59113
with:
60-
submodules: true
61-
62-
- uses: goanpeca/setup-miniconda@v1
114+
fetch-depth: 0
115+
- uses: actions/setup-python@v2
116+
name: Install Python
63117
with:
64-
auto-update-conda: true
65-
python-version: ${{ matrix.python-version }}
66-
67-
- name: Install dependencies
68-
run: |
69-
conda create -n gala-wheels python=${{ matrix.python-version }} -q -c conda-forge
70-
conda activate gala-wheels
71-
conda install -c conda-forge -q gsl libpython
72-
python -m pip install cibuildwheel==1.5.1
118+
python-version: "3.7"
73119

74120
- name: Build sdist
75-
run: python setup.py sdist
121+
run: |
122+
sudo apt-get install gsl-bin libgsl0-dev
123+
pip install pep517
124+
python -m pep517.build -s .
76125
77126
- uses: actions/upload-artifact@v2
78127
with:
79128
path: dist/*.tar.gz
80129

81-
upload_pypi:
82-
needs: [build_wheels, build_sdist]
83-
runs-on: ubuntu-latest
84-
if: github.event_name == 'release' && github.event.action == 'published'
85-
steps:
86-
- uses: actions/download-artifact@v2
87-
with:
88-
name: artifact
89-
path: dist
130+
# upload_pypi:
131+
# needs: [build_wheels, build_sdist]
132+
# runs-on: ubuntu-latest
133+
# if: github.event_name == 'release' && github.event.action == 'published'
134+
# steps:
135+
# - uses: actions/download-artifact@v2
136+
# with:
137+
# name: artifact
138+
# path: dist
90139

91-
- uses: pypa/gh-action-pypi-publish@master
92-
with:
93-
user: __token__
94-
password: ${{ secrets.pypi_password }}
95-
# To test: repository_url: https://test.pypi.org/legacy/
140+
# - uses: pypa/gh-action-pypi-publish@master
141+
# with:
142+
# user: __token__
143+
# password: ${{ secrets.pypi_password }}
144+
# # To test: repository_url: https://test.pypi.org/legacy/

setup.cfg

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ install_requires =
2121
cython
2222
scipy
2323
python_requires = >=3.6
24-
setup_requires = setuptools_scm
24+
setup_requires =
25+
setuptools_scm
26+
extension-helpers
2527

2628
[options.package_data]
2729
* = *.c

setup.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@
9696

9797
# First, see if the user wants to install without GSL:
9898
nogsl = bool(int(os.environ.get('GALA_NOGSL', 0)))
99+
gsl_version = os.environ.get('GALA_GSL_VERSION', None)
100+
gsl_prefix = os.environ.get('GALA_GSL_PREFIX', None)
99101

100102
# Auto-detect whether GSL is installed
101-
if not nogsl or nogsl is None: # GSL support enabled
103+
if (not nogsl or nogsl is None) and gsl_version is None: # GSL support enabled
102104
cmd = ['gsl-config', '--version']
103105
try:
104-
gsl_version = check_output(cmd, env=env)
106+
gsl_version = check_output(cmd, env=env).decode('utf-8')
105107
except (OSError, CalledProcessError):
106108
gsl_version = None
107-
else:
108-
gsl_version = gsl_version.decode('utf-8').strip().split('.')
109109

110-
else:
111-
gsl_version = None
110+
if gsl_version is not None:
111+
gsl_version = gsl_version.strip().split('.')
112112

113113
# If the hacky macros file already exists, read from that what to do.
114114
# This means people experimenting might need to run "git clean" to remove all
@@ -142,12 +142,15 @@
142142
print("GSL version {0} found: installing with GSL support"
143143
.format('.'.join(gsl_version)))
144144

145-
# Now get the gsl install location
146-
cmd = ['gsl-config', '--prefix']
147-
try:
148-
gsl_prefix = check_output(cmd, encoding='utf-8').strip()
149-
except:
150-
gsl_prefix = str(check_output(cmd)).strip()
145+
if gsl_prefix is None:
146+
# Now get the gsl install location
147+
cmd = ['gsl-config', '--prefix']
148+
try:
149+
gsl_prefix = check_output(cmd, encoding='utf-8')
150+
except:
151+
gsl_prefix = str(check_output(cmd, shell=shell))
152+
153+
gsl_prefix = os.path.normpath(gsl_prefix.strip())
151154

152155
print("-" * 79)
153156

0 commit comments

Comments
 (0)