Skip to content

Conversation

markdryan
Copy link
Contributor

Update setup.py so that we copy LICENSE.TXT to src/api/python before creating the sdist. Any wheels built from this sdist will now contain the LICENSE.txt file.

Fixes #7604

Update setup.py so that we copy LICENSE.TXT to src/api/python before
creating the sdist.  Any wheels built from this sdist will now
contain the LICENSE.txt file.

Fixes Z3Prover#7604
@markdryan
Copy link
Contributor Author

markdryan commented Apr 7, 2025

Note that LICENSE.txt is already included in the sdist, but just not in the right place to get picked up when building the wheels. setup.py already copies it to the core folder. It's not clear to me whether it's supposed to be in core or not so I just left the original code as is and added a separate copy to core's parent.

@NikolajBjorner NikolajBjorner merged commit 14e2aad into Z3Prover:master Apr 7, 2025
1 check passed
@NikolajBjorner
Copy link
Contributor

Thanks,

I am merging and checking with nightly build. In case it does the job it is good otherwise, I will revert.
I don't understand what reasoning is behind ROOT_DIR vs LOCAL_SRC_DIR, as the update only uses ROOT_DIR for LICENSE.txt. @rhelmot

@rhelmot
Copy link
Collaborator

rhelmot commented Apr 7, 2025

the difference between ROOT_DIR and LOCAL_SRC_DIR is that ROOT_DIR is the folder that setup.py lives and LOCAL_SRC_DIR is the folder that CMakeLists.txt lives in (specifically, LOCAL_SRC_DIR is the subset of the whole z3 src tree that is copied into the python bindings dir for the purpose of isolated builds).

This is probably a correct change, but I'm not sure if it completes the job of making sure that the license shows up in the binary distributions. Do we still use the configuration where we assemble a wheel from the canonical z3 build? iirc no, and this should solve the problem in the case I remember building which builds z3 in the manylinux docker container, but just covering my bases.

@NikolajBjorner
Copy link
Contributor

I checked, the license does show up.

arbipher pushed a commit to arbipher/z3 that referenced this pull request Apr 17, 2025
Update setup.py so that we copy LICENSE.TXT to src/api/python before
creating the sdist.  Any wheels built from this sdist will now
contain the LICENSE.txt file.

Fixes Z3Prover#7604
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python wheels do not contain the LICENSE.txt file
3 participants