louisabraham / pydivsufsort

Python package for string algorithms ➰
MIT License
38 stars 4 forks source link

Initial Migration to Github Actions #31

Closed seanlaw closed 2 years ago

seanlaw commented 3 years ago

The Python community is starting to establish some standards around the use of setup.py and to move toward "build frontends" and "build backends". I think this (verbose) article touches upon the problem in this issue where:

if your build required something that is not universally installed (e.g. numpy or Cython), your builds would just break when someone tried to naïvely install your package from source.

and later:

Note that you are supposed to import cythonize before setup is executed, and without manually installing Cython, this is going to fail because Cython is imported before setuptools even gets the chance to install it!

And they propose some updated solutions where we should separate "build-time dependencies" using something like a pyproject.toml file along with, say, the build package.

We should explore this.

Here is the awesome pyproject.toml list with templates

seanlaw commented 3 years ago

Directly related to #23

seanlaw commented 3 years ago

@louisabraham Please excuse all of the noise. I exclusively use Github Actions for my own open source projects and so I'm using it here to test if I am able to build this package on different operating systems. Afterward, I'll see if I can separate the frontend from the backend.

seanlaw commented 3 years ago

Alright, it looks like I am able to build from source and unit tests are all passing on all three major operating systems!

https://github.com/louisabraham/pydivsufsort/actions/runs/1401375190

The next step is to see if I can untangle the frontend and backends (I don't have any experience with this but I am gonna take a look).

@louisabraham Instead of using TravisCI, I am wondering if you could improve upon what I did and we can setup CI/CD directly to PyPI every time something gets pushed/tagged? I know it's possible because other people do it and cibuildwheel appears to be supported in Github Actions. Here is what I have so far for being able to build from source using Github Actions:

https://github.com/louisabraham/pydivsufsort/blob/49ac78627b517537932d6f054c7e39eec035dfe8/.github/workflows/github-actions.yml#L28-L48

louisabraham commented 3 years ago

Thanks, that's awesome!

The uploading to pypi can definitely be done with twine, see in the travis workflow. We have to upload the wheels on each platform, and the sdist from any platform.

Could you try on a different branch with https://test.pypi.org/ (see here)?

seanlaw commented 3 years ago

The uploading to pypi can definitely be done with twine, see in the travis workflow. We have to upload the wheels on each platform, and the sdist from any platform.

Yes, I will look into that. I'm still learning as I'm going so there will be mistakes. Please do not merge anything PR that starts with "[WIP]" (work-in-progress). I do it this way so that I can get Github Actions to trigger each time I make a new commit to the PR as I test out the process.

Could you try on a different branch with https://test.pypi.org/ (see here)?

Yes, that was my plan! I'm glad that we are on the same page. I'll probably still need your eyes at the end to go over and test things if you don't mind but this is progress.

seanlaw commented 2 years ago

Closed by https://github.com/louisabraham/pydivsufsort/pull/34