Tox, sdist and Operation not permitted

For some reason testing my package with tox started failing. The problem relies in sdist command which fails with “Operation not permitted” error:

hard linking venv/lib/python2.7/encodings/__init__.py -> my_package/venv/lib/python2.7/encodings error: [Errno 1] Operation not permitted

in fact this file is actually owned by a root :<

ubuntu@box906:~/my_package$ ls -l venv/lib/python2.7/encodings/__init__.py -rw-r--r-- 1 root root 5698 Jun 22 2015 venv/lib/python2.7/encodings/__init__.py

In fact all the files in encodings directory are owned by root

ubuntu@box906:~/my_package$ ls -ltra venv/lib/python2.7/encodings/*py -rw-r--r-- 1 root root 5698 Jun 22 2015 venv/lib/python2.7/encodings/__init__.py -rw-r--r-- 1 root root 13630 Jun 22 2015 venv/lib/python2.7/encodings/cp1257.py -rw-r--r-- 1 root root 13070 Jun 22 2015 venv/lib/python2.7/encodings/cp1256.py -rw-r--r-- 1 root root 12722 Jun 22 2015 venv/lib/python2.7/encodings/cp1255.py -rw-r--r-- 1 root root 13758 Jun 22 2015 venv/lib/python2.7/encodings/cp1254.py -rw-r--r-- 1 root root 13350 Jun 22 2015 venv/lib/python2.7/encodings/cp1253.py -rw-r--r-- 1 root root 13767 Jun 22 2015 venv/lib/python2.7/encodings/cp1252.py -rw-r--r-- 1 root root 13617 Jun 22 2015 venv/lib/python2.7/encodings/cp1251.py -rw-r--r-- 1 root root 13942 Jun 22 2015 venv/lib/python2.7/encodings/cp1250.py -rw-r--r-- 1 root root 13361 Jun 22 2015 venv/lib/python2.7/encodings/cp1140.py -rw-r--r-- 1 root root 13369 Jun 22 2015 venv/lib/python2.7/encodings/cp1026.py -rw-r--r-- 1 root root 13824 Jun 22 2015 venv/lib/python2.7/encodings/cp1006.py -rw-r--r-- 1 root root 13377 Jun 22 2015 venv/lib/python2.7/encodings/cp037.py -rw-r--r-- 1 root root 2084 Jun 22 2015 venv/lib/python2.7/encodings/charmap.py .....

I found the error, for future users:

Define python version in circle.yml:

machine: python: version: 2.7.3

2 Likes