Manually Add Source Files to Conda-Build Package

89 Views Asked by At

I am building a conda package for a pure python application. The application has a setup.py file that the build.sh file uses to locate the packages that should go into the build. This works well for all of the normal packages.

Now, I have a "nested" package that I also want to include in the build. It isn't picked up by the setuptools find_packages() function, and when I tried to add it to the array I got an exception.

The location is src/layers/core_layer where core_layer is an importable python package. I figured that my best option would be to simply copy the core_layer directory into the build PREFIX in the build.sh file, however I have not been able to get it to work.

Running the command cp -r $SRC_DIR/src/layers/core_layer $PREFIX/lib/python${PY_VER}/site-packages eventually ends in an error during the conda-build command with no useful output:

subprocess.CalledProcessError: Command '['/bin/bash', '-o', 'errexit', '/home/ec2-user/anaconda3/envs/X/conda-bld/X_1697117436940/work/conda_build.sh']' returned non-zero exit status 1.

I verified that both of the paths actually exist. Am I doing something wrong? What is the recommended way to manually copy files into the build directory to be included in the package artifact?

Thanks

0

There are 0 best solutions below