-
Notifications
You must be signed in to change notification settings - Fork 65
fix: include license file in python package #1221
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
fix: include license file in python package #1221
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1221 +/- ##
=====================================
Coverage 7.32% 7.32%
=====================================
Files 20 20
Lines 1378 1378
=====================================
Hits 101 101
Misses 1277 1277 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @davzoku 👋 Thanks so much for your PR! Apologies for the long delay in looking at this. We had some other unrelated issues with our Python workflow that was causing build failures that should be resolved now. I went ahead and pulled in the new changes to this branch to see if they'll succeed with your new changes. |
|
Great job, no security vulnerabilities found in this Pull Request |
|
Thanks for pushing this in to the right direction @davzoku - I have not succeeded to build/install from your pr. I got The main changes were removal of EDIT: I am able to install the resulting library but it will seqfault upon invocation. I have not managed to build and run it. I also tried building from main and the bahaviour is the same. I tried with Python 3.13 and 3.11 with same result. Can someone confirm that we have a working python branch? |
|
@goshansp, thanks for looking at this. I'm able to install the built wheel artifacts from this branch and invoke it successfully in a Python script. Here's what I used to quickly test it: python3 -c '
import os;
from bitwarden_sdk import BitwardenClient, DeviceType, client_settings_from_dict;
client = BitwardenClient(
client_settings_from_dict(
{
"apiUrl": "http://localhost:3000/api",
"deviceType": DeviceType.SDK,
"identityUrl": "http://localhost:3000/identity",
"userAgent": "Python",
}
)
);
client.auth().login_access_token(os.getenv("ACCESS_TOKEN"), None)
'I was also able to build it locally and invoke it with the above script as well by doing the following: # generate schemas
npm i
npm run schemas
# create a python virtual environment; I used uv so I could easily test with multiple Python interpreter versions
uv venv /tmp/.venv --python 3.13 # 3.9 worked for me as well
source /tmp/.venv/bin/activate
# install maturin
## on macOS:
uv pip install maturin
## on Linux:
uv pip install maturin[patchelf]
# build and install the Python package
maturin developCould you provide more information about your system (OS, CPU arch, any other relevant info about your Python environment) and how you're building and invoking the SDK so I can try to replicate it on my end? |
|
Sincere thanks for your qualified comment @tangowithfoxtrot - I am rolling with Fedora 42 Silverblue in a Venv and on this branch I cannot Your Python snipped has an ident issue. I reverted to using this branches code to see if I can get it to work with your instructions. This is what I did: LICENSE path issueOn My branch after fixing LICENCEBuild System InfoEven I am on Silverblue I'd expect my system to be binary compatible with Fedora 42. Do you have an idea in which direction to poke? Thanks for keeping up the good work! |
|
@goshansp It took me a while to come back to this, but I'm thankful for your last comment because I was able to reproduce the license error that you mentioned: I'm able to reproduce that, and the segfault you mentioned on Fedora Workstation 42 (Silverblue images weren't available with my cloud provider), so whatever is happening doesn't seem to be unique to Silverblue 🤔 |
|
@tangowithfoxtrot thank you for reproducing the issues. I'd be happy to test any fixes. May we assume that sdk-sm is currently broken for all or many Linux distros? Are your checks only testing the build process without testing for segfault? If you have means to escalate this - I think the fix is highly anticipated within the community and will supercharge adoption. If you have ideas how I can help, please let me know. |
|
I've initially failed at building those branches on Ubuntu 22 (node too old, syntax error) and Ubuntu 24 (Error is imported redundantly) ... Are we safe to assume that sdk-sm does not build on Linux at the moment? I am fiddling on my fork and I am building this now on Ubuntu 24 without getting the later import segfault. Next I want to understand why Fedora is nok. Ubuntu 24 build system infoDifferences between ok Fedora 41 and nok Fedora 42I question if we'll be able to do this without the company assigning the Linux topic a higher priority. EDIT: I am only getting the segfault when building on Fedora 42. There must be something different between Fedora 41 and Fedora 42 which we haven't checked yet. EDIT2: Segfault only happens with |
|
|
@goshansp, thanks again for your effort in looking into this. I don't exactly have an answer yet for where the issue lies that is causing the segfaults on some Linux environments (although, I suspect you are on the right track in your fork). Since the segfaults that you're experiencing appear to be a separate issue from this PR, I opened a separate issue so we can track this as its own distinct bug. I believe that I've condensed as much of this conversation as I can into the ticket body there, but if you think I'm lacking any crucial info, we can continue our conversation about the segfaults there. |
|
Merging this, as it fixes the original issue (the missing license file). Thanks, @davzoku! |
🎟️ Tracking
#1148
📔 Objective
This PR fixes the issue mentioned above.
Essentially, we just have to include the license path for the maturin to build successfully.
Before Fix
After Fix
⏰ Reminders before review
team
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmedissue and could potentially benefit from discussion
:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes