-
-
Notifications
You must be signed in to change notification settings - Fork 27
Add Github Actions CI/CD for build, tests, and PyPI release #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
We just changed it to using the pre-built release of Related: Maybe we can merge it for now using the pre-build Linux The alternative is to set up https://cibuildwheel.readthedocs.io/en/stable/options/ and keep the |
Please rebase this PR on master, not on cython-blend. |
722215a
to
4b82ec1
Compare
@mgautierfr this is rebased on I suggest we try to get this merged into master pretty much as-is (small suggestions welcome of course), and work on any big changes as separate PRs against master. It will make it easier to coordinate work in other branches since this PR changes the testing system a little and the other branches need that work to continue. |
958c7e4
to
50071a0
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the individual comments.
It is not a big deal, but as I said in a previous comment, if we are using pytest to run the tests, it would be a good thing (and easier) to also use pytest to write the test (instead of unittest).
setup.py
Outdated
return open(os.path.join(os.path.dirname(__file__), fname)).read() | ||
|
||
PACKAGE_NAME = "libzim" | ||
VERSION = "6.1.1" # pegged to be the same version as libzim since they are always released together |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THis shouldn't be the same.
A minor version change of libzim doesn't need a new version of the wrapper.
And you may want to fix things in the wrapper even if libzim doesn't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the NPM world it's common to pin the binding package version to the same version as the main library, and then use a script to bump the versions of both whenever either one wants to issue a new release. (e.g. in this way redux==1.2.3
is always guaranteed to work with react-redux==1.2.3
, react-redux-addons==1.2.3
, etc. and users don't have to look up compatibility charts or wonder if they have the correct versions installed)
I don't have a strong preference either way though, so I don't mind changing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do they do in NPM to update the wrapper even if the library has not changed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have a script to bump both versions anytime either one changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want me to reset this to 0.0.1, or keep it as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the project name on pypi has been reserved by making a 0.0.1
so whatever version we release first much be different.
Note: the build is failing because of these two files.
I don't want to reformat these files with black in this PR, as it will create a lot of unnecessary conflicts with our changes to those files in other branches. |
It is recommended to include the generated files so that the user doesn't need to have Cython installed. |
Nothing which is automatically generated should be in the git. Cython is a strong dependence and it should be clearly written in the |
@kelson42 this is the case right now because we're only distributing If you are 100% you don't want users installing via |
sdist is not a source release, it’s a source distribution for setup tools which is not a complex system like debian debs. Of all the dependencies I’ve used that required install-time compilation, none ever required cython or similar. |
Ok so just to be clear, the conclusion is:
I can push the change today. |
@mgautierfr makes the decision but that’s how it should be done in my opinion, yes. that’s the expected python/pip behavior. |
Ok that should now be done √: ...
# Files autogenerated by Cython
libzim/libzim.cpp
libzim/libzim.h
libzim/libzim_api.h
...
# include the cython-generated libzim and libzim_api cpp+headers in the sdist
recursive-include libzim * |
c19d678
to
75911cd
Compare
I have opened an issue in libzim project related to the segmentation fault problem in the test github actions workflow: |
Would it be possible complete this workflow by using compiled source (instead of pre-built) because this (openzim/libzim#333)? @mgautierfr |
It would be difficult. The compilation of libzim should not be handle by the wrapper. There is kiwix-build for that. The PR is pretty old, it should be rebase on master (where the code has changed since). And ideally with the intermediate (wrong) commits removed. |
d89a3f9
to
039073d
Compare
0e9adb2
to
96b5752
Compare
96b5752
to
ee55969
Compare
Seems good. We may change few things in the future but it is good for now and this PR is open since a long time now. |
Key Points
ubuntu
environment, does not use standalone Dockerfile (to match style use by other OpenZIM projects)python-libzim
againstlibzim
binary release dylibblack
andflake8
python-libzim
unit test suite withpytest
(also supportstox
)TODOs
pypa/gh-action-pypi-publish
to uselibzim
compilation in favor using the latest released binarypyproject.toml
+pytest
+tox
for Python tests, cython build, sdist/bdist packaging, and PyPI release processset up statically linked cross-platform distribution with some combination of(not needed for now, just do binary-based Linux x64 build cc @Kelson)cibuildwheel
,manylinux
,auditwheel