Closed mikedh closed 4 years ago
Thanks for your contribution. I would be happy to merge this. I just have questions about Github secrets. 1) Does this mean I have to share my PyPI password with Github? 2) Are builds uploaded after every commit, or only after a release?
No problem!
Does this mean I have to share my PyPI password with Github?
Yeah to release wheels automatically to PyPi you'd have to add your password on Github. Here are Github's docs on the interface and security they use for secrets. You could also skip this and manually download the wheels.zip
artifact from the build, and run the twine upload
command from your local machine.
Are builds uploaded after every commit, or only after a release?
Good question, right now it's running the whole matrix on every push or pull request. You may want to change this to be just on master
, or on tags: Github actions filtering for branches and tags
I just released a new version using your build system. Can you test that it works?
Awesome! It should be running self-tests so wheel builds should fail if there are issues. I confirmed pip is installing it nicely using the wheel in both Windows and Linux, and triangulate is functioning:
Windows:
(base) C:\Users\mik3d>pip install triangle
Collecting triangle
Downloading triangle-20200424-cp37-cp37m-win_amd64.whl (1.4 MB)
|████████████████████████████████| 1.4 MB 2.2 MB/s
Requirement already satisfied: numpy in c:\users\mik3d\anaconda3\lib\site-packages (from triangle) (1.18.1)
Installing collected packages: triangle
Successfully installed triangle-20200424
(base) C:\Users\mik3d>ipython -i
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from triangle import triangulate
In [2]: v = [[0,0], [1,0], [1,1], [1,0]]
In [3]: triangulate({"vertices": v}, "a0.2")
Out[3]:
{'vertices': array([[0. , 0. ],
[1. , 0. ],
[1. , 1. ],
[1. , 0. ],
[0.64644661, 0.64644661],
[0.5 , 0.14644661]]),
'vertex_markers': array([[1],
[1],
[1],
[0],
[1],
[0]], dtype=int32),
'triangles': array([[0, 5, 4],
[1, 4, 5],
[0, 1, 5],
[1, 2, 4]], dtype=int32)}```
Linux:
mikedh@orbital:~$ pip install --upgrade triangle
Collecting triangle
Downloading https://files.pythonhosted.org/packages/41/05/e05880ba496a73428b78372562dbf0287fc562244b9253fa96df15b12e0c/triangle-20200424-cp36-cp36m-manylinux2010_x86_64.whl (1.9MB)
|████████████████████████████████| 1.9MB 2.2MB/s
Requirement already satisfied, skipping upgrade: numpy in /home/mikedh/miniconda/lib/python3.6/site-packages (from triangle) (1.16.4)
Installing collected packages: triangle
Found existing installation: triangle 20170429
Uninstalling triangle-20170429:
Successfully uninstalled triangle-20170429
Successfully installed triangle-20200424
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
mikedh@orbital:~$ cd trimesh/tests
mikedh@orbital:tests$ python test_extrude.py
DEBUG primitives.py:799 creating mesh for Extrusion primitive
...
----------------------------------------------------------------------
Ran 1 test in 3.102s
OK```
@mikedh you're the caped hero the Python packaging community needs ;) Keep it up
Hey, thanks for all the great work on the
triangle
binding! I love the minimal nature and reliability, which is probably why a bunch of upstream packages have started depending ontriangle
too. To hopefully help, this PR uses cibuildwheel and Github Actions to build compiled wheels for Windows, Linux, and MacOS for a bunch flavors of Python:A few thoughts:
wheels
artifact here as well.PYPI_USERNAME
andPYPI_PASSWORD
using the Github secrets interface, and remove theif: false
from thewheels.yml
file.trimesh
, executes jobs almost 3x faster than Travis. I recently replaced a mix of Travis, CircleCI, and Appveyor entirely with GitHub Actions and have been super happy with it.cibuildwheel
has a really impressive build matrix and abstracts a lot of complexity really nicely (IMHO).tests/test_triangle.py
file. This lets pytest use the installedtriangle
, I was running in to issues with the pure doctests approach in CI. CIBW runs the unit tests using the built wheel across the entire build matrix, which is nice.from triangle.core
tofrom .core