简体   繁体   中英

Building a python wheel that includes svn:externals files on Jenkins

I'm building a package on Python 2.7.6 32bit Windows 32

The only definitive source of some components of a package is an svn 'share'. The common practice in this company is to include that into your project the using svn:externals.

The normal way to build this package is:

python setup.py bdist_wheel

All appears normal on my workstation (where I checked out the code with TortoiseSVN), but when I run the same process on Jenkins the bdist_wheel process does not include any .py file that was sourced via svn:externals.

After reading through the documentation, this appears to be because of a feature which identifies which scripts are part of the package based on which files are tracked by SVN. It appears that as a consequence of how Jenkins checks out the files, the bdist_wheel sees that I'm using SVN and assumes that it knows how to determine which files are tracked, but gets the answer wrong.

What I need is a way to stop the bdist_wheel command from trying to guess which files I care about (I actually want every .py file in the project to be included, regardless of how it's been brought in)

I tried tried specifying the files I needed using a MANIFEST.in file, but it did not work.

recursive-include externals *.py

In this example, 'externals' is a top-level directory in my source-tree which contains an init .py file and a bunch of svn:external'd directories. Only the init file can be seen in the built whl file.

Unfortunately this makes the .py files behave as if they were data, in the log I can see this:

copying build\lib\externals\security\credentials.py -> build\bdist.win32\wheel\foopackage-0.0.4.data\..\externals\security

That's obviously not a real solution!

Pip, Virtualenv and all relevant tools are at the latest stable versions.

It turns out that this problem is caused by Jenkins using a very old SVN standard (1.4) for it's own repositories. Switching to 1.7 corrects this behavior.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM