-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Binary packages, cleanups. #500
base: master
Are you sure you want to change the base?
Conversation
Source and tests should be distinct.
This rule is blocking files in .github for example.
0b45906
to
8722ece
Compare
It's stored as an artifact and passed into the test matrix jobs.
Use proper pytest fixtures for shared test data. Remove two unnecessary array comparison functions.
c4b4e74
to
71ca307
Compare
Cool! Let me know when you want me to review this. |
5f49bf3
to
3a6fbdf
Compare
Almost ready, just some fixes for m1 macs to go and to re-add the upload to pypi I removed while testing. This builds binary packages for py3.7-310 on arm64-linux, arm64-m1, Power-linux,, x86_64 win/mac/linux. |
That's pretty cool. What controls when it uploads? Is it tagged releases only? |
I'm using my same workflow modified from pysimdjson. This pr is currently missing half the workflow because I don't want it to actually upload while I'm testing :) When you push a tag that starts with v+number it'll make a release, push it to pypi, and create a release on GitHub adding all the build artifacts to it. Then you can just add a description. |
So far my convention has been tagging, for example |
Btw, thank you for the contributions! |
It's just a regex, easy change. |
@mrjbq7 the tests look like they're finding some precision issues on i686:
|
Ah I didn't see you on the contributor list when I took a peek. If you have commit access to it that's great, we can definitely use it instead. |
any update on this? it'd be great to have ta-lib release binaries (mainly for windows) - especially since the prior source (https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib) seems to have been archived - and didn't update since June. This makes every ta-lib update a pain for users - since installing on windows is currently really not fun. |
I've taken the liberty to play with this a bit, updating it with the current master, and testing the wheels. The CI runs on current master are available here: As mentioned above already - the "release" step has to be updated to only run on tags - and an "upload" step that publishes the wheels to pypi (if that's something you're interested in in the first step - this could also be done manually initially). I've manually tested the wheels on windows and linux, and can confirm they work fine. I've added a "test wheels" step to CI too - which is using a clean environment, only installing the wheels - to ensure they're working on windows, mac and linux. The "manual test" step here involves calling @mrjbq7 i'd make a PR out of that if you're interested - it'll include the work of this PR - but with the intend to have it merged ASAP - simplifying people's update and installation steps. |
I love this idea, not sure about using this for releases, until I understand how to only have it release tags, and also how to download and test the intermediate artifacts myself?
For test case, you could do something simple like make a 6 element numpy array and run SMA on it and assert the result, and probably do it with python -c
… On Sep 10, 2022, at 12:11 AM, Matthias ***@***.***> wrote:
I've taken the liberty to play with this a bit, updating it with the current master, and testing the wheels.
The CI runs on current master are available here:
tests: https://github.com/xmatthias/ta-lib/actions/runs/3027067796
build: https://github.com/xmatthias/ta-lib/actions/runs/3027067795
As mentioned above already - the "release" step has to be updated to only run on tags - and an "upload" step that publishes the wheels to pypi (if that's something you're interested in in the first step - this could also be done manually initially).
I've manually tested the wheels on windows and linux, and can confirm they work fine.
I've added a "test wheels" step to CI too - which is using a clean environment, only installing the wheels - to ensure they're working on windows, mac and linux.
This will ensure that wheels about to be uploaded are actually built properly (i don't fully trust wheel building - therefore prefer to test them individually) - and is basically taking the approach used in pytables CI as well.
The "manual test" step here involves calling python -m talib.abstract. It'll fail if ta-lib binaries are not properly installed / available.
If there's a better test command we can and should obviously update to that - i'd however not run pytest - as test-files are not included in the release.
@mrjbq7 i'd make a PR out of that if you're interested - it'll include the work of this PR - but with the intend to have it merged ASAP - simplifying people's update and installation steps.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
You can download the artifacts from the build all the way at the bottom (see screenshot). it's a zip file, which contains the source tarball (what you release currently) - as well as all wheels for different plattforms.
that's no problem, really - you'll always have the option to download the wheels first - inspect/test them - and then push them to pypi manually (basically with i think users will benefit from this by having the installation simplified with |
If you're basing your changes off of mine, that's already what cibuildwheel is doing. It'll build the wheels, copy them into a new env, and run the tests before allowing it to pass. |
i am aware of that - but i don't fully trust that for libraries like ta-lib (Or pytables, for that matter). the wheels would also work if ta-lib is installed system-wide - reusing the library from some place like /usr/lib or similar. |
Do we want to bundle Can we get a version of this that does everything but doesn't upload releases, and get that merged? |
You need to bundle upstream - the reason I include a |
Want to collaborate in the ta-lib/ta-lib GitHub org? We can push those patches there, and maybe move this to ta-lib/ta-lib-python?On Sep 13, 2022, at 8:04 AM, Tyler Kennedy ***@***.***> wrote:
You need to bundle upstream - the reason I include a git subtree of my fork of ta-lib is for platform compatibility, and ta-lib.org will never see updates. The fork will build on a Pinebook Pro for example, whereas ta-lib.org will not.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sure, I have no issue with this. I think we discussed this before and the reason I forked was that the repo seemed inactive.
ta-lib should never be used from the system now, we explicitly bundle it. If there's a place where we're accidentally allowing a system ta-lib to get linked in we've got a bug. There are fixes for 32bit/64bit precision and platform support that the archaic system package manager versions will not have. |
@TkTech What's the actual source for the "inlined", upstream ta-lib repository? comparing it to https://github.com/TA-Lib/ta-lib (basically did a clone - and copied the contents of upstream over the clone) - i do see quite severe differences. i've now tried to use the upstream one (branch master) - the diff this caused can be found here: edit seems like there's actually been a 0.5.0 release of TA-Lib - and a 0.6.0 dev (which represents the emaster branch). |
@xmatthias sorry, missed your reply. The upstream version I used is the official ta-lib release from https://ta-lib.org/. The version on github is an "unofficial" (but defacto official at this point) version by @mrjbq7 and friends (I believe) |
Official https://ta-lib.org/ conatins a realease of 0.4.0 and official https://ta-lib.org/ 's project at sourceforge contains unreleased 0.6.0-dev. It's not about github or unofficial forks in any case. Didn't read the whole thread - just leave here a note from my old findings from my old article about compatibility:
Thet's a most important (may be only one - don't remember) difference in my opinion. |
i've (successfully) built wheels for all versions (0.5.0, 0.6.0-dev, 0.4.0 <- all from github, 0.4.0 from orig source) i also agree with @trufanov-nok that the floating point fix should be included. a rough overview of this change can be found in this commit: xmatthias@6452708 (which also adds a testcase ensuring this fix is included). I think which version should be used initially is a decision @mrjbq7 will have to take (please let us know your thoughts). Personally, i'd recommend to go with a 0.4.0 version initially, with the float fix applied (don't care if it's the github one or the ta-lib.org one, really). Future updates to 0.5.0 or 0.6.0 can then be made as future steps. |
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.
v2 改,其他过。 ta
-taller
Hello all, Another idea is to include the talib source as a git submodule. This way even source distributions can be built on the go by any user. This approach would simplify the management of the package and the source versions can be pinned. |
Hi everybody ( @xmatthias , @mrjbq7 , @TkTech , @trufanov-nok , @francipvb ) SummaryI am currently re-working the "C" TA-Lib Core CI, and now would be a good time to give me direction on what would be helpful "upstream". As of right now, we can:
DetailsThe upstream CI works as follow:
|
I really need to get the "wheels building" process working so that ta-lib-python can release static builds already packaging some TA-Lib underyling C library release version. |
Will this only contain the "current RC" - or will it build incrementally (now it contains 0.6.3 - will it in the future contain 0.6.5, or [0.6.3, 0.6.4, 0.6.5]? (this would probably result in an ever growing repo - which it'll in reality also do if you delete the binaries again - so is most likely not ideal).
This will definitely be a great idea - as i've always been a bit suspicious of everything comming out of sourceforge ... 👍 For me personally - pre-releases of the C library are not really relevant - as i'm (strictly) a user of ta-lib-python which - ideally - comes with wheels containing the pre-built c library already (which would be a dream, really). I'm personally maintaining a (ugly) fork of this PR at https://github.com/xmatthias/ta-lib-python/tree/ta_bundled_040 - where i can extract the windows wheels - which are essential for the CI (and ultimately also for the users) of a project i maintain - as i wasn't able to setup the source-compilation on windows CI to work reliably (not with the frequency we run CI, anyway). Maybe parts of the CI (especially the cross-compiling one for armhf) could be reused - though definitely not all, as (similar to this PR) it incorporates the C sourcecode directly - which - with new developments in the ta-lib organisation (having the c library maintained again! 💯 ) - are no longer how things should be done (imho). I've never really cleaned this up and made a PR as I/we rely on a "precision" patch of ta-lib 0.4.0 (otherwise pair/BTC values are 0.0) - which i assume wouldn't have been accepted here. The good news is - this precision increase is already in the c libary of 0.5.0 (iirc) - so with the 0.6.0 release, there's actual hope to be able to use proper wheels - which obviously ideally, are provided officially from this Repository. |
Two limitations with upstream static lib:
Nothing that can't be work-around... just heads-up. |
Well ideally / the dream is to have the .whl files include everything - so on a fresh system, i can do While i understand the point of not providing a macos lib / binary for C users - i think from a python user perspective, the wheels should also work there without additional "brew" installs. Windows ARM is ... not a liked platform anyway at this point - i doubt support for it catches on all too quickly unless CI runners are provided. |
Thanks for your work! | Will this only contain the "current RC" - or will it build incrementally (now it contains 0.6.3 - will it in the future contain 0.6.5, or [0.6.3, 0.6.4, 0.6.5]? Simple rule:
Details Older assets clean-up is handled by "scripts/package.py" whenever a new package is created. Important to ignore the version field because:
This approach is "not perfect", but good enough to keep the CI flowing... proper version tagging happens only at the moment the release is done. |
@xmatthias Agreed. Thinking the .whl CI is the one using homebrew to copy/embed the static libs, not the end-user. That means a new .whl building for a given TA-Lib C version can happens only after the matching binaries are on homebrew (eventually happens through automation). Update: (@mrjbq7 I'm just thinking loud about things I do not know much about... not advocating homebrew is the way to go) |
Another thing to consider is that some people don't have a binary-compatible platform like BSD or something strange. So the source distribution of the python package should be able to be built without more tools than the compiler. I mean the build process should download a source distribution, build the static library and then build the python extension against it without any intervention from the end user. By doing this you also will support Windows ARM and linux on RiscV without building every binary version for every compatible binary platform, python distribution, etc. Fortunately the only two ways to build are Unix-like and Windows-like ways, any other platform is comparable to one of these. |
@francipvb the intervention from the end user will (must) be to have necessary built tools installed (think - build-essentials - and maybe something extra). I don't think that's limiting necessarily - and is more a topic of "needs good documentation and error logs" than being a problem. |
There's nothing wrong with vendoring the dependencies into the repo and leaving an envvar to allow distributions to specify a packaged version. In fact it's preferred, since each release of ta-lib will come with a specific, known version of the dependencies when debugging issues. There is no need to involve homebrew or anything else in this process - leave it to the package maintainers. cibuildwheel is used in this PR to build Windows ARM wheels, along with PowerPC and many others. Since it builds in Qemu, we don't have to wait for native CI hosts to build and run the tests. |
Didn't mean to make this PR against upstream just quite yet, ah well. WIP.
Changes:
Test Cleanups
assert_np_arrays_equal
andassert_np_arrays_not_equal
, replacing them with the built-innumpy.testing.assert_array_equal
python_versions * architecture
times. We still test intests.yml
, but not on releases. They're working on packaging, this can be reversed when that's done.Release