Skip to content

Commit be446a1

Browse files
committed
feat: support setup helpers
1 parent 4a08067 commit be446a1

File tree

8 files changed

+320
-115
lines changed

8 files changed

+320
-115
lines changed

.appveyor.yml

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ build_script:
3333
- ps: |
3434
if ($env:PYTHON) {
3535
python setup.py sdist
36-
python -m pip install 'pybind11>=2.3'
3736
cd dist
3837
python -m pip install --verbose python_example-0.0.1.tar.gz
3938
cd ..

.github/workflows/wheels.yml

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Wheels
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- master
8+
push:
9+
branches:
10+
- master
11+
release:
12+
types:
13+
- published
14+
15+
env:
16+
CIBW_TEST_EXTRAS: test
17+
CIBW_TEST_COMMAND: pytest {project}/tests
18+
19+
20+
jobs:
21+
build_sdist:
22+
name: Build SDist
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-python@v2
27+
28+
- name: Install deps
29+
run: python -m pip install "setuptools>=42" "setuptools_scm[toml]>=4.1.0" twine
30+
31+
- name: Build SDist
32+
run: python setup.py sdist
33+
34+
- name: Check metadata
35+
run: twine check dist/*
36+
37+
- uses: actions/upload-artifact@v2
38+
with:
39+
path: dist/*.tar.gz
40+
41+
42+
build_wheels:
43+
name: Wheels on ${{ matrix.os }}
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
matrix:
47+
os: [ubuntu-latest, windows-latest, macos-latest]
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- uses: actions/setup-python@v2
53+
54+
- name: Install cibuildwheel
55+
run: python -m pip install cibuildwheel==1.6.0
56+
57+
- name: Build wheel
58+
run: python -m cibuildwheel --output-dir wheelhouse
59+
env:
60+
CIBW_SKIP: cp27-win*
61+
62+
- name: Show files
63+
run: ls -lh wheelhouse
64+
shell: bash
65+
66+
- name: Verify clean directory
67+
run: git diff --exit-code
68+
shell: bash
69+
70+
- name: Upload wheels
71+
uses: actions/upload-artifact@v2
72+
with:
73+
path: wheelhouse/*.whl
74+
75+
76+
# Windows 2.7 (requires workaround for MSVC 2008 replacement)
77+
build_win27_wheels:
78+
name: Py 2.7 wheels on Windows
79+
runs-on: windows-latest
80+
81+
steps:
82+
- uses: actions/checkout@v1
83+
with:
84+
submodules: true
85+
86+
- uses: actions/setup-python@v2
87+
88+
- name: Install cibuildwheel
89+
run: python -m pip install cibuildwheel==1.6.0
90+
91+
- uses: ilammy/msvc-dev-cmd@v1
92+
93+
- name: Build 64-bit wheel
94+
run: python -m cibuildwheel --output-dir wheelhouse
95+
env:
96+
CIBW_BUILD: cp27-win_amd64
97+
DISTUTILS_USE_SDK: 1
98+
MSSdk: 1
99+
100+
- uses: ilammy/msvc-dev-cmd@v1
101+
with:
102+
arch: x86
103+
104+
- name: Build 32-bit wheel
105+
run: python -m cibuildwheel --output-dir wheelhouse
106+
env:
107+
CIBW_BUILD: cp27-win32
108+
DISTUTILS_USE_SDK: 1
109+
MSSdk: 1
110+
111+
- name: Show files
112+
run: ls -lh wheelhouse
113+
shell: bash
114+
115+
- name: Verify clean directory
116+
run: git diff --exit-code
117+
shell: bash
118+
119+
- uses: actions/upload-artifact@v2
120+
with:
121+
path: wheelhouse/*.whl
122+
123+
124+
upload_all:
125+
name: Upload if release
126+
needs: [build_wheels, build_win27_wheels, build_sdist]
127+
runs-on: ubuntu-latest
128+
if: github.event_name == 'release' && github.event.action == 'published'
129+
130+
steps:
131+
- uses: actions/setup-python@v2
132+
133+
- uses: actions/download-artifact@v2
134+
with:
135+
name: artifact
136+
path: dist
137+
138+
- uses: pypa/[email protected]
139+
with:
140+
user: __token__
141+
password: ${{ secrets.pypi_password }}

.gitignore

+138-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,140 @@
1+
# Using https://github.com/github/gitignore/blob/master/Python.gitignore
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
19
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
229
MANIFEST
3-
*.py[cod]
4-
*.egg-info
5-
.DS_Store
6-
_build
7-
_generate
8-
build
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
cover/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
.pybuilder/
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
# .python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
100+
__pypackages__/
101+
102+
# Celery stuff
103+
celerybeat-schedule
104+
celerybeat.pid
105+
106+
# SageMath parsed files
107+
*.sage.py
108+
109+
# Environments
110+
.env
111+
.venv
112+
env/
113+
venv/
114+
ENV/
115+
env.bak/
116+
venv.bak/
117+
118+
# Spyder project settings
119+
.spyderproject
120+
.spyproject
121+
122+
# Rope project settings
123+
.ropeproject
124+
125+
# mkdocs documentation
126+
/site
127+
128+
# mypy
129+
.mypy_cache/
130+
.dmypy.json
131+
dmypy.json
132+
133+
# Pyre type checker
134+
.pyre/
135+
136+
# pytype static type analyzer
137+
.pytype/
138+
139+
# Cython debug symbols
140+
cython_debug/

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ install:
4747
- |
4848
if [ -n "$PYTHON" ]; then
4949
python setup.py sdist
50-
python -m pip install 'pybind11>=2.3'
5150
python -m pip install --verbose dist/*.tar.gz
5251
elif [ -n "$CONDA" ]; then
5352
conda build conda.recipe --python $CONDA

conda.recipe/bld.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ if "%ARCH%" == "32" (set PLATFORM=x86) else (set PLATFORM=x64)
22
call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%
33
set DISTUTILS_USE_SDK=1
44
set MSSdk=1
5-
"%PYTHON%" setup.py install
5+
"%PYTHON%" -m pip install
66
if errorlevel 1 exit 1

conda.recipe/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
unset MACOSX_DEPLOYMENT_TARGET
3-
${PYTHON} setup.py install;
3+
${PYTHON} -m pip install;

conda.recipe/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ requirements:
1717
build:
1818
- python
1919
- setuptools
20-
- pybind11
20+
# Disabled for now - pybind11
2121

2222
run:
2323
- python

0 commit comments

Comments
 (0)